New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@domql/utils

Package Overview
Dependencies
Maintainers
3
Versions
198
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@domql/utils - npm Package Compare versions

Comparing version 2.3.21 to 2.3.23

37

object.js
'use strict'
import { isFunction, isObjectLike, isObject, isArray } from './types'
import { isFunction, isObjectLike, isObject, isArray, isString } from './types'

@@ -67,3 +67,3 @@ export const exec = (param, element, state) => {

if (isArray(objProp)) {
o[prop] = objProp.map(deepClone)
o[prop] = objProp.map(v => isObject(v) ? deepClone(v) : v)
} else if (isObject(objProp)) {

@@ -77,2 +77,35 @@ o[prop] = deepClone(objProp)

/**
* Stringify object
*/
export const deepStringify = (obj, stringified = {}) => {
console.log(obj)
for (const prop in obj) {
const objProp = obj[prop]
if (isFunction(objProp)) {
stringified[prop] = objProp.toString()
} else stringified[prop] = objProp
if (isObject(objProp)) deepStringify(stringified[prop], stringified[prop])
}
return stringified
}
/**
* Detringify object
*/
export const deepDestringify = (obj, stringified = {}) => {
for (const prop in obj) {
const objProp = obj[prop]
if (isString(objProp)) {
if (objProp.slice(0, 1) === '(') {
try {
stringified[prop] = eval(objProp) // eslint-disable-line
} catch (e) { if (e) stringified[prop] = objProp }
}
} else stringified[prop] = objProp
if (isObject(objProp)) deepDestringify(stringified[prop], stringified[prop])
}
return stringified
}
/**
* Overwrites object properties with another

@@ -79,0 +112,0 @@ */

4

package.json
{
"name": "@domql/utils",
"version": "2.3.21",
"version": "2.3.23",
"main": "index.js",

@@ -10,3 +10,3 @@ "license": "MIT",

},
"gitHead": "591bd439470038afee450aa314c56a257107b1a0"
"gitHead": "3757666fe613ef00cbdf7d020da4b27c8bf3fb54"
}
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