Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.load({}, outcome.e(next).s(function(models) {
// doesn't work for regexp
if (typeof query === "object") {
query = traverse.clone(query);
// query = JSON.parse(JSON.stringify(query));
}
var sifter = sift(query);
next(null, models.filter(function (model) {
return sifter.test(model.context());
}));
}));
},
State.prototype.set = function (key, value) {
if (arguments.length === 2) {
// If a key and value were provided we use dot-prop
dotProp.set(this.__ImmutableState__, key, value)
} else {
// If only a value was provided we overwrite state
this.__ImmutableState__ = traverse.clone(key)
}
this.listeners(this.get())
}
}
if (node.trailingComments) {
for (j = 0; j < node.trailingComments.length; j++) {
comment = node.trailingComments[j];
id = comment.range.join('-');
if (!coveredComments[id] && isInstrumentComment(comment)) {
pp(insertions, i + 1, instrumentCall(comment, type, tick));
TODO.push(instrumentName(comment));
coveredComments[id] = true;
}
}
}
}
if (this.key === 'body') {
var nextValue = traverse.clone(node);
for (var k = 0; k < node.length; k++) {
instrumentComments(node[k], k);
}
// inserting things in places is hard with arrays, since when you
// push something into i, it changes the positions of other stuff.
// we avoid this problem by
// 1: doing batch insertions with splice
// 2: iterating backwards
insertions = pairs(insertions);
insertions.sort(function(a, b) { return b[0] - a[0]; });
for (var m = 0; m < insertions.length; m++) {
nextValue.splice.apply(nextValue, [+insertions[m][0], 0].concat(insertions[m][1]));
}
this.update(nextValue);
} else if (node && node.type === 'Program' && node.body.length === 0) {
// a bare program consisting only of comments falls into this ditch:
Hash.clone = function (ref) {
return Traverse.clone(ref);
};
Hash.clone = function (ref) {
return Traverse.clone(ref);
};
Hash.clone = function (ref) {
return Traverse.clone(ref);
};
State.prototype.get = function () {
return traverse.clone(this.__ImmutableState__)
}
LJSRequest.prototype.safeHeaders = function() {
var safeHeaders = traverse.clone(this.req.headers);
if (safeHeaders.authorization) {
safeHeaders.authorization = 'CONFIDENTIAL';
}
return safeHeaders;
};