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

adam

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

adam - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

bower.json

@@ -7,3 +7,3 @@ {

],
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/gamtiq/adam",

@@ -10,0 +10,0 @@ "authors": [

@@ -5,3 +5,3 @@ {

"description": "Functions to create, process and test objects",
"version": "0.1.1",
"version": "0.1.2",
"keywords": [

@@ -8,0 +8,0 @@ "object",

@@ -34,2 +34,4 @@

/*jshint latedef:nofunc*/
/**

@@ -67,16 +69,28 @@ * Return class of given value (namely value of internal property `[[Class]]`).

/**
* Return number of fields of specified object.
* Return number of all or filtered fields of specified object.
*
* @param {Object} obj
* Object to be processed.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be counted (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Integer}
* Number of fields of specified object.
* Number of all or filtered fields of specified object.
* @alias module:adam.getSize
* @see {@link module:adam.checkField checkField}
*/
function getSize(obj) {
function getSize(obj, settings) {
/*jshint unused:false*/
var nSize = 0,
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
for (sKey in obj) {
nSize++;
if (bAll || checkField(obj, sKey, filter, settings)) {
nSize++;
}
}

@@ -87,3 +101,3 @@ return nSize;

/**
* Check whether number of fields of specified object is more than the given value.
* Check whether number of all or filtered fields of specified object is more than the given value.
*

@@ -94,15 +108,26 @@ * @param {Object} obj

* Value that should be used for comparison with number of fields.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be counted (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Boolean}
* `true`, when number of fields is more than the given value, otherwise `false`.
* `true`, when number of all or filtered fields is more than the given value, otherwise `false`.
* @alias module:adam.isSizeMore
* @see {@link module:adam.checkField checkField}
*/
function isSizeMore(obj, nValue) {
function isSizeMore(obj, nValue, settings) {
/*jshint unused:false*/
var nSize = 0,
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
if (nValue >= 0) {
for (sKey in obj) {
nSize++;
if (nSize > nValue) {
return true;
if (bAll || checkField(obj, sKey, filter, settings)) {
if (++nSize > nValue) {
return true;
}
}

@@ -121,5 +146,5 @@ }

* `true` if the value is an empty value, otherwise `false`.
* @alias module:adam.getType
* @see module:adam.getClass getClass
* @see module:adam.isSizeMore isSizeMore
* @alias module:adam.isEmpty
* @see {@link module:adam.getClass getClass}
* @see {@link module:adam.isSizeMore isSizeMore}
*/

@@ -143,4 +168,4 @@ function isEmpty(value) {

*
* * `empty` - check whether the value is empty (see {@link module:adam.isEmpty isEmpty}
* * `even` - check whether the value is a even integer
* * `empty` - check whether the value is empty (see {@link module:adam.isEmpty isEmpty})
* * `even` - check whether the value is an even integer
* * `false` - check whether the value is a false value

@@ -150,3 +175,3 @@ * * `infinity` - check whether the value is a number representing positive or negative infinity

* * `negative` - check whether the value is a negative number
* * `odd` - check whether the value is a odd integer
* * `odd` - check whether the value is an odd integer
* * `positive` - check whether the value is a positive number

@@ -162,4 +187,6 @@ * * `real` - check whether the value is a real number

* `true` if value has the specified kind (or does not have when the check is negated), otherwise `false`.
* @alias module:adam.getType
* @see module:adam.isEmpty isEmpty
* @alias module:adam.isKindOf
* @see {@link module:adam.getClass getClass}
* @see {@link module:adam.getType getType}
* @see {@link module:adam.isEmpty isEmpty}
*/

@@ -213,3 +240,3 @@ function isKindOf(value, sKind) {

* - any other value - is used as the check when calling {@link module:adam.isKindOf isKindOf};
* if the {@link module:adam.isKindOf isKindOf} returns `true` for the given field value and the filter
* if {@link module:adam.isKindOf isKindOf} returns `true` for the given field value and the filter
* it means that the field corresponds to this filter

@@ -233,12 +260,13 @@ * * an object;

* in `filter` parameter; valid values are the following: `and`, `or` (case-insensitive); any other value is treated as `and`
* * `value`: `Any` - a value that should be used for check instead of field's value
* @return {Boolean}
* `true` if the field corresponds to specified filter(s), otherwise `false`.
* @alias module:adam.getType
* @see module:adam.getClass getClass
* @see module:adam.isKindOf isKindOf
* @alias module:adam.checkField
* @see {@link module:adam.getClass getClass}
* @see {@link module:adam.isKindOf isKindOf}
*/
function checkField(obj, field, filter, settings) {
var value = obj[field],
test = true,
bAnd, nI, nL;
/*jshint laxbreak:true*/
var test = true,
bAnd, nI, nL, value;
field = String(field);

@@ -248,2 +276,5 @@ if (! settings) {

}
value = "value" in settings
? settings.value
: obj[field];
bAnd = settings.filterConnect;

@@ -308,15 +339,27 @@ bAnd = typeof bAnd !== "string" || bAnd.toLowerCase() !== "or";

/**
* Return list of fields of specified object.
* Return list of all or filtered fields of specified object.
*
* @param {Object} obj
* Object to be processed.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be selected (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Array}
* List of fields of specified object.
* List of all or filtered fields of specified object.
* @alias module:adam.getFields
* @see {@link module:adam.checkField checkField}
*/
function getFields(obj) {
function getFields(obj, settings) {
var result = [],
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
for (sKey in obj) {
result.push(sKey);
if (bAll || checkField(obj, sKey, filter, settings)) {
result.push(sKey);
}
}

@@ -361,15 +404,27 @@ return result;

/**
* Return list of field values of specified object.
* Return list of all or filtered field values of specified object.
*
* @param {Object} obj
* Object to be processed.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be selected (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Array}
* List of field values of specified object.
* List of all or filtered field values of specified object.
* @alias module:adam.getValues
* @see {@link module:adam.checkField checkField}
*/
function getValues(obj) {
function getValues(obj, settings) {
var result = [],
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
for (sKey in obj) {
result[result.length] = obj[sKey];
if (bAll || checkField(obj, sKey, filter, settings)) {
result[result.length] = obj[sKey];
}
}

@@ -445,2 +500,6 @@ return result;

* should be deleted from the source object (an item of the list)
* * `filter` - a filter specifying objects that should be included into result (see {@link module:adam.checkField checkField});
* an item of the list will be used as value for check
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Object}

@@ -453,3 +512,3 @@ * Object created from the given list.

result = {},
bDeleteKeyField, bFuncKey, item, field, nI, sKeyName;
bAll, bDeleteKeyField, bFuncKey, filter, filterConnect, item, field, nI, sKeyName;
if (nL) {

@@ -459,2 +518,5 @@ if (! settings) {

}
bAll = ! ("filter" in settings);
filter = bAll ? null : settings.filter;
filterConnect = settings.filterConnect;
bFuncKey = typeof keyField === "function";

@@ -476,6 +538,8 @@ bDeleteKeyField = Boolean(settings.deleteKeyField && keyField);

}
if (bDeleteKeyField) {
delete item[sKeyName];
if (bAll || checkField(result, field, filter, {value: item, filterConnect: filterConnect})) {
if (bDeleteKeyField) {
delete item[sKeyName];
}
result[field] = item;
}
result[field] = item;
}

@@ -491,5 +555,15 @@ }

* Object to be divided.
* @param {Array | Object} firstObjFields
* @param {Array | Object | null} firstObjFields
* List of names of fields that should be included in the first part,
* or an object defining those fields.
* If value is not specified (`null` or `undefined`), `filter` setting should be used to divide fields into parts.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter that should be used to divide fields into parts (see {@link module:adam.checkField checkField});
* fields conforming to the filter will be included in the first part,
* fields that do not conform to the filter will be included in the second part
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Array}

@@ -499,12 +573,25 @@ * Created parts: item with index 0 is the first part, item with index 1 is the second part.

*/
function split(obj, firstObjFields) {
function split(obj, firstObjFields, settings) {
/*jshint laxbreak:true*/
var first = {},
second = {},
result = [first, second],
sKey;
if (typeof firstObjFields.length === "number") {
firstObjFields = fromArray(firstObjFields);
bByName, filter, sKey;
if (! settings) {
settings = {};
}
if (firstObjFields) {
bByName = true;
if (typeof firstObjFields.length === "number") {
firstObjFields = fromArray(firstObjFields);
}
}
else {
bByName = false;
filter = settings.filter;
}
for (sKey in obj) {
(sKey in firstObjFields ? first : second)[sKey] = obj[sKey];
((bByName ? sKey in firstObjFields : checkField(obj, sKey, filter, settings))
? first
: second)[sKey] = obj[sKey];
}

@@ -516,16 +603,19 @@ return result;

exports.checkField = checkField;
exports.fromArray = fromArray;
exports.getClass = getClass;
exports.getFields = getFields;
exports.getFreeField = getFreeField;
exports.getSize = getSize;
exports.getType = getType;
exports.getValueKey = getValueKey;
exports.getValues = getValues;
exports.isEmpty = isEmpty;
exports.isKindOf = isKindOf;
exports.isSizeMore = isSizeMore;
exports.split = split;
module.exports = {
checkField: checkField,
fromArray: fromArray,
getClass: getClass,
getFields: getFields,
getFreeField: getFreeField,
getSize: getSize,
getType: getType,
getValueKey: getValueKey,
getValues: getValues,
isEmpty: isEmpty,
isKindOf: isKindOf,
isSizeMore: isSizeMore,
split: split
};
return module.exports;
}));

@@ -1,1 +0,1 @@

!function(a,b){if("object"==typeof exports)module.exports=b(require,exports,module);else if("function"==typeof define&&define.amd)define(["require","exports","module"],b);else{var c=function(b){return a[b]},d=a,e={exports:d};a.adam=b(c,d,e)}}(this,function(a,b,c){"use strict";function d(a){var b=Object.prototype.toString.call(a);return b.substring(8,b.length-1)}function e(a){var b=typeof a;return null===a?"null":"number"===b&&isNaN(a)?"nan":b}function f(a){var b,c=0;for(b in a)c++;return c}function g(a,b){var c,d=0;if(b>=0)for(c in a)if(d++,d>b)return!0;return d>b}function h(a){return null==a||""===a||"object"==typeof a&&!g(a,0)||"Array"===d(a)&&0===a.length}function i(a,b){var c,f,g,i="!"===b.charAt(0),j=e(a);return i&&(b=b.substring(1)),g=j===b||d(a)===b||"true"===b&&Boolean(a)||"false"===b&&!a||"empty"===b&&h(a)||"number"===j&&("zero"===b&&0===a||"positive"===b&&a>0||"negative"===b&&0>a||(c=a===Number.POSITIVE_INFINITY||a===Number.NEGATIVE_INFINITY)&&"infinity"===b||!c&&((f=a===Math.ceil(a))&&"integer"===b||f&&"even"===b&&a%2===0||f&&"odd"===b&&a%2!==0||!f&&"real"===b)),i?!g:g}function j(a,b,c,e){var f,g,h,k=a[b],l=!0;for(b=String(b),e||(e={}),f=e.filterConnect,f="string"!=typeof f||"or"!==f.toLowerCase(),"Array"!==d(c)&&(c=[c]),g=0,h=c.length;h>g;g++){switch(l=c[g],d(l)){case"Function":l=Boolean(l(k,b,a));break;case"String":l="own"===l?a.hasOwnProperty(b):"!own"===l?!a.hasOwnProperty(b):i(k,l);break;case"RegExp":l=l.test(k);break;case"Object":"and"in l?l=j(a,b,l.and,{filterConnect:"and"}):"or"in l?l=j(a,b,l.or,{filterConnect:"or"}):"field"in l?(l=l.field,l="RegExp"===d(l)?l.test(b):String(l)===b):l="value"in l?l.value===k:l===k;break;default:l=l===k}if(f&&!l||!f&&l)break}return l}function k(a){var b,c=[];for(b in a)c.push(b);return c}function l(a,b,c){var d,e=[];for(d in a)if(a[d]===b){if(!c)return d;e.push(d)}return e.length?e:null}function m(a){var b,c=[];for(b in a)c[c.length]=a[b];return c}function n(a,b){var c,d,e,f;if(b||(b={}),f=b.prefix,d=b.startNum,c=b.checkPrefix,"string"!=typeof f&&(f="f"),d||(d=0),c?(e=f,d--):e=f+d,a)for(;e in a;)e=f+ ++d;return e}function o(a,b,c){var d,e,f,g,h,i,j=a.length,k={};if(j)for(c||(c={}),e="function"==typeof b,d=Boolean(c.deleteKeyField&&b),e||(i=b),h=0;j>h;h++)f=a[h],e?g=i=b(f,k,h):(g=i?f[i]:f,"function"==typeof g&&(g=g.call(f))),d&&delete f[i],k[g]=f;return k}function p(a,b){var c,d={},e={},f=[d,e];"number"==typeof b.length&&(b=o(b));for(c in a)(c in b?d:e)[c]=a[c];return f}return b.checkField=j,b.fromArray=o,b.getClass=d,b.getFields=k,b.getFreeField=n,b.getSize=f,b.getType=e,b.getValueKey=l,b.getValues=m,b.isEmpty=h,b.isKindOf=i,b.isSizeMore=g,b.split=p,c.exports});
!function(a,b){if("object"==typeof exports)module.exports=b(require,exports,module);else if("function"==typeof define&&define.amd)define(["require","exports","module"],b);else{var c=function(b){return a[b]},d=a,e={exports:d};a.adam=b(c,d,e)}}(this,function(a,b,c){"use strict";function d(a){var b=Object.prototype.toString.call(a);return b.substring(8,b.length-1)}function e(a){var b=typeof a;return null===a?"null":"number"===b&&isNaN(a)?"nan":b}function f(a,b){var c,d=0,e=!(b&&"filter"in b),f=e?null:b.filter;for(c in a)(e||j(a,c,f,b))&&d++;return d}function g(a,b,c){var d,e=0,f=!(c&&"filter"in c),g=f?null:c.filter;if(b>=0)for(d in a)if((f||j(a,d,g,c))&&++e>b)return!0;return e>b}function h(a){return null==a||""===a||"object"==typeof a&&!g(a,0)||"Array"===d(a)&&0===a.length}function i(a,b){var c,f,g,i="!"===b.charAt(0),j=e(a);return i&&(b=b.substring(1)),g=j===b||d(a)===b||"true"===b&&Boolean(a)||"false"===b&&!a||"empty"===b&&h(a)||"number"===j&&("zero"===b&&0===a||"positive"===b&&a>0||"negative"===b&&0>a||(c=a===Number.POSITIVE_INFINITY||a===Number.NEGATIVE_INFINITY)&&"infinity"===b||!c&&((f=a===Math.ceil(a))&&"integer"===b||f&&"even"===b&&a%2===0||f&&"odd"===b&&a%2!==0||!f&&"real"===b)),i?!g:g}function j(a,b,c,e){var f,g,h,k,l=!0;b=String(b),e||(e={}),k="value"in e?e.value:a[b],f=e.filterConnect,f="string"!=typeof f||"or"!==f.toLowerCase(),"Array"!==d(c)&&(c=[c]);for(g=0,h=c.length;h>g;g++){switch(l=c[g],d(l)){case"Function":l=Boolean(l(k,b,a));break;case"String":l="own"===l?a.hasOwnProperty(b):"!own"===l?!a.hasOwnProperty(b):i(k,l);break;case"RegExp":l=l.test(k);break;case"Object":"and"in l?l=j(a,b,l.and,{filterConnect:"and"}):"or"in l?l=j(a,b,l.or,{filterConnect:"or"}):"field"in l?(l=l.field,l="RegExp"===d(l)?l.test(b):String(l)===b):l="value"in l?l.value===k:l===k;break;default:l=l===k}if(f&&!l||!f&&l)break}return l}function k(a,b){var c,d=[],e=!(b&&"filter"in b),f=e?null:b.filter;for(c in a)(e||j(a,c,f,b))&&d.push(c);return d}function l(a,b,c){var d,e=[];for(d in a)if(a[d]===b){if(!c)return d;e.push(d)}return e.length?e:null}function m(a,b){var c,d=[],e=!(b&&"filter"in b),f=e?null:b.filter;for(c in a)(e||j(a,c,f,b))&&(d[d.length]=a[c]);return d}function n(a,b){var c,d,e,f;if(b||(b={}),f=b.prefix,d=b.startNum,c=b.checkPrefix,"string"!=typeof f&&(f="f"),d||(d=0),c?(e=f,d--):e=f+d,a)for(;e in a;)e=f+ ++d;return e}function o(a,b,c){var d,e,f,g,h,i,k,l,m,n=a.length,o={};if(n){c||(c={}),d=!("filter"in c),g=d?null:c.filter,h=c.filterConnect,f="function"==typeof b,e=Boolean(c.deleteKeyField&&b),f||(m=b);for(l=0;n>l;l++)i=a[l],f?k=m=b(i,o,l):(k=m?i[m]:i,"function"==typeof k&&(k=k.call(i))),(d||j(o,k,g,{value:i,filterConnect:h}))&&(e&&delete i[m],o[k]=i)}return o}function p(a,b,c){var d,e,f,g={},h={},i=[g,h];c||(c={}),b?(d=!0,"number"==typeof b.length&&(b=o(b))):(d=!1,e=c.filter);for(f in a)((d?f in b:j(a,f,e,c))?g:h)[f]=a[f];return i}return c.exports={checkField:j,fromArray:o,getClass:d,getFields:k,getFreeField:n,getSize:f,getType:e,getValueKey:l,getValues:m,isEmpty:h,isKindOf:i,isSizeMore:g,split:p},c.exports});

@@ -0,3 +1,9 @@

### 0.1.2 / 2014-10-12
* add ability to use filter for `getSize`, `isSizeMore`, `getFields`, `getValues`, `fromArray`, `split`
* add `value` setting for `checkField`
* fix `exports` problem in browser
### 0.1.1 / 2014-09-21
* add `checkField`, `getClass`, `getType`, `isEmpty` and `isKindOf` methods
{
"name": "adam",
"description": "Functions to create, process and test objects",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/gamtiq/adam",

@@ -6,0 +6,0 @@ "author": {

@@ -76,23 +76,32 @@ # adam

```js
var obj = {a: 1, b: 2, c: 3};
var obj = {a: 1, b: 2, c: 3, d: 4, e: 5};
adam.getClass([8]); // Array
adam.getType(null); // null
adam.getClass([8]); // "Array"
adam.getType(null); // "null"
adam.isKindOf(17, "integer"); // true
adam.isKindOf(NaN, "!number"); // true
adam.checkField(obj, "c", ["positive", "odd"]); // true
adam.checkField(obj, "b", ["real", /^7/], {filterConnect: "or"}); // false
adam.getFreeField({a5: 5, a2: 2, a7: 7, a3: 3}, {prefix: "a", startNum: 2}); // a4
adam.getFreeField({a5: 5, a2: 2, a7: 7, a3: 3}, {prefix: "a", startNum: 2}); // "a4"
adam.getSize(obj); // 3
adam.getSize(obj); // 5
adam.getSize(obj, {filter: "even"}); // 2
adam.isSizeMore(obj, 5); // false
adam.isEmpty({}); // true
adam.getFields(obj); // ["a", "b", "c"]
adam.getValues(obj); // [1, 2, 3]
adam.getValueKey({a: 1, b: 2, c: 3, d: 4}, 3); // c
adam.getFields(obj); // ["a", "b", "c", "d", "e"]
adam.getFields(obj, {filter: function(value) {return value > 3;}}); // ["d", "e"]
adam.getFields(adam, {filter: {field: /^is/}}); // ["isEmpty", "isKindOf", "isSizeMore"]
adam.getValues(obj); // [1, 2, 3, 4, 5]
adam.getValues(obj, {filter: {field: /a|c/}}); // [1, 3]
adam.getValueKey(obj, 3); // "c"
adam.fromArray([{id: "a", value: 11}, {id: "b", value: 7}, {id: "c", value: 10}], "id"); // {a: {id: "a", value: 11}, b: {id: "b", value: 7}, c: {id: "c", value: 10}}
adam.split({a: 1, b: 2, c: 3, d: 4, e: 5}, ["a", "d"]); // [{a: 1, d: 4}, {b: 2, c: 3, e: 5}]
adam.split(obj, ["a", "d"]); // [{a: 1, d: 4}, {b: 2, c: 3, e: 5}]
adam.split(obj, null, {filter: "odd"}); // [{a: 1, c: 3, e: 5}, {b: 2, d: 4}]
adam.split(obj, null, {filter: ["even", /3/], filterConnect: "or"}); // [{b: 2, c: 3, d: 4}, {a: 1, e: 5}]
```

@@ -116,5 +125,5 @@

### getFields(obj: Object): Array
### getFields(obj: Object, [settings: Object]): Array
Return list of fields of specified object.
Return list of all or filtered fields of specified object.

@@ -125,5 +134,5 @@ ### getFreeField(obj: Object, [settings: Object]): String

### getSize(obj: Object): Integer
### getSize(obj: Object, [settings: Object]): Integer
Return number of fields of specified object.
Return number of all or filtered fields of specified object.

@@ -138,5 +147,5 @@ ### getType(value: Any): String

### getValues(obj: Object): Array
### getValues(obj: Object, [settings: Object]): Array
Return list of field values of specified object.
Return list of all or filtered field values of specified object.

@@ -151,7 +160,7 @@ ### isEmpty(value: Any): Boolean

### isSizeMore(obj: Object, qty: Number): Boolean
### isSizeMore(obj: Object, qty: Number, [settings: Object]): Boolean
Check whether number of fields of specified object is more than the given value.
Check whether number of all or filtered fields of specified object is more than the given value.
### split(obj: Object, firstObjFields: Array | Object): Array
### split(obj: Object, firstObjFields: Array | Object | null, [settings: Object]): Array

@@ -165,2 +174,3 @@ Divide given object into 2 parts: the first part includes specified fields, the second part includes all other fields.

* [eva](https://github.com/gamtiq/eva)
* [mixing](https://github.com/gamtiq/mixing)
* [teo](https://github.com/gamtiq/teo)

@@ -167,0 +177,0 @@

@@ -19,2 +19,4 @@ /*

/*jshint latedef:nofunc*/
/**

@@ -52,16 +54,28 @@ * Return class of given value (namely value of internal property `[[Class]]`).

/**
* Return number of fields of specified object.
* Return number of all or filtered fields of specified object.
*
* @param {Object} obj
* Object to be processed.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be counted (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Integer}
* Number of fields of specified object.
* Number of all or filtered fields of specified object.
* @alias module:adam.getSize
* @see {@link module:adam.checkField checkField}
*/
function getSize(obj) {
function getSize(obj, settings) {
/*jshint unused:false*/
var nSize = 0,
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
for (sKey in obj) {
nSize++;
if (bAll || checkField(obj, sKey, filter, settings)) {
nSize++;
}
}

@@ -72,3 +86,3 @@ return nSize;

/**
* Check whether number of fields of specified object is more than the given value.
* Check whether number of all or filtered fields of specified object is more than the given value.
*

@@ -79,15 +93,26 @@ * @param {Object} obj

* Value that should be used for comparison with number of fields.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be counted (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Boolean}
* `true`, when number of fields is more than the given value, otherwise `false`.
* `true`, when number of all or filtered fields is more than the given value, otherwise `false`.
* @alias module:adam.isSizeMore
* @see {@link module:adam.checkField checkField}
*/
function isSizeMore(obj, nValue) {
function isSizeMore(obj, nValue, settings) {
/*jshint unused:false*/
var nSize = 0,
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
if (nValue >= 0) {
for (sKey in obj) {
nSize++;
if (nSize > nValue) {
return true;
if (bAll || checkField(obj, sKey, filter, settings)) {
if (++nSize > nValue) {
return true;
}
}

@@ -215,2 +240,3 @@ }

* in `filter` parameter; valid values are the following: `and`, `or` (case-insensitive); any other value is treated as `and`
* * `value`: `Any` - a value that should be used for check instead of field's value
* @return {Boolean}

@@ -223,5 +249,5 @@ * `true` if the field corresponds to specified filter(s), otherwise `false`.

function checkField(obj, field, filter, settings) {
var value = obj[field],
test = true,
bAnd, nI, nL;
/*jshint laxbreak:true*/
var test = true,
bAnd, nI, nL, value;
field = String(field);

@@ -231,2 +257,5 @@ if (! settings) {

}
value = "value" in settings
? settings.value
: obj[field];
bAnd = settings.filterConnect;

@@ -291,15 +320,27 @@ bAnd = typeof bAnd !== "string" || bAnd.toLowerCase() !== "or";

/**
* Return list of fields of specified object.
* Return list of all or filtered fields of specified object.
*
* @param {Object} obj
* Object to be processed.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be selected (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Array}
* List of fields of specified object.
* List of all or filtered fields of specified object.
* @alias module:adam.getFields
* @see {@link module:adam.checkField checkField}
*/
function getFields(obj) {
function getFields(obj, settings) {
var result = [],
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
for (sKey in obj) {
result.push(sKey);
if (bAll || checkField(obj, sKey, filter, settings)) {
result.push(sKey);
}
}

@@ -344,15 +385,27 @@ return result;

/**
* Return list of field values of specified object.
* Return list of all or filtered field values of specified object.
*
* @param {Object} obj
* Object to be processed.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter specifying fields that should be selected (see {@link module:adam.checkField checkField})
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Array}
* List of field values of specified object.
* List of all or filtered field values of specified object.
* @alias module:adam.getValues
* @see {@link module:adam.checkField checkField}
*/
function getValues(obj) {
function getValues(obj, settings) {
var result = [],
bAll = ! settings || ! ("filter" in settings),
filter = bAll ? null : settings.filter,
sKey;
for (sKey in obj) {
result[result.length] = obj[sKey];
if (bAll || checkField(obj, sKey, filter, settings)) {
result[result.length] = obj[sKey];
}
}

@@ -428,5 +481,10 @@ return result;

* should be deleted from the source object (an item of the list)
* * `filter` - a filter specifying objects that should be included into result (see {@link module:adam.checkField checkField});
* an item of the list will be used as value for check
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Object}
* Object created from the given list.
* @alias module:adam.fromArray
* @see {@link module:adam.checkField checkField}
*/

@@ -436,3 +494,3 @@ function fromArray(list, keyField, settings) {

result = {},
bDeleteKeyField, bFuncKey, item, field, nI, sKeyName;
bAll, bDeleteKeyField, bFuncKey, filter, filterConnect, item, field, nI, sKeyName;
if (nL) {

@@ -442,2 +500,5 @@ if (! settings) {

}
bAll = ! ("filter" in settings);
filter = bAll ? null : settings.filter;
filterConnect = settings.filterConnect;
bFuncKey = typeof keyField === "function";

@@ -459,6 +520,8 @@ bDeleteKeyField = Boolean(settings.deleteKeyField && keyField);

}
if (bDeleteKeyField) {
delete item[sKeyName];
if (bAll || checkField(result, field, filter, {value: item, filterConnect: filterConnect})) {
if (bDeleteKeyField) {
delete item[sKeyName];
}
result[field] = item;
}
result[field] = item;
}

@@ -474,19 +537,43 @@ }

* Object to be divided.
* @param {Array | Object} firstObjFields
* @param {Array | Object | null} firstObjFields
* List of names of fields that should be included in the first part,
* or an object defining those fields.
* If value is not specified (`null` or `undefined`), `filter` setting should be used to divide fields into parts.
* @param {Object} [settings]
* Operation settings. Keys are settings names, values are corresponding settings values.
* The following settings are supported:
*
* * `filter` - a filter that should be used to divide fields into parts (see {@link module:adam.checkField checkField});
* fields conforming to the filter will be included in the first part,
* fields that do not conform to the filter will be included in the second part
* * `filterConnect`: `String` - a boolean connector that should be used when array of filters is specified
* in `filter` setting (see {@link module:adam.checkField checkField})
* @return {Array}
* Created parts: item with index 0 is the first part, item with index 1 is the second part.
* @alias module:adam.split
* @see {@link module:adam.checkField checkField}
*/
function split(obj, firstObjFields) {
function split(obj, firstObjFields, settings) {
/*jshint laxbreak:true*/
var first = {},
second = {},
result = [first, second],
sKey;
if (typeof firstObjFields.length === "number") {
firstObjFields = fromArray(firstObjFields);
bByName, filter, sKey;
if (! settings) {
settings = {};
}
if (firstObjFields) {
bByName = true;
if (typeof firstObjFields.length === "number") {
firstObjFields = fromArray(firstObjFields);
}
}
else {
bByName = false;
filter = settings.filter;
}
for (sKey in obj) {
(sKey in firstObjFields ? first : second)[sKey] = obj[sKey];
((bByName ? sKey in firstObjFields : checkField(obj, sKey, filter, settings))
? first
: second)[sKey] = obj[sKey];
}

@@ -498,14 +585,16 @@ return result;

exports.checkField = checkField;
exports.fromArray = fromArray;
exports.getClass = getClass;
exports.getFields = getFields;
exports.getFreeField = getFreeField;
exports.getSize = getSize;
exports.getType = getType;
exports.getValueKey = getValueKey;
exports.getValues = getValues;
exports.isEmpty = isEmpty;
exports.isKindOf = isKindOf;
exports.isSizeMore = isSizeMore;
exports.split = split;
module.exports = {
checkField: checkField,
fromArray: fromArray,
getClass: getClass,
getFields: getFields,
getFreeField: getFreeField,
getSize: getSize,
getType: getType,
getValueKey: getValueKey,
getValues: getValues,
isEmpty: isEmpty,
isKindOf: isKindOf,
isSizeMore: isSizeMore,
split: split
};

@@ -44,3 +44,15 @@ "use strict";

function checkArray(func, paramList, expectedResult) {
var result = func.apply(null, paramList),
nL = expectedResult.length,
nI;
expect( result )
.length(nL);
for (nI = 0; nI < nL; nI++) {
expect( result )
.include(expectedResult[nI]);
}
}
describe(".getClass(value)", function() {

@@ -143,90 +155,124 @@ var getClass = adam.getClass;

describe(".getSize(obj)", function() {
describe(".getSize", function() {
var getSize = adam.getSize;
it("should return quantity of all fields of object (including prototype chain)", function() {
var parent = {a: 1, b: 2, c: 3, d: 4},
F = function() {},
child;
F.prototype = parent;
child = new F();
child.b = "b";
child.d = "d";
child.e = 5;
child.f = "f";
expect( getSize({}) )
.equal(0);
/*jshint ignore:start*/
expect( getSize(new Object()) )
.equal(0);
expect( getSize(new Boolean(true)) )
.equal(0);
expect( getSize(new Date()) )
.equal(0);
expect( getSize(new Number(57)) )
.equal(0);
/*jshint ignore:end*/
expect( getSize(grandchild) )
.equal(7);
expect( getSize(parent) )
.equal(4);
expect( getSize(child) )
.equal(6);
parent.f = 6;
expect( getSize(parent) )
.equal(5);
expect( getSize(child) )
.equal(6);
delete parent.a;
delete parent.c;
expect( getSize(parent) )
.equal(3);
expect( getSize(child) )
.equal(4);
describe("getSize(obj)", function() {
it("should return quantity of all fields of object (including prototype chain)", function() {
var parent = {a: 1, b: 2, c: 3, d: 4},
F = function() {},
child;
F.prototype = parent;
child = new F();
child.b = "b";
child.d = "d";
child.e = 5;
child.f = "f";
expect( getSize({}) )
.equal(0);
/*jshint ignore:start*/
expect( getSize(new Object()) )
.equal(0);
expect( getSize(new Boolean(true)) )
.equal(0);
expect( getSize(new Date()) )
.equal(0);
expect( getSize(new Number(57)) )
.equal(0);
/*jshint ignore:end*/
expect( getSize(grandchild) )
.equal(7);
expect( getSize(parent) )
.equal(4);
expect( getSize(child) )
.equal(6);
parent.f = 6;
expect( getSize(parent) )
.equal(5);
expect( getSize(child) )
.equal(6);
delete parent.a;
delete parent.c;
expect( getSize(parent) )
.equal(3);
expect( getSize(child) )
.equal(4);
});
});
describe("getSize(obj, settings)", function() {
it("should return quantity of fields corresponding to given filter", function() {
expect( getSize(child, {filter: "integer"}) )
.equal(4);
expect( getSize(child, {filter: "string"}) )
.equal(1);
expect( getSize(child, {filter: ["odd", "string"], filterConnect: "or"}) )
.equal(3);
});
});
});
describe(".isSizeMore(obj, nQty)", function() {
describe(".isSizeMore", function() {
var isSizeMore = adam.isSizeMore;
it("should return true (obj has more fields than nQty)", function() {
/*jshint expr:true*/
expect( isSizeMore({}, -1) )
.be["true"];
expect( isSizeMore(Klass, 0) )
.be["true"];
expect( isSizeMore(parent, 0) )
.be["true"];
expect( isSizeMore(parent, 1) )
.be["true"];
expect( isSizeMore(parent, 2) )
.be["true"];
expect( isSizeMore(child, 0) )
.be["true"];
expect( isSizeMore(child, 3) )
.be["true"];
expect( isSizeMore(child, 4) )
.be["true"];
expect( isSizeMore(grandchild, 6) )
.be["true"];
describe("isSizeMore(obj, nQty)", function() {
it("should return true (obj has more fields than nQty)", function() {
/*jshint expr:true*/
expect( isSizeMore({}, -1) )
.be["true"];
expect( isSizeMore(Klass, 0) )
.be["true"];
expect( isSizeMore(parent, 0) )
.be["true"];
expect( isSizeMore(parent, 1) )
.be["true"];
expect( isSizeMore(parent, 2) )
.be["true"];
expect( isSizeMore(child, 0) )
.be["true"];
expect( isSizeMore(child, 3) )
.be["true"];
expect( isSizeMore(child, 4) )
.be["true"];
expect( isSizeMore(grandchild, 6) )
.be["true"];
});
it("should return false (obj has less fields than nQty)", function() {
/*jshint expr:true*/
expect( isSizeMore({}, 0) )
.be["false"];
expect( isSizeMore(parent, 3) )
.be["false"];
expect( isSizeMore(parent, 4) )
.be["false"];
expect( isSizeMore(parent, 1000) )
.be["false"];
expect( isSizeMore(child, 5) )
.be["false"];
expect( isSizeMore(child, 50000) )
.be["false"];
expect( isSizeMore(grandchild, 7) )
.be["false"];
});
});
it("should return false (obj has less fields than nQty)", function() {
/*jshint expr:true*/
expect( isSizeMore({}, 0) )
.be["false"];
expect( isSizeMore(parent, 3) )
.be["false"];
expect( isSizeMore(parent, 4) )
.be["false"];
expect( isSizeMore(parent, 1000) )
.be["false"];
expect( isSizeMore(child, 5) )
.be["false"];
expect( isSizeMore(child, 50000) )
.be["false"];
expect( isSizeMore(grandchild, 7) )
.be["false"];
describe("isSizeMore(obj, nQty, settings)", function() {
it("should return true (obj has more filtered fields than nQty)", function() {
/*jshint expr:true*/
expect( isSizeMore(grandchild, 3, {filter: "string"}) )
.be["true"];
expect( isSizeMore(child, 2, {filter: ["odd", "string"], filterConnect: "or"}) )
.be["true"];
});
it("should return false (obj has less filtered fields than nQty)", function() {
/*jshint expr:true*/
expect( isSizeMore(child, 4, {filter: "integer"}) )
.be["false"];
expect( isSizeMore(child, 3, {filter: ["even", "null"], filterConnect: "or"}) )
.be["false"];
});
});

@@ -578,48 +624,78 @@ });

});
describe("checkField(obj, field, filter, {value: ...})", function() {
var obj = {a: "value", b: [], c: null},
settings = {value: obj};
it("should return true", function() {
checkTrue(obj, "a", "object", settings);
checkTrue(obj, "b", "!empty", settings);
checkTrue(obj, "c", "!null", settings);
});
it("should return false", function() {
checkFalse(obj, "a", ["string", "!empty"], settings);
checkFalse(obj, "b", "Array", settings);
checkFalse(obj, "c", /null/, settings);
});
});
});
describe(".getFields(obj)", function() {
describe(".getFields", function() {
var getFields = adam.getFields;
it("should return array of all fields of object (including prototype chain)", function() {
expect( getFields({}) )
.eql([]);
expect( getFields({}) )
.length(0);
expect( getFields({fld: function() {}}) )
.eql(["fld"]);
/*jshint ignore:start*/
expect( getFields(new Boolean(false)) )
.eql([]);
expect( getFields(new Date()) )
.eql([]);
expect( getFields(new Number(784)) )
.eql([]);
/*jshint ignore:end*/
expect( getFields(parent) )
.include("a")
.and.include("b")
.and.include("c");
expect( getFields(parent) )
.length(3);
expect( getFields(child) )
.include("a")
.and.include("b")
.and.include("c")
.and.include("d")
.and.include("e");
expect( getFields(child) )
.length(5);
expect( getFields(grandchild) )
.include("a")
.and.include("b")
.and.include("c")
.and.include("d")
.and.include("e")
.and.include("f")
.and.include("g");
expect( getFields(grandchild) )
.length(7);
describe("getFields(obj)", function() {
it("should return array of all fields of object (including prototype chain)", function() {
expect( getFields({}) )
.eql([]);
expect( getFields({}) )
.length(0);
expect( getFields({fld: function() {}}) )
.eql(["fld"]);
/*jshint ignore:start*/
expect( getFields(new Boolean(false)) )
.eql([]);
expect( getFields(new Date()) )
.eql([]);
expect( getFields(new Number(784)) )
.eql([]);
/*jshint ignore:end*/
expect( getFields(parent) )
.include("a")
.and.include("b")
.and.include("c");
expect( getFields(parent) )
.length(3);
expect( getFields(child) )
.include("a")
.and.include("b")
.and.include("c")
.and.include("d")
.and.include("e");
expect( getFields(child) )
.length(5);
expect( getFields(grandchild) )
.include("a")
.and.include("b")
.and.include("c")
.and.include("d")
.and.include("e")
.and.include("f")
.and.include("g");
expect( getFields(grandchild) )
.length(7);
});
});
describe("getFields(obj, settings)", function() {
it("should return array of object's fields conforming to the given filter", function() {
checkArray(getFields,
[child, {filter: "odd"}],
["a", "e"]);
checkArray(getFields,
[child, {filter: ["even", "string"], filterConnect: "or"}],
["b", "c", "d"]);
});
});
});

@@ -775,46 +851,60 @@

describe(".getValues(obj)", function() {
var getValues = adam.getValues,
d = new Date();
describe(".getValues", function() {
var getValues = adam.getValues;
it("should return array of all field values of object (including prototype chain)", function() {
expect( getValues({}) )
.eql([]);
expect( getValues({}) )
.length(0);
expect( getValues({field: d}) )
.eql([d]);
/*jshint ignore:start*/
expect( getValues(new Boolean(true)) )
.eql([]);
expect( getValues(new Date()) )
.eql([]);
expect( getValues(new Number(234345)) )
.eql([]);
/*jshint ignore:end*/
expect( getValues(parent) )
.include(1)
.and.include(2)
.and.include(3);
expect( getValues(parent) )
.length(3);
expect( getValues(child) )
.include("abc")
.and.include(1)
.and.include(2)
.and.include(4)
.and.include(5);
expect( getValues(child) )
.length(5);
expect( getValues(grandchild) )
.include("a")
.and.include(2)
.and.include("C++")
.and.include(4)
.and.include(5)
.and.include("field")
.and.include("gnome");
expect( getValues(grandchild) )
.length(7);
describe("getValues(obj)", function() {
it("should return array of all field values of object (including prototype chain)", function() {
var d = new Date();
expect( getValues({}) )
.eql([]);
expect( getValues({}) )
.length(0);
expect( getValues({field: d}) )
.eql([d]);
/*jshint ignore:start*/
expect( getValues(new Boolean(true)) )
.eql([]);
expect( getValues(new Date()) )
.eql([]);
expect( getValues(new Number(234345)) )
.eql([]);
/*jshint ignore:end*/
expect( getValues(parent) )
.include(1)
.and.include(2)
.and.include(3);
expect( getValues(parent) )
.length(3);
expect( getValues(child) )
.include("abc")
.and.include(1)
.and.include(2)
.and.include(4)
.and.include(5);
expect( getValues(child) )
.length(5);
expect( getValues(grandchild) )
.include("a")
.and.include(2)
.and.include("C++")
.and.include(4)
.and.include(5)
.and.include("field")
.and.include("gnome");
expect( getValues(grandchild) )
.length(7);
});
});
describe("getValues(obj, settings)", function() {
it("should return array of object's field values conforming to the given filter", function() {
checkArray(getValues,
[child, {filter: {field: /b|e/}}],
[2, 5]);
checkArray(getValues,
[grandchild, {filter: {or: ["!string", /\W/]}}],
[2, 4, 5, "C++"]);
});
});
});

@@ -995,3 +1085,3 @@

describe(".split(obj, firstObjFields)", function() {
describe(".split", function() {
var split = adam.split,

@@ -1002,18 +1092,32 @@ date = new Date(),

obj = {a: 1, b: 2, first: "first", second: "second", delta: 123, d: date, time: nTime, func: method};
it("should return array from 2 correct objects", function() {
expect( split({}, {}) )
.eql([{}, {}]);
expect( split({}, {one: 1, two: 2, three: 3}) )
.eql([{}, {}]);
expect( split({abc: date}, ["one", "two", "three"]) )
.eql([{}, {abc: date}]);
expect( split(obj, ["one", "two", "three"]) )
.eql([{}, obj]);
expect( split(obj, {first: null, second: null}) )
.eql([{first: "first", second: "second"},
{a: 1, b: 2, delta: 123, d: date, time: nTime, func: method}]);
expect( split(obj, ["a", "delta", "time", "second"]) )
.eql([{a: 1, second: "second", delta: 123, time: nTime},
{b: 2, first: "first", d: date, func: method}]);
describe("split(obj, firstObjFields)", function() {
it("should return array from 2 correct objects", function() {
expect( split({}, {}) )
.eql([{}, {}]);
expect( split({}, {one: 1, two: 2, three: 3}) )
.eql([{}, {}]);
expect( split({abc: date}, ["one", "two", "three"]) )
.eql([{}, {abc: date}]);
expect( split(obj, ["one", "two", "three"]) )
.eql([{}, obj]);
expect( split(obj, {first: null, second: null}) )
.eql([{first: "first", second: "second"},
{a: 1, b: 2, delta: 123, d: date, time: nTime, func: method}]);
expect( split(obj, ["a", "delta", "time", "second"]) )
.eql([{a: 1, second: "second", delta: 123, time: nTime},
{b: 2, first: "first", d: date, func: method}]);
});
});
describe("split(obj, null, {filter: ...})", function() {
it("should return array from 2 correct objects", function() {
expect( split(obj, null, {filter: "integer"}) )
.eql([{a: 1, b: 2, delta: 123, time: nTime},
{first: "first", second: "second", d: date, func: method}]);
expect( split(obj, null, {filter: ["string", "Date"], filterConnect: "or"}) )
.eql([{first: "first", second: "second", d: date},
{a: 1, b: 2, delta: 123, time: nTime, func: method}]);
});
});
});

@@ -1067,2 +1171,17 @@

function getCategoryListCopy() {
var result = categoryList.slice(0),
nL = result.length,
copy, item, nI, sKey;
for (nI = 0; nI < nL; nI++) {
item = result[nI];
copy = {};
for (sKey in item) {
copy[sKey] = item[sKey];
}
result[nI] = copy;
}
return result;
}
function test(list, bCallFunc, sField) {

@@ -1174,3 +1293,3 @@ /*jshint laxbreak:true*/

}
obj = fromArray(categoryList, "id", {deleteKeyField: true});
obj = fromArray(getCategoryListCopy, "id", {deleteKeyField: true});
for (sKey in obj) {

@@ -1210,3 +1329,39 @@ expect(keys)

});
describe("fromArray(list, keyField, {filter: ..., filterConnect: ...})", function() {
it("should return object including values conforming to the given filter", function() {
function test(list, keyField, settings, expectedResult) {
var result = fromArray(list, keyField, settings),
nSize = 0,
sKey;
for (sKey in result) {
expect( expectedResult )
.contain.key(sKey);
expect( result[sKey] )
.equal(expectedResult[sKey]);
nSize++;
}
expect( adam.getSize(expectedResult) )
.equal(nSize);
}
test(categoryList, "id",
{filter: function(item) {
return item.quantity < 10;
}},
{
1: categoryList[1],
3: categoryList[3],
7: categoryList[7]
});
test(categoryList, "name", {filter: {field: /^(?:C|D)/}},
{
"Drama": categoryList[1],
"Comedy": categoryList[3],
"Cartoon": categoryList[4]
});
});
});
});
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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