Socket
Socket
Sign inDemoInstall

js-awe

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-awe - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

8

package.json
{
"name": "js-awe",
"version": "1.0.11",
"version": "1.0.12",
"homepage": "https://github.com/josuamanuel/js-awe",

@@ -14,3 +14,3 @@ "author": "josuamanuel@hotmail.com",

},
"license": "ISC",
"license": "MIT",
"devDependencies": {

@@ -22,3 +22,5 @@ "mocha": "^10.0.0"

"fluture": "^14.0.0",
"lodash": "^4.17.21",
"just-clone": "^6.1.1",
"just-compare": "^2.2.2",
"just-deep-map-values": "^1.1.1",
"loglevel": "^1.8.0",

@@ -25,0 +27,0 @@ "node-fetch": "^3.2.10",

'use strict'
//import pkg from 'lodash';
//const { cloneDeep } = pkg;
import { cloneDeep } from './lodashCloneDeep.js'
import clone from 'just-clone'
const logWithPrefix = (title, displayFunc) => (message) => {

@@ -114,3 +111,3 @@

stateRules = cloneDeep(rules)
stateRules = clone(rules)
}

@@ -195,3 +192,3 @@

return new Proxy(cloneDeep(values), this)
return new Proxy(clone(values), this)
}

@@ -234,3 +231,3 @@

return new EnumMap(cloneDeep(invertedValues))
return new EnumMap(clone(invertedValues))
}

@@ -422,3 +419,3 @@

const objClone = pureFunction ? cloneDeep(objIni, reviverPromiseForCloneDeep) : objIni
const objClone = pureFunction ? clone(objIni, reviverPromiseForCloneDeep) : objIni

@@ -425,0 +422,0 @@ let exitVar = false

'use strict'
import _ from 'lodash'
import clone from 'just-clone'
import jsUtils from './jsUtils.js'
function reviverPromiseForCloneDeep(value) {
if (jsUtils.isPromise(value)) return value
}

@@ -32,3 +29,3 @@ function cloneCopy(to, from, firstCleanTo, shallow) {

if (from.hasOwnProperty(prop)) {
to[prop] = _.cloneDeepWith(from[prop], reviverPromiseForCloneDeep)
to[prop] = clone(from[prop]) //, reviverPromiseForCloneDeep)
}

@@ -94,2 +91,2 @@ }

export { cloneCopy, wildcardToRegExp, promiseAll, _ }
export { cloneCopy, wildcardToRegExp, promiseAll }
import { resolve } from 'fluture'
import { R, pipe, pipeWhile, runFunctionsSyncOrParallel } from './ramdaExt.js'
import _ from 'lodash'
import compare from 'just-compare'
import { repeat, traverse } from './jsUtils.js'

@@ -43,3 +43,3 @@

parent =>
son?.length > parent?.length && _.isEqual(parent, son.slice(0, parent.length))
son?.length > parent?.length && compare(parent, son.slice(0, parent.length))

@@ -50,3 +50,3 @@

sibling2 =>
_.isEqual(
compare(
sibling1?.slice(0,-1),

@@ -63,3 +63,3 @@ sibling2?.slice(0,-1)

path.length < el.path.length &&
_.isEqual(
compare(
el.path.slice(0, path.length),

@@ -77,3 +77,3 @@ path

path.length < el.path.length &&
_.isEqual(
compare(
el.path.slice(0, path.length),

@@ -90,4 +90,4 @@ path

return familyMember1 => familyMember2 =>
_.isEqual(ancestorInCommon, familyMember1?.slice(0, ancestorInCommon.length)) &&
_.isEqual(ancestorInCommon, familyMember2?.slice(0, ancestorInCommon.length))
compare(ancestorInCommon, familyMember1?.slice(0, ancestorInCommon.length)) &&
compare(ancestorInCommon, familyMember2?.slice(0, ancestorInCommon.length))
}

@@ -135,5 +135,5 @@

el.path.length >= 3 &&
_.isEqual(elGrandparent, nextToElGrandparent) &&
compare(elGrandparent, nextToElGrandparent) &&
// el is the only child of parent
_.isEqual(getDescendants(stack)(elParent), [el]) &&
compare(getDescendants(stack)(elParent), [el]) &&
// If previous was not accrued we dont want this to be desdendent of the current grandParent unless previous

@@ -140,0 +140,0 @@ // is a brother of the parent (function header of subsequent parellel functions).

@@ -5,4 +5,3 @@ // ts-check

import { reject, resolve, parallel as FParallel, isFuture } from 'fluture';
import pkg from 'lodash'; 
const { cloneDeep } = pkg; 
import clone from 'just-clone'

@@ -1072,3 +1071,3 @@ // //Only needed for testing

if(typeof prefixOrFormatter === 'function') {
const cloneObj = cloneDeep(obj)
const cloneObj = clone(obj)
console.log(prefixOrFormatter(...cloneObj))

@@ -1075,0 +1074,0 @@ }else console.log(prefixOrFormatter, ...obj)

import _ from 'lodash'
import { anonymize } from './anonymize.js'
import { CustomError } from './jsUtils.js'
import { log } from './logLevelExtension.js'
import deepMapValues from 'just-deep-map-values'
import compare from 'just-compare'

@@ -144,3 +145,3 @@ const lengthSanitizer = (_, value) => {

return _.cloneDeepWith(obj, customizer)
return deepMapValues(obj, customizer)

@@ -154,3 +155,3 @@ function isToReplace(fieldOrValue, key, val, keyOrVal) {

return _.isEqual(fieldOrValue, keyOrVal)
return compare(fieldOrValue, keyOrVal)
}

@@ -168,10 +169,10 @@

function customizer(obj, parentKey, parentObj) {
if (obj === null || obj === undefined || obj === {}) return undefined
function customizer(leafValue, keyOfLeaf) {
if (leafValue === null || leafValue === undefined || leafValue === {}) return leafValue
for (let { field, value, type, sanitizer, replacer } of allGroupsConsolidated) {
if (typeMet(obj, type) === false) return undefined
if (sanitizer !== undefined) return sanitizer(parentKey, obj)
if (field !== undefined && isToReplace(field, parentKey, obj, parentKey)) return toReplace(replacer, parentKey, obj)
if (value !== undefined && isToReplace(value, parentKey, obj, obj)) return toReplace(replacer, parentKey, obj)
if (typeMet(leafValue, type) === false) return leafValue
if (sanitizer !== undefined) return sanitizer(keyOfLeaf, leafValue)
if (field !== undefined && isToReplace(field, keyOfLeaf, leafValue, keyOfLeaf)) return toReplace(replacer, keyOfLeaf, leafValue)
if (value !== undefined && isToReplace(value, keyOfLeaf, leafValue, leafValue)) return toReplace(replacer, keyOfLeaf, leafValue)
}

@@ -178,0 +179,0 @@

import { strict as assert } from 'assert'
import { EnumMap, Enum, formatDate, CustomError, findDeepKey, traverse } from '../src/jsUtils.js'
import pkg from 'lodash';
const { cloneDeep, isObjectLike } = pkg;
import clone from 'just-clone'

@@ -462,5 +461,5 @@ describe('jsUtils', () => {

//subject
const subject = cloneDeep(subjectBase)
const subject = clone(subjectBase)
//expected
const expected = cloneDeep(subjectBase)
const expected = clone(subjectBase)
expected.house.room[0].wardrove.jean = 'red'

@@ -483,5 +482,5 @@

//subject
const subject = cloneDeep(subjectBase)
const subject = clone(subjectBase)
//expected
const expected = cloneDeep(subjectBase)
const expected = clone(subjectBase)
expected.house.room[1].bed = null

@@ -508,5 +507,5 @@ expected.house.room[0].wardrove.jean = 'red'

//subject
const subject = cloneDeep(subjectBase)
const subject = clone(subjectBase)
//expected
const expected = cloneDeep(subjectBase)
const expected = clone(subjectBase)
expected.house.room[0].wardrove.jean = 'red'

@@ -531,5 +530,5 @@

//subject
const subject = cloneDeep(subjectBase)
const subject = clone(subjectBase)
//expected
const expected = cloneDeep(subjectBase)
const expected = clone(subjectBase)
expected.house.room[0].wardrove.jean = 'red'

@@ -536,0 +535,0 @@ expected.house.room[2] = 'nothing'

import { strict as assert } from 'assert'
import { wildcardToRegExp, cloneCopy, promiseAll, _, } from '../src/lodashExt.js'
import { wildcardToRegExp, cloneCopy, promiseAll, } from '../src/lodashExt.js'
import { traverse, getValueAtPath, setValueAtPath } from '../src/jsUtils.js'
import clone from 'just-clone'

@@ -97,5 +98,5 @@ describe('lodashExt', () => {

//subject
const subject = _.cloneDeep(setValueAtPathSubject)
const subject = clone(setValueAtPathSubject)
//expected
const expected = _.cloneDeep(setValueAtPathSubject)
const expected = clone(setValueAtPathSubject)
expected.house.room[0].wardrove = { test: 'mytest' }

@@ -116,5 +117,5 @@

//subject
const subject = _.cloneDeep(setValueAtPathSubject)
const subject = clone(setValueAtPathSubject)
//expected
const expected = _.cloneDeep(setValueAtPathSubject)
const expected = clone(setValueAtPathSubject)
expected.house.room[4] = {}

@@ -157,5 +158,5 @@ expected.house.room[4].wardrove = { test: 'mytest' }

//subject
const subject = _.cloneDeep(setValueAtPathSubject)
const subject = clone(setValueAtPathSubject)
//expected
const expected = _.cloneDeep(setValueAtPathSubject)
const expected = clone(setValueAtPathSubject)
expected.house.room[4] = []

@@ -162,0 +163,0 @@ expected.house.room[4][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