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

jskos-tools

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jskos-tools - npm Package Compare versions

Comparing version 0.1.22 to 0.1.23

5

lib/tools.js

@@ -64,4 +64,5 @@ const _ = require("lodash")

* @param {array} replaceCircular - additional property names that should be replace with open world [null] statements
* @param {bool} skipUnderscore - whether to skip properties starting with `_` (default `true`)
*/
const copyDeep = (object, replaceCircular = []) => {
const copyDeep = (object, replaceCircular = [], skipUnderscore = true) => {
replaceCircular = replaceCircular.concat([

@@ -73,3 +74,3 @@ "ancestors", "narrower", "broader", "mappings", "TOPCONCEPTS", "MAPPINGS", "PROVIDER"

// Ignore all properties starting with _
if (i[0] == "_") {
if (skipUnderscore && i[0] == "_") {
continue

@@ -76,0 +77,0 @@ }

2

package.json
{
"name": "jskos-tools",
"version": "0.1.22",
"version": "0.1.23",
"description": "Tools for working with the JSKOS data format.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/gbv/jskos-tools",

@@ -148,6 +148,8 @@ # JSKOS Tools

#### copyDeep
Creates a deep copy of a JSKOS object, replacing possibly circular structures with open world `[null]` statements. Ignores all properties starting with `_`.
Creates a deep copy of a JSKOS object, replacing possibly circular structures with open world `[null]` statements. As the second argument it is possible to add additional properties that should be replaced with open world `[null]` statements. The third argument determines whether all properties starting with `_` should be ignored (`true` by default).
```js
jskos.copyDeep(object)
jskos.copyDeep(object, ["someCircularProperty"])
jskos.copyDeep(object, null, false)
```

@@ -154,0 +156,0 @@

@@ -44,2 +44,5 @@ const assert = require("assert")

assert.equal(copy._test, undefined)
// Test skipUnderscore
let copy2 = tools.copyDeep(object, ["self"], false)
assert.equal(copy2._test, object._test)
})

@@ -46,0 +49,0 @@

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