diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/mongoose/lib/schema/map.js | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/mongoose/lib/schema/map.js')
-rw-r--r-- | node_modules/mongoose/lib/schema/map.js | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/node_modules/mongoose/lib/schema/map.js b/node_modules/mongoose/lib/schema/map.js deleted file mode 100644 index 468faea..0000000 --- a/node_modules/mongoose/lib/schema/map.js +++ /dev/null @@ -1,62 +0,0 @@ -'use strict'; - -/*! - * ignore - */ - -const MongooseMap = require('../types/map'); -const SchemaMapOptions = require('../options/SchemaMapOptions'); -const SchemaType = require('../schematype'); -/*! - * ignore - */ - -class Map extends SchemaType { - constructor(key, options) { - super(key, options, 'Map'); - this.$isSchemaMap = true; - } - - set(option, value) { - return SchemaType.set(option, value); - } - - cast(val, doc, init) { - if (val instanceof MongooseMap) { - return val; - } - - if (init) { - const map = new MongooseMap({}, this.path, doc, this.$__schemaType); - - if (val instanceof global.Map) { - for (const key of val.keys()) { - map.$init(key, map.$__schemaType.cast(val.get(key), doc, true)); - } - } else { - for (const key of Object.keys(val)) { - map.$init(key, map.$__schemaType.cast(val[key], doc, true)); - } - } - - return map; - } - - return new MongooseMap(val, this.path, doc, this.$__schemaType); - } - - clone() { - const schematype = super.clone(); - - if (this.$__schemaType != null) { - schematype.$__schemaType = this.$__schemaType.clone(); - } - return schematype; - } -} - -Map.prototype.OptionsConstructor = SchemaMapOptions; - -Map.defaultOptions = {}; - -module.exports = Map; |