@ctx-core/set
Advanced tools
Comparing version 3.0.2 to 4.0.0
54
lib.js
@@ -1,2 +0,52 @@ | ||
require = require('esm')(module) | ||
module.exports = require('./lib.mjs') | ||
/** | ||
* @module @ctx-core/set/lib.js | ||
*/ | ||
/** | ||
* Returns a `set` with the _union of the members | ||
* @param [...array] members | ||
* @returns {Set} The _union of the members | ||
* @see {@link http://www.2ality.com/2015/01/es6-set-operations.html} | ||
*/ | ||
export function _union(...ARR__members) { | ||
let members = [] | ||
for (let i = 0; i < ARR__members.length; i++) { | ||
const members__ = ARR__members[i] | ||
members.push(...members__) | ||
} | ||
return new Set(members) | ||
} | ||
export const _union__set = _union | ||
/** | ||
* Returns a `set` with the _intersection of the members | ||
* @param [...*] member | ||
* @returns {Set} The _intersection of the members | ||
* @see {@link http://www.2ality.com/2015/01/es6-set-operations.html} | ||
*/ | ||
export function _intersection(root_set, ...rest) { | ||
const set__rest = _union(...rest) | ||
const ARR__filter = [...root_set] | ||
let members = [] | ||
for (let i = 0; i < ARR__filter.length; i++) { | ||
const x = ARR__filter[i] | ||
if (set__rest.has(x)) members.push(x) | ||
} | ||
return new Set(members) | ||
} | ||
export const _intersection__set = _intersection | ||
/** | ||
* Returns a new set with a _difference of the array-like arguments. | ||
* @param [...array] array - An array-like to perform the _difference operation on. | ||
* @returns {Set} The _difference of the array-like arguments. | ||
* @see {@link http://www.2ality.com/2015/01/es6-set-operations.html} | ||
*/ | ||
export function _difference(root_set, ...rest) { | ||
const set__rest = _union(...rest) | ||
const ARR__filter = [...root_set] | ||
let members = [] | ||
for (let i = 0; i < ARR__filter.length; i++) { | ||
const x = ARR__filter[i] | ||
if (!set__rest.has(x)) members.push(x) | ||
} | ||
return new Set(members) | ||
} | ||
export const _difference__set = _difference |
{ | ||
"name": "@ctx-core/set", | ||
"version": "3.0.2", | ||
"version": "4.0.0", | ||
"description": "ctx-core set", | ||
@@ -23,6 +23,3 @@ "main": "lib.js", | ||
"homepage": "https://github.com/ctx-core/ctx-core#readme", | ||
"dependencies": { | ||
"esm": "^3.0.84" | ||
}, | ||
"gitHead": "edc7fb28a958f01f067ddc1dd18944cd613112d2" | ||
"gitHead": "7d0d73495e67101da1ad8aeb87a7b9918b4689c1" | ||
} |
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
0
2214
2
51
- Removedesm@^3.0.84
- Removedesm@3.2.25(transitive)