grist-gnash
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -1,3 +0,3 @@ | ||
var _ = require('lodash'); | ||
var sift = require('sift'); | ||
const _ = require('lodash-contrib'); | ||
const sift = require('sift'); | ||
@@ -38,10 +38,11 @@ | ||
function ensurePath(obj, k, cb) { | ||
var path = k.split("."); | ||
var t = null; | ||
const path = k.split("."); | ||
let t = null; | ||
if (path.length == 1) | ||
t = obj; | ||
else { | ||
var l = obj; | ||
for (var i = 0; i < path.length - 1; i++) { | ||
var p = path[i]; | ||
let l = obj; | ||
let i = 0; | ||
for (; i < path.length - 1; i++) { | ||
const p = path[i]; | ||
if (!l[p]) | ||
@@ -72,8 +73,12 @@ l[p] = {}; | ||
function findDeepest(path, t) { | ||
let i = 0; | ||
//noinspection StatementWithEmptyBodyJS | ||
for (; i < path.length - 1 && t[path[i]]; t = t[path[i++]]); | ||
return [t, path[i]]; | ||
} | ||
function applyUnset(obj, $set) { | ||
_.each($set, function (v, k) { | ||
var path = k.split("."); | ||
var t = obj; | ||
for (var i = 0; i < path.length - 1 && t[path[i]]; t = t[path[i++]]); | ||
k = path[i]; | ||
_.each($set, function (val, key) { | ||
const path = key.split("."); | ||
const [t, k] = findDeepest(path, obj); | ||
if (!t || !t[k]) return; | ||
@@ -116,7 +121,5 @@ delete t[k]; | ||
function applyPop(obj, $op) { | ||
_.each($op, function (v, k) { | ||
var path = k.split("."); | ||
var t = obj; | ||
for (var i = 0; i < path.length - 1 && t[path[i]]; t = t[path[i++]]); | ||
k = path[i]; | ||
_.each($op, function (v, key) { | ||
const path = key.split("."); | ||
const [t, k] = findDeepest(path, obj); | ||
if (!t || !t[k]) return; | ||
@@ -134,7 +137,5 @@ if (_.isArray(t[k])) { | ||
function applyPull(obj, $op) { | ||
_.each($op, function (v, k) { | ||
var path = k.split("."); | ||
var t = obj; | ||
for (var i = 0; i < path.length - 1 && t[path[i]]; t = t[path[i++]]); | ||
k = path[i]; | ||
_.each($op, function (v, key) { | ||
const path = key.split("."); | ||
const [t, k] = findDeepest(path, obj); | ||
if (!t || !t[k]) return; | ||
@@ -148,7 +149,5 @@ if (!_.isArray(t[k])) | ||
function applyPullAll(obj, $op) { | ||
_.each($op, function (v, k) { | ||
var path = k.split("."); | ||
var t = obj; | ||
for (var i = 0; i < path.length - 1 && t[path[i]]; t = t[path[i++]]); | ||
k = path[i]; | ||
_.each($op, function (v, key) { | ||
const path = key.split("."); | ||
const [t, k] = findDeepest(path, obj); | ||
if (!t || !t[k]) return; | ||
@@ -162,7 +161,5 @@ if (_.isArray(t[k])) { | ||
function applyRename(obj, $op) { | ||
_.each($op, function (v, k) { | ||
var path = k.split("."); | ||
var t = obj; | ||
for (var i = 0; i < path.length - 1 && t[path[i]]; t = t[path[i++]]); | ||
k = path[i]; | ||
_.each($op, function (v, key) { | ||
const path = key.split("."); | ||
const [t, k] = findDeepest(path, obj); | ||
if (!t || !t[k]) return; | ||
@@ -169,0 +166,0 @@ ensurePath(obj, v, function (t1, k1) { |
{ | ||
"author": "Refael Ackermann<refael@empeeric.com>", | ||
"author": "Refael Ackermann<me@refack.com>", | ||
"name": "grist-gnash", | ||
"description": "mongodb style object mutator (derived from TingoDB)", | ||
"version": "1.0.3", | ||
"repository": "Empeeric/grist-gnash.git", | ||
"version": "1.1.0", | ||
"repository": "node4good/grist-gnash.git", | ||
"license": "MIT", | ||
"contributors": [ | ||
@@ -16,8 +17,7 @@ "PushOk Software <support@pushok.com>" | ||
"engines": { | ||
"node": ">= v0.8.x" | ||
"node": ">= 6" | ||
}, | ||
"dependencies": { | ||
"sift": "", | ||
"lodash": "", | ||
"lodash-contrib": "" | ||
"sift": "^3.2.6", | ||
"lodash-contrib": "^4.1200.1" | ||
}, | ||
@@ -28,3 +28,7 @@ "scripts": { | ||
"postpublish": "git push origin master --tags" | ||
}, | ||
"devDependencies": { | ||
"istanbul": "^0.4.5", | ||
"mocha": "^3.2.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 3 instances in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
46283
2
1
2
17
188
+ Addedlodash@4.12.0(transitive)
+ Addedlodash-contrib@4.1200.1(transitive)
+ Addedsift@3.3.12(transitive)
- Removedlodash@
- Removedlodash@4.17.214.3.0(transitive)
- Removedlodash-contrib@43000.0.2(transitive)
- Removedsift@17.1.3(transitive)
Updatedlodash-contrib@^4.1200.1
Updatedsift@^3.2.6