Returns a new object with its new aspect from an object schema
@param data Object to map
@param schema Fields to map
@param options Options
@returns {*}
@private
507496
function _mapObject(data, schema, options) {
    return Object
        .keys(schema)
        .reduce(function (memo, key) {
            memo[key] = _mapDataValue(data, schema[key]);
            return memo;
        }, options.keep ? _clone(data) : {});
}
871751
function(data) {
        var response = [];
        var featureNodes = this.getElementsByTagNameNS(data, '*',
            'FIELDS');

        for(var i=0, len=featureNodes.length;i<len;i++) {
            var featureNode = featureNodes[i];
            var geom = null;

            // attributes can be actual attributes on the FIELDS tag, 
            // or FIELD children
            var attributes = {};
            var j;
            var jlen = featureNode.attributes.length;
            if (jlen > 0) {
                for(j=0; j<jlen; j++) {
                    var attribute = featureNode.attributes[j];
                    attributes[attribute.nodeName] = attribute.nodeValue;
                }
            } else {
                var nodes = featureNode.childNodes;
                for (j=0, jlen=nodes.length; j<jlen; ++j) {
                    var node = nodes[j];
                    if (node.nodeType != 3) {
                        attributes[node.getAttribute("name")] = 
                            node.getAttribute("value");
                    }
                }
            }

            response.push(
                new OpenLayers.Feature.Vector(geom, attributes, null)
            );
        }
        return response;
    }
413146
function transformModel (options, data) {
  const prop = (options.model && options.model.prop) || 'value'
  const event = (options.model && options.model.event) || 'input';
  (data.props || (data.props = {}))[prop] = data.model.value
  const on = data.on || (data.on = {})
  if (isDef(on[event])) {
    on[event] = [data.model.callback].concat(on[event])
  } else {
    on[event] = data.model.callback
  }
}
694296
function processData(res, data, options) {
  const handlers = Object.assign({}, deserializers, options.deserializers);
  const contentType = res.headers['content-type'];
  const types = typeof contentType === 'string' ? contentType.split(';') : [];

  // if there are no content types, return the data unmodified
  if (!types.length) {
    return data;
  }

  return types.reduce((d, type) => {
    try {
      const t = type.toLocaleLowerCase().trim();
      const handler = handlers[t];

      if (d instanceof Error || typeof handler !== 'function') {
        return d;
      }
      return handler(d);
    } catch (error) {
      return error;
    }
  }, data);
}
1181437
function(data) {
        this.features = [];
        this.styles   = {};
        this.fetched  = {};

        // Set default options 
        var options = {
            depth: 0,
            styleBaseUrl: this.styleBaseUrl
        };

        return this.parseData(data, options);
    }
1373568
function compilePlainObject (schema, options) {
  class PlainModelInstance extends PlainBaseModel {
    constructor (data, options = {}) {
      super(data, options, schema)
    }
  }

  PlainModelInstance.schema = schema

  // if the user wants to allow modifications
  if (options.freeze !== false) {
    Object.freeze(PlainModelInstance)
  }

  return PlainModelInstance
}
469642
function schema(opts: Options): Object {
    const constructedSchema = {
        blocks: {
            [opts.typeItem]: {
                parent: { types: opts.types },
                nodes: [{ objects: ['block'] }],

                normalize: normalize({
                    parent_type_invalid: (change, context) =>
                        change.unwrapBlockByKey(context.node.key, {
                            normalize: false
                        }),
                    child_object_invalid: (change, context) =>
                        wrapChildrenInDefaultBlock(opts, change, context.node)
                })
            }
        }
    };

    // validate all list types, ensure they only have list item children
    opts.types.forEach(type => {
        constructedSchema.blocks[type] = {
            nodes: [{ types: [opts.typeItem] }],
            normalize: normalize({
                child_type_invalid: (change, context) =>
                    change.wrapBlockByKey(context.child.key, opts.typeItem, {
                        normalize: false
                    })
            })
        };
    });

    return constructedSchema;
}
482842
function SchemaType (path, options, instance) {
  this.path = path;
  this.instance = instance;
  this.validators = [];
  this.setters = [];
  this.getters = [];
  this.options = options;
  this._index = null;
  this.selected;

  for (var i in options) if (this[i] && 'function' == typeof this[i]) {
    // { unique: true, index: true }
    if ('index' == i && this._index) continue;

    var opts = Array.isArray(options[i])
      ? options[i]
      : [options[i]];

    this[i].apply(this, opts);
  }
}
307443
function SchemaString (key, options) {
  this.enumValues = [];
  this.regExp = null;
  SchemaType.call(this, key, options, 'String');
}
195762
function (options) {
                var ret = {};
                for (var k in this.schema) {
                    if (this.schema.hasOwnProperty(k)) {
                        ret[k] = this.getTransformedValue(k);
                    }
                }

                this.set(ret, options);
            }
1343991
function (schema, process) {
		var that = this;

		if (!(schema instanceof Schema)) {
			throw new Error('first argument must be instance of Schema');
		}

		if (process) {
			var r = process.call(this, schema);

			if (r != null && !r) {
				return this;
			}
		}

		_.each(schema.fields, function (fieldSchema, fieldName) {
			that.field(fieldName).like(fieldSchema, process);
		});

		if (process) {
			return this;
		}

		_.each(schema, function (value, key) {
			if (/^(_.*|fields)$/.test(key)) {
				return;
			}

			that[key] = _.cloneDeep(value);
		});

		return this;
	}
1268853
public function createFromArrayWithContext($data, $options)
    {
        $_edgeClass = $this->_edgeClass;

        return $_edgeClass::createFromArray($data, $options);
    }
1087982
function(wrapper, name, options){
    function createLocalId(id){
      if (typeof id == 'string')
        return function(data, item){
          return data[id] == item.data[id];
        };

      if (typeof id == 'function')
        return id;
    }

    if (this instanceof )
    {
      if (!wrapper)
        wrapper = $self;

      if (!name || getTypeByNameIfDefined(name))
      {
        /** @cut */ if (getTypeByNameIfDefined(name)) basis.dev.warn(namespace + ': Duplicate entity set type name `' + this.name + '`, name ignored');
        name = getUntitledName('UntitledEntitySetType');
      }

      var entitySetType = new EntitySetConstructor({
        entitySetClass: {
          /** @cut */ className: namespace + '.EntitySet(' + (typeof wrapper == 'string' ? wrapper : (wrapper.type || wrapper).name || 'UnknownType') + ')',
          /** @cut */ name: 'Set of {' + (typeof wrapper == 'string' ? wrapper : (wrapper.type || wrapper).name || 'UnknownType') + '}',
          wrapper: wrapper,
          localId: createLocalId(options && options.localId)
        }
      });

      var EntitySetClass = entitySetType.entitySetClass;
      var result = function(data, entitySet){
        if (data != null)
        {
          if (entitySet instanceof EntitySet == false)
            entitySet = entitySetType.createEntitySet();

          entitySet.set(data instanceof Dataset ? data.getItems() : arrayFrom(data));

          return entitySet;
        }
        else
          return null;
      };

      // if wrapper is string resolve it by named type map
      if (typeof wrapper == 'string')
        EntitySetClass.prototype.wrapper = getTypeByName(wrapper, EntitySetClass.prototype, 'wrapper');

      // resolve type name
      defineType(name, result);

      // extend result with additional properties
      extend(result, {
        type: entitySetType,
        typeName: name,

        toString: function(){
          return name + '()';
        },

        reader: function(data){
          if (Array.isArray(data))
          {
            var wrapper = EntitySetClass.prototype.wrapper;
            return data.map(wrapper.reader || wrapper);
          }

          return data;
        },

        extendClass: function(source){
          EntitySetClass.extend.call(EntitySetClass, source);
          return result;
        },
        extendReader: function(extReader){
          var reader = result.reader;

          result.reader = function(data){
            if (Array.isArray(data))
              extReader(data);
            return reader(data);
          };

          return result;
        },

        // deprecated in 1.3.0
        entitySetType: entitySetType,
        extend: function(){
          /** @cut */ basis.dev.warn('basis.entity: EntitySetType.extend() is deprecated, use EntitySetType.extendClass() instead.');
          return EntitySetClass.extend.apply(EntitySetClass, arguments);
        }
      });

      // deprecated in 1.3.0
      /** @cut */ basis.dev.warnPropertyAccess(result, 'entitySetType', entitySetType,
      /** @cut */   'basis.entity: EntitySetType.entitySetType is deprecated, use EntitySetType.type instead.'
      /** @cut */ );

      return result;
    }
  }
437628
function SchemaArray (key, cast, options) {
  if (cast) {
    var castOptions = {};

    if ('Object' === cast.constructor.name) {
      if (cast.type) {
        // support { type: Woot }
        castOptions = cast;
        cast = cast.type;
        delete castOptions.type;
      } else {
        cast = Mixed;
      }
    }

    var caster = cast.name in Types ? Types[cast.name] : cast;
    this.casterConstructor = caster;
    this.caster = new caster(null, castOptions);
  }

  SchemaType.call(this, key, options);

  var self = this
    , defaultArr
    , fn;

  if (this.defaultValue) {
    defaultArr = this.defaultValue;
    fn = 'function' == typeof defaultArr;
  }

  this.default(function(){
    var arr = fn ? defaultArr() : defaultArr || [];
    return new NeopreneArray(arr, self.path, this);
  });
}
636838
function (entity, action, options) {
                var ret = {},
                    data = entity.compose(action, options),
                    schemaDefinition,
                    schemaType,
                    isModel = entity instanceof Model,
                    factory = entity.factory;

                for (var key in entity.schema) {
                    if (entity.schema.hasOwnProperty(key) && (!isModel || (!options || !options.includeInIndex || _.contains(options.includeInIndex, key)))) {
                        schemaDefinition = entity.schema[key];
                        schemaType = schemaDefinition.type;


                        var value;
                        if (data[key] && schemaDefinition.isReference && schemaType.classof && schemaType.classof(Entity) && !schemaType.classof(Model)) {
                            value = {};
                            value[schemaType.prototype.idField] = data[key].identifier();
                        } else {
                            value = this._getCompositionValue(data[key], key, action, options, entity);
                        }
                        if (value !== undefined) {
                            ret[this._getReferenceKey(key, schemaType)] = value;
                        }
                    }
                }
                return ret;
            }
37830
function Mongo_schema(definition, options) {

        if (!options) {
            options = {};
        }
        if (!Type.assert(Type.OBJECT, options)) {
            throw new error.HttpError(500, {options: options}, 'Schema options must be object');
        } else if (!Type.assert(Type.OBJECT, definition)) {
            throw new error.HttpError(500, {definition: definition}, 'Schema definition must be object');
        }
        logger.info('Mongo.schema:', {
            definition: definition,
            options: options
        });
        return new mongoose.Schema(definition, options);
    }
1157211
function instance(schema, defaults, options) {
  const name = 'instance'
  const type = `instance<${schema.name}>`
  const validate = (value = resolveDefaults(defaults)) => {
    return value instanceof schema
      ? [undefined, value]
      : [{ data: value, path: [], value, type }]
  }

  return new Kind(name, type, validate)
}