Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getOwnPropertyNames(this).forEach(function (name) {
var value;
if (startsWith.call(name, '__')) {
if (name === '__value') return;
value = this[name];
if (!value._id_) return;
if (!value.hasOwnProperty('_value')) return;
} else if (isDigit(name[0]) && this.propertyIsEnumerable(name)) {
value = this[name];
if (!value || !value._id_ || !endsWith.call(value._id_, '"')) return;
} else {
return;
}
cb(value, value._id_, this);
}, this);
}),
module.exports = function self(proto, name) {
var prop, nuProto;
if (!startsWith.call(name, '__') || (name === '__value') ||
!(prop = this[name]) || (this[name] !== this[name.slice(1)])) {
return;
}
nuProto = proto[name] || objProto;
if (prop.__proto__._children_) remove.call(prop.__proto__._children_, prop);
prop.__proto__ = nuProto;
if (nuProto._children_) nuProto._children_.push(prop);
getOwnPropertyNames(prop).forEach(self.bind(prop, proto[name] || objProto));
prop._refresh_();
};
iterate = function (name) {
if (done[name]) return;
done[name] = true;
if (!startsWith.call(name, '_$') || obj.hasOwnProperty(name) ||
(ignores && ignores[name.slice(2)])) {
return;
}
prop = proto[name];
if (!prop || !prop._$required) return;
if (prop._$required._value && (prop._value == null)) {
throw new TypeError('undefined is not a value');
}
};
while (proto !== Object.prototype) {
getOwnPropertyNames(this).forEach(function (name) {
var value;
if (!startsWith.call(name, '__')) return;
if (name === '__value') return;
value = this[name];
if (!value._id_) return;
if (!value.hasOwnProperty('_value')) return;
cb(value, value._id_, this);
}, this);
}),
iterate = function (name) {
if (done[name]) return;
done[name] = true;
if (!startsWith.call(name, '_$') || this.hasOwnProperty(name) ||
(errors && errors[name.slice(2)])) {
return;
}
prop = proto[name];
if (!isProperty(prop)) return;
try {
prop.validateUndefinedExt();
} catch (e) {
if (!errors) (errors = {});
errors[name.slice(2)] = e;
}
};
while (proto !== Object.prototype) {
getOwnPropertyNames(obj).forEach(function (name) {
var rel;
if (!startsWith.call(name, '__')) return;
if (metaNames.hasOwnProperty(name)) return;
if ((name === '__value') || !(rel = this.obj[name]) ||
(rel._type_ !== 'relation')) {
return;
}
if (rel._value && (typeof rel._value === 'function') &&
rel._value.hasOwnProperty('_overridenValue_')) {
return;
}
name = name.slice(2);
if (this._filter(name)) {
this[this._serialize(name)] = name;
++this.count;
}
}, this);
obj.on('update', this._onupdate.bind(this));