Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json-magic

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-magic - npm Package Compare versions

Comparing version 0.0.8 to 0.0.10

.npmignore

24

lib/Magic.js
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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc