Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
value: function(directives){
var i, id;
directives = directives || {};
if(this != source){
directives.previous = copy(source, {});
}
if(facetPrototype.save){
facetPrototype.save.call(this, directives);
}
var validation = validate(this, facetSchema);
var instance = this;
for(i in this){
if(this.hasOwnProperty(i)){
transfer(this[i]);
}
}
for (i in source){
if(source.hasOwnProperty(i) && !this.hasOwnProperty(i)){
transfer(undefined);
}
}
mustBeValid(validation);
var isNew = partial === NEW;
if(isNew && (typeof facetSchema.add === "function")){ // || )
partial = undefined;
id = facetSchema.add(source, directives);