json-magic
Advanced tools
Comparing version 0.0.8 to 0.0.10
const $check=require('check-types'); | ||
const jsonPointer=require('json-pointer'); | ||
const _s=require('underscore.string'); | ||
class Magic{ | ||
@@ -20,3 +16,3 @@ constructor(){} | ||
}else{ | ||
if (_s.count(path,'.')>_s.count(path,'/')){ | ||
if (count(path,'.')>count(path,'/')){ | ||
sep="."; | ||
@@ -253,3 +249,3 @@ }else{ | ||
if (!$check.string(key))return key; | ||
if (_s.startsWith(key,'$')){ | ||
if (key.startsWith('$')){ | ||
key='_' + key.substring(1); | ||
@@ -265,2 +261,18 @@ } | ||
function makeString(object) { | ||
if (object == null) return ''; | ||
return '' + object; | ||
}; | ||
function count(str, substr) { | ||
str = makeString(str); | ||
substr = makeString(substr); | ||
if (str.length === 0 || substr.length === 0) return 0; | ||
return str.split(substr).length - 1; | ||
} | ||
module.exports=Magic; |
{ | ||
"name": "json-magic", | ||
"version": "0.0.8", | ||
"version": "0.0.10", | ||
"description": "Utilities for manipulating JSON objects.", | ||
@@ -16,4 +16,3 @@ "homepage": "https://github.com/filepounder/json-magic", | ||
"check-types": "8.0.2", | ||
"json-pointer": "0.6.0", | ||
"underscore.string": "3.3.5" | ||
"json-pointer": "0.6.0" | ||
}, | ||
@@ -25,4 +24,4 @@ "engines": { | ||
"devDependencies": { | ||
"mocha": "5.0.1" | ||
"mocha": "6.1.4" | ||
} | ||
} |
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
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
8686
2
5
227
- Removedunderscore.string@3.3.5
- Removedsprintf-js@1.1.3(transitive)
- Removedunderscore.string@3.3.5(transitive)
- Removedutil-deprecate@1.0.2(transitive)