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

vest-utils

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vest-utils - npm Package Compare versions

Comparing version 0.0.4-dev-afe5de to 0.0.4-dev-c786f7

src/__tests__/deferThrow.test.ts

8

dist/cjs/vest-utils.development.js

@@ -220,9 +220,2 @@ 'use strict';

function partition(array, predicate) {
return array.reduce(function (partitions, value, number) {
partitions[predicate(value, number, array) ? 0 : 1].push(value);
return partitions;
}, [[], []]);
}
function either(a, b) {

@@ -351,2 +344,1 @@ return !!a !== !!b;

exports.optionalFunctionValue = optionalFunctionValue;
exports.partition = partition;

2

dist/cjs/vest-utils.production.js

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

"use strict";function t(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return!t.apply(void 0,r)}}function r(t){var r=Number(t);return!(isNaN(parseFloat(String(t)))||isNaN(Number(t))||!isFinite(r))}Object.defineProperty(exports,"__esModule",{value:!0});var n=t(r);function e(t,n){return r(t)&&r(n)&&Number(t)===Number(n)}var o=t(e);function u(t,r){return e(t.length,r)}var i=t(u);function s(t,n){return r(t)&&r(n)&&Number(t)>Number(n)}function c(t,r){return s(t.length,r)}function a(t){return null===t}var f=t(a);function p(t){return void 0===t}var l=t(p);function x(t){return a(t)||p(t)}var v=t(x);function h(t){return[].concat(t)}function g(t){return"function"==typeof t}function N(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return g(t)?t.apply(void 0,r):t}function d(t,r){var n;return null!==(n=N(t))&&void 0!==n?n:N(r)}function b(t){return!!Array.isArray(t)}var y=t(b);function m(t){return(t=h(t))[t.length-1]}function E(t,r){var n=0;for(r=r.slice(0,-1);n<r.length;n++){var e=r[n];t[e]=d(t[e],[]),t=t[e]}return t}var O=Object.freeze({__proto__:null,transform:function t(r,n){for(var e=[],o=0;o<r.length;o++){var u=r[o];b(u)?e.push(t(u,n)):(u=n(u),f(u)&&e.push(u))}return e},valueAtPath:function(t,r){return E(t,r)[m(r)]},setValueAtPath:function(t,r,n){return E(t,r)[m(r)]=n,t},flatten:function t(r){return h(r).reduce((function(r,n){return b(n)?r.concat(t(n)):h(r).concat(n)}),[])},getCurrent:E});function _(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var j=Object.assign;var A,P=Object.freeze({__proto__:null,createBus:function(){var t={};return{emit:function(r,n){(t[r]||[]).forEach((function(t){t(n)}))},on:function(r,n){return t[r]=(t[r]||[]).concat(n),{off:function(){t[r]=(t[r]||[]).filter((function(t){return t!==n}))}}}}}}),w=(A=0,function(){return"".concat(A++)});function S(t){return!t||(_(t,"length")?u(t,0):"object"==typeof t&&u(Object.keys(t),0))}var F=t(S);exports.StringObject=function(t){return new String(N(t))},exports.asArray=h,exports.assign=j,exports.bindNot=t,exports.bus=P,exports.cache=function(t){function r(t){return n.findIndex((function(r){var n=r[0];return u(t,n.length)&&t.every((function(t,r){return t===n[r]}))}))}void 0===t&&(t=1);var n=[],e=function(r,o){var u=e.get(r);return u?u[1]:(o=o(),n.unshift([r.concat(),o]),c(n,t)&&(n.length=t),o)};return e.invalidate=function(t){-1<(t=r(t))&&n.splice(t,1)},e.get=function(t){return n[r(t)]||null},e},exports.callEach=function(t){return t.forEach((function(t){return t()}))},exports.defaultTo=d,exports.deferThrow=function(t){setTimeout((function(){throw Error(t)}),0)},exports.either=function(t,r){return!!t!=!!r},exports.genId=w,exports.greaterThan=s,exports.hasOwnProperty=_,exports.invariant=function(t,r){if(!t)throw r instanceof String?r.valueOf():Error(r?N(r):r)},exports.isArray=b,exports.isBoolean=function(t){return!!t===t},exports.isEmpty=S,exports.isFunction=g,exports.isNotArray=y,exports.isNotEmpty=F,exports.isNotNull=f,exports.isNotNullish=v,exports.isNotNumeric=n,exports.isNotUndefined=l,exports.isNull=a,exports.isNullish=x,exports.isNumeric=r,exports.isPositive=function(t){return s(t,0)},exports.isPromise=function(t){return t&&g(t.then)},exports.isStringValue=function(t){return String(t)===t},exports.isUndefined=p,exports.last=m,exports.lengthEquals=u,exports.lengthNotEquals=i,exports.longerThan=c,exports.mapFirst=function(t,r){function n(t,r){t&&(e=!0,o=r)}for(var e=!1,o=null,u=0;u<t.length;u++)if(r(t[u],n,u),e)return o},exports.nestedArray=O,exports.numberEquals=e,exports.numberNotEquals=o,exports.optionalFunctionValue=N,exports.partition=function(t,r){return t.reduce((function(n,e,o){return n[r(e,o,t)?0:1].push(e),n}),[[],[]])};
"use strict";function t(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return!t.apply(void 0,r)}}function r(t){var r=Number(t);return!(isNaN(parseFloat(String(t)))||isNaN(Number(t))||!isFinite(r))}Object.defineProperty(exports,"__esModule",{value:!0});var n=t(r);function e(t,n){return r(t)&&r(n)&&Number(t)===Number(n)}var o=t(e);function u(t,r){return e(t.length,r)}var i=t(u);function s(t,n){return r(t)&&r(n)&&Number(t)>Number(n)}function c(t,r){return s(t.length,r)}function a(t){return null===t}var f=t(a);function p(t){return void 0===t}var l=t(p);function x(t){return a(t)||p(t)}var v=t(x);function h(t){return[].concat(t)}function g(t){return"function"==typeof t}function N(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return g(t)?t.apply(void 0,r):t}function d(t,r){var n;return null!==(n=N(t))&&void 0!==n?n:N(r)}function b(t){return!!Array.isArray(t)}var y=t(b);function m(t){return(t=h(t))[t.length-1]}function E(t,r){var n=0;for(r=r.slice(0,-1);n<r.length;n++){var e=r[n];t[e]=d(t[e],[]),t=t[e]}return t}var O=Object.freeze({__proto__:null,transform:function t(r,n){for(var e=[],o=0;o<r.length;o++){var u=r[o];b(u)?e.push(t(u,n)):(u=n(u),f(u)&&e.push(u))}return e},valueAtPath:function(t,r){return E(t,r)[m(r)]},setValueAtPath:function(t,r,n){return E(t,r)[m(r)]=n,t},flatten:function t(r){return h(r).reduce((function(r,n){return b(n)?r.concat(t(n)):h(r).concat(n)}),[])},getCurrent:E});function _(t,r){return Object.prototype.hasOwnProperty.call(t,r)}var j=Object.assign;var A,P=Object.freeze({__proto__:null,createBus:function(){var t={};return{emit:function(r,n){(t[r]||[]).forEach((function(t){t(n)}))},on:function(r,n){return t[r]=(t[r]||[]).concat(n),{off:function(){t[r]=(t[r]||[]).filter((function(t){return t!==n}))}}}}}}),w=(A=0,function(){return"".concat(A++)});function S(t){return!t||(_(t,"length")?u(t,0):"object"==typeof t&&u(Object.keys(t),0))}var F=t(S);exports.StringObject=function(t){return new String(N(t))},exports.asArray=h,exports.assign=j,exports.bindNot=t,exports.bus=P,exports.cache=function(t){function r(t){return n.findIndex((function(r){var n=r[0];return u(t,n.length)&&t.every((function(t,r){return t===n[r]}))}))}void 0===t&&(t=1);var n=[],e=function(r,o){var u=e.get(r);return u?u[1]:(o=o(),n.unshift([r.concat(),o]),c(n,t)&&(n.length=t),o)};return e.invalidate=function(t){-1<(t=r(t))&&n.splice(t,1)},e.get=function(t){return n[r(t)]||null},e},exports.callEach=function(t){return t.forEach((function(t){return t()}))},exports.defaultTo=d,exports.deferThrow=function(t){setTimeout((function(){throw Error(t)}),0)},exports.either=function(t,r){return!!t!=!!r},exports.genId=w,exports.greaterThan=s,exports.hasOwnProperty=_,exports.invariant=function(t,r){if(!t)throw r instanceof String?r.valueOf():Error(r?N(r):r)},exports.isArray=b,exports.isBoolean=function(t){return!!t===t},exports.isEmpty=S,exports.isFunction=g,exports.isNotArray=y,exports.isNotEmpty=F,exports.isNotNull=f,exports.isNotNullish=v,exports.isNotNumeric=n,exports.isNotUndefined=l,exports.isNull=a,exports.isNullish=x,exports.isNumeric=r,exports.isPositive=function(t){return s(t,0)},exports.isPromise=function(t){return t&&g(t.then)},exports.isStringValue=function(t){return String(t)===t},exports.isUndefined=p,exports.last=m,exports.lengthEquals=u,exports.lengthNotEquals=i,exports.longerThan=c,exports.mapFirst=function(t,r){function n(t,r){t&&(e=!0,o=r)}for(var e=!1,o=null,u=0;u<t.length;u++)if(r(t[u],n,u),e)return o},exports.nestedArray=O,exports.numberEquals=e,exports.numberNotEquals=o,exports.optionalFunctionValue=N;

@@ -216,9 +216,2 @@ function bindNot(fn) {

function partition(array, predicate) {
return array.reduce(function (partitions, value, number) {
partitions[predicate(value, number, array) ? 0 : 1].push(value);
return partitions;
}, [[], []]);
}
function either(a, b) {

@@ -307,2 +300,2 @@ return !!a !== !!b;

export { StringObject, asArray, assign, bindNot, bus, createCache as cache, callEach, defaultTo, deferThrow, either, genId, greaterThan, hasOwnProperty, invariant, isArray, isBoolean, isEmpty, isFunction, isNotArray, isNotEmpty, isNotNull, isNotNullish, isNotNumeric, isNotUndefined, isNull, isNullish, isNumeric, isPositive, isPromise, isStringValue, isUndefined, last, lengthEquals, lengthNotEquals, longerThan, mapFirst, nestedArray, numberEquals, numberNotEquals, optionalFunctionValue, partition };
export { StringObject, asArray, assign, bindNot, bus, createCache as cache, callEach, defaultTo, deferThrow, either, genId, greaterThan, hasOwnProperty, invariant, isArray, isBoolean, isEmpty, isFunction, isNotArray, isNotEmpty, isNotNull, isNotNullish, isNotNumeric, isNotUndefined, isNull, isNullish, isNumeric, isPositive, isPromise, isStringValue, isUndefined, last, lengthEquals, lengthNotEquals, longerThan, mapFirst, nestedArray, numberEquals, numberNotEquals, optionalFunctionValue };

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

function n(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!n.apply(void 0,t)}}function t(n){var t=Number(n);return!(isNaN(parseFloat(String(n)))||isNaN(Number(n))||!isFinite(t))}var r=n(t);function u(n,r){return t(n)&&t(r)&&Number(n)===Number(r)}var e=n(u);function o(n,t){return u(n.length,t)}var i=n(o);function a(n,r){return t(n)&&t(r)&&Number(n)>Number(r)}function c(n,t){return a(n.length,t)}function f(n){return null===n}var s=n(f);function l(n){return void 0===n}var v=n(l);function h(n){return null===n||l(n)}var g=n(h);function N(n){return[].concat(n)}function p(n){return"function"==typeof n}function d(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return p(n)?n.apply(void 0,t):n}function b(n,t){var r;return null!==(r=d(n))&&void 0!==r?r:d(t)}function y(n){return!!Array.isArray(n)}var m=n(y);function E(n){return(n=N(n))[n.length-1]}function A(n,t){var r=0;for(t=t.slice(0,-1);r<t.length;r++){var u=t[r];n[u]=b(n[u],[]),n=n[u]}return n}var _=Object.freeze({__proto__:null,transform:function n(t,r){for(var u=[],e=0;e<t.length;e++){var o=t[e];y(o)?u.push(n(o,r)):(o=r(o),s(o)&&u.push(o))}return u},valueAtPath:function(n,t){return A(n,t)[E(t)]},setValueAtPath:function(n,t,r){return A(n,t)[E(t)]=r,n},flatten:function n(t){return N(t).reduce((function(t,r){return y(r)?t.concat(n(r)):N(t).concat(r)}),[])},getCurrent:A});function O(n,t){return Object.prototype.hasOwnProperty.call(n,t)}var j,q=Object.assign,w=Object.freeze({__proto__:null,createBus:function(){var n={};return{emit:function(t,r){(n[t]||[]).forEach((function(n){n(r)}))},on:function(t,r){return n[t]=(n[t]||[]).concat(r),{off:function(){n[t]=(n[t]||[]).filter((function(n){return n!==r}))}}}}}}),F=(j=0,function(){return"".concat(j++)});function S(n){return!n||(O(n,"length")?o(n,0):"object"==typeof n&&o(Object.keys(n),0))}var T=n(S);function P(n){return new String(d(n))}function x(n){function t(r,e){var o=t.get(r);return o?o[1]:(e=e(),u.unshift([r.concat(),e]),c(u,n)&&(u.length=n),e)}function r(n){return u.findIndex((function(t){var r=t[0];return o(n,r.length)&&n.every((function(n,t){return n===r[t]}))}))}void 0===n&&(n=1);var u=[];return t.invalidate=function(n){-1<(n=r(n))&&u.splice(n,1)},t.get=function(n){return u[r(n)]||null},t}function z(n){return n.forEach((function(n){return n()}))}function I(n){setTimeout((function(){throw Error(n)}),0)}function U(n,t){return!!n!=!!t}function V(n,t){if(!n)throw t instanceof String?t.valueOf():Error(t?d(t):t)}function k(n){return!!n===n}function B(n){return a(n,0)}function C(n){return n&&p(n.then)}function D(n){return String(n)===n}function G(n,t){function r(n,t){n&&(u=!0,e=t)}for(var u=!1,e=null,o=0;o<n.length;o++)if(t(n[o],r,o),u)return e}function H(n,t){return n.reduce((function(r,u,e){return r[t(u,e,n)?0:1].push(u),r}),[[],[]])}export{P as StringObject,N as asArray,q as assign,n as bindNot,w as bus,x as cache,z as callEach,b as defaultTo,I as deferThrow,U as either,F as genId,a as greaterThan,O as hasOwnProperty,V as invariant,y as isArray,k as isBoolean,S as isEmpty,p as isFunction,m as isNotArray,T as isNotEmpty,s as isNotNull,g as isNotNullish,r as isNotNumeric,v as isNotUndefined,f as isNull,h as isNullish,t as isNumeric,B as isPositive,C as isPromise,D as isStringValue,l as isUndefined,E as last,o as lengthEquals,i as lengthNotEquals,c as longerThan,G as mapFirst,_ as nestedArray,u as numberEquals,e as numberNotEquals,d as optionalFunctionValue,H as partition};
function n(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!n.apply(void 0,t)}}function t(n){var t=Number(n);return!(isNaN(parseFloat(String(n)))||isNaN(Number(n))||!isFinite(t))}var r=n(t);function u(n,r){return t(n)&&t(r)&&Number(n)===Number(r)}var e=n(u);function o(n,t){return u(n.length,t)}var i=n(o);function a(n,r){return t(n)&&t(r)&&Number(n)>Number(r)}function c(n,t){return a(n.length,t)}function f(n){return null===n}var s=n(f);function l(n){return void 0===n}var v=n(l);function h(n){return null===n||l(n)}var g=n(h);function N(n){return[].concat(n)}function p(n){return"function"==typeof n}function d(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return p(n)?n.apply(void 0,t):n}function b(n,t){var r;return null!==(r=d(n))&&void 0!==r?r:d(t)}function y(n){return!!Array.isArray(n)}var m=n(y);function E(n){return(n=N(n))[n.length-1]}function A(n,t){var r=0;for(t=t.slice(0,-1);r<t.length;r++){var u=t[r];n[u]=b(n[u],[]),n=n[u]}return n}var _=Object.freeze({__proto__:null,transform:function n(t,r){for(var u=[],e=0;e<t.length;e++){var o=t[e];y(o)?u.push(n(o,r)):(o=r(o),s(o)&&u.push(o))}return u},valueAtPath:function(n,t){return A(n,t)[E(t)]},setValueAtPath:function(n,t,r){return A(n,t)[E(t)]=r,n},flatten:function n(t){return N(t).reduce((function(t,r){return y(r)?t.concat(n(r)):N(t).concat(r)}),[])},getCurrent:A});function O(n,t){return Object.prototype.hasOwnProperty.call(n,t)}var j,q=Object.assign,w=Object.freeze({__proto__:null,createBus:function(){var n={};return{emit:function(t,r){(n[t]||[]).forEach((function(n){n(r)}))},on:function(t,r){return n[t]=(n[t]||[]).concat(r),{off:function(){n[t]=(n[t]||[]).filter((function(n){return n!==r}))}}}}}}),F=(j=0,function(){return"".concat(j++)});function S(n){return!n||(O(n,"length")?o(n,0):"object"==typeof n&&o(Object.keys(n),0))}var T=n(S);function P(n){return new String(d(n))}function x(n){function t(r,e){var o=t.get(r);return o?o[1]:(e=e(),u.unshift([r.concat(),e]),c(u,n)&&(u.length=n),e)}function r(n){return u.findIndex((function(t){var r=t[0];return o(n,r.length)&&n.every((function(n,t){return n===r[t]}))}))}void 0===n&&(n=1);var u=[];return t.invalidate=function(n){-1<(n=r(n))&&u.splice(n,1)},t.get=function(n){return u[r(n)]||null},t}function z(n){return n.forEach((function(n){return n()}))}function I(n){setTimeout((function(){throw Error(n)}),0)}function U(n,t){return!!n!=!!t}function V(n,t){if(!n)throw t instanceof String?t.valueOf():Error(t?d(t):t)}function k(n){return!!n===n}function B(n){return a(n,0)}function C(n){return n&&p(n.then)}function D(n){return String(n)===n}function G(n,t){function r(n,t){n&&(u=!0,e=t)}for(var u=!1,e=null,o=0;o<n.length;o++)if(t(n[o],r,o),u)return e}export{P as StringObject,N as asArray,q as assign,n as bindNot,w as bus,x as cache,z as callEach,b as defaultTo,I as deferThrow,U as either,F as genId,a as greaterThan,O as hasOwnProperty,V as invariant,y as isArray,k as isBoolean,S as isEmpty,p as isFunction,m as isNotArray,T as isNotEmpty,s as isNotNull,g as isNotNullish,r as isNotNumeric,v as isNotUndefined,f as isNull,h as isNullish,t as isNumeric,B as isPositive,C as isPromise,D as isStringValue,l as isUndefined,E as last,o as lengthEquals,i as lengthNotEquals,c as longerThan,G as mapFirst,_ as nestedArray,u as numberEquals,e as numberNotEquals,d as optionalFunctionValue};

@@ -222,9 +222,2 @@ (function (global, factory) {

function partition(array, predicate) {
return array.reduce(function (partitions, value, number) {
partitions[predicate(value, number, array) ? 0 : 1].push(value);
return partitions;
}, [[], []]);
}
function either(a, b) {

@@ -353,3 +346,2 @@ return !!a !== !!b;

exports.optionalFunctionValue = optionalFunctionValue;
exports.partition = partition;

@@ -356,0 +348,0 @@ Object.defineProperty(exports, '__esModule', { value: true });

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

"use strict";!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self)["vest-utils"]={})}(this,(function(n){function t(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!n.apply(void 0,t)}}function r(n){var t=Number(n);return!(isNaN(parseFloat(String(n)))||isNaN(Number(n))||!isFinite(t))}function e(n,t){return r(n)&&r(t)&&Number(n)===Number(t)}function u(n,t){return e(n.length,t)}function i(n,t){return r(n)&&r(t)&&Number(n)>Number(t)}function o(n,t){return i(n.length,t)}function c(n){return null===n}function f(n){return void 0===n}function a(n){return null===n||f(n)}function l(n){return[].concat(n)}function s(n){return"function"==typeof n}function h(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return s(n)?n.apply(void 0,t):n}function d(n,t){var r;return null!==(r=h(n))&&void 0!==r?r:h(t)}function p(n){return!!Array.isArray(n)}function g(n){return(n=l(n))[n.length-1]}function v(n,t){var r=0;for(t=t.slice(0,-1);r<t.length;r++){var e=t[r];n[e]=d(n[e],[]),n=n[e]}return n}function N(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function y(n){return!n||(N(n,"length")?u(n,0):"object"==typeof n&&u(Object.keys(n),0))}var b,m=t(r),E=t(e),O=t(u),_=t(c),j=t(f),A=t(a),P=t(p),T=Object.freeze({__proto__:null,transform:function n(t,r){for(var e=[],u=0;u<t.length;u++){var i=t[u];p(i)?e.push(n(i,r)):(i=r(i),_(i)&&e.push(i))}return e},valueAtPath:function(n,t){return v(n,t)[g(t)]},setValueAtPath:function(n,t,r){return v(n,t)[g(t)]=r,n},flatten:function n(t){return l(t).reduce((function(t,r){return p(r)?t.concat(n(r)):l(t).concat(r)}),[])},getCurrent:v}),w=Object.assign,S=Object.freeze({__proto__:null,createBus:function(){var n={};return{emit:function(t,r){(n[t]||[]).forEach((function(n){n(r)}))},on:function(t,r){return n[t]=(n[t]||[]).concat(r),{off:function(){n[t]=(n[t]||[]).filter((function(n){return n!==r}))}}}}}}),F=(b=0,function(){return"".concat(b++)}),q=t(y);n.StringObject=function(n){return new String(h(n))},n.asArray=l,n.assign=w,n.bindNot=t,n.bus=S,n.cache=function(n){function t(n){return r.findIndex((function(t){var r=t[0];return u(n,r.length)&&n.every((function(n,t){return n===r[t]}))}))}void 0===n&&(n=1);var r=[],e=function(t,u){var i=e.get(t);return i?i[1]:(u=u(),r.unshift([t.concat(),u]),o(r,n)&&(r.length=n),u)};return e.invalidate=function(n){-1<(n=t(n))&&r.splice(n,1)},e.get=function(n){return r[t(n)]||null},e},n.callEach=function(n){return n.forEach((function(n){return n()}))},n.defaultTo=d,n.deferThrow=function(n){setTimeout((function(){throw Error(n)}),0)},n.either=function(n,t){return!!n!=!!t},n.genId=F,n.greaterThan=i,n.hasOwnProperty=N,n.invariant=function(n,t){if(!n)throw t instanceof String?t.valueOf():Error(t?h(t):t)},n.isArray=p,n.isBoolean=function(n){return!!n===n},n.isEmpty=y,n.isFunction=s,n.isNotArray=P,n.isNotEmpty=q,n.isNotNull=_,n.isNotNullish=A,n.isNotNumeric=m,n.isNotUndefined=j,n.isNull=c,n.isNullish=a,n.isNumeric=r,n.isPositive=function(n){return i(n,0)},n.isPromise=function(n){return n&&s(n.then)},n.isStringValue=function(n){return String(n)===n},n.isUndefined=f,n.last=g,n.lengthEquals=u,n.lengthNotEquals=O,n.longerThan=o,n.mapFirst=function(n,t){function r(n,t){n&&(e=!0,u=t)}for(var e=!1,u=null,i=0;i<n.length;i++)if(t(n[i],r,i),e)return u},n.nestedArray=T,n.numberEquals=e,n.numberNotEquals=E,n.optionalFunctionValue=h,n.partition=function(n,t){return n.reduce((function(r,e,u){return r[t(e,u,n)?0:1].push(e),r}),[[],[]])},Object.defineProperty(n,"__esModule",{value:!0})}));
"use strict";!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self)["vest-utils"]={})}(this,(function(n){function t(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return!n.apply(void 0,t)}}function r(n){var t=Number(n);return!(isNaN(parseFloat(String(n)))||isNaN(Number(n))||!isFinite(t))}function e(n,t){return r(n)&&r(t)&&Number(n)===Number(t)}function u(n,t){return e(n.length,t)}function i(n,t){return r(n)&&r(t)&&Number(n)>Number(t)}function o(n,t){return i(n.length,t)}function c(n){return null===n}function f(n){return void 0===n}function a(n){return null===n||f(n)}function l(n){return[].concat(n)}function s(n){return"function"==typeof n}function h(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return s(n)?n.apply(void 0,t):n}function d(n,t){var r;return null!==(r=h(n))&&void 0!==r?r:h(t)}function g(n){return!!Array.isArray(n)}function p(n){return(n=l(n))[n.length-1]}function v(n,t){var r=0;for(t=t.slice(0,-1);r<t.length;r++){var e=t[r];n[e]=d(n[e],[]),n=n[e]}return n}function N(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function y(n){return!n||(N(n,"length")?u(n,0):"object"==typeof n&&u(Object.keys(n),0))}var b,m=t(r),E=t(e),O=t(u),_=t(c),j=t(f),A=t(a),P=t(g),T=Object.freeze({__proto__:null,transform:function n(t,r){for(var e=[],u=0;u<t.length;u++){var i=t[u];g(i)?e.push(n(i,r)):(i=r(i),_(i)&&e.push(i))}return e},valueAtPath:function(n,t){return v(n,t)[p(t)]},setValueAtPath:function(n,t,r){return v(n,t)[p(t)]=r,n},flatten:function n(t){return l(t).reduce((function(t,r){return g(r)?t.concat(n(r)):l(t).concat(r)}),[])},getCurrent:v}),w=Object.assign,S=Object.freeze({__proto__:null,createBus:function(){var n={};return{emit:function(t,r){(n[t]||[]).forEach((function(n){n(r)}))},on:function(t,r){return n[t]=(n[t]||[]).concat(r),{off:function(){n[t]=(n[t]||[]).filter((function(n){return n!==r}))}}}}}}),F=(b=0,function(){return"".concat(b++)}),q=t(y);n.StringObject=function(n){return new String(h(n))},n.asArray=l,n.assign=w,n.bindNot=t,n.bus=S,n.cache=function(n){function t(n){return r.findIndex((function(t){var r=t[0];return u(n,r.length)&&n.every((function(n,t){return n===r[t]}))}))}void 0===n&&(n=1);var r=[],e=function(t,u){var i=e.get(t);return i?i[1]:(u=u(),r.unshift([t.concat(),u]),o(r,n)&&(r.length=n),u)};return e.invalidate=function(n){-1<(n=t(n))&&r.splice(n,1)},e.get=function(n){return r[t(n)]||null},e},n.callEach=function(n){return n.forEach((function(n){return n()}))},n.defaultTo=d,n.deferThrow=function(n){setTimeout((function(){throw Error(n)}),0)},n.either=function(n,t){return!!n!=!!t},n.genId=F,n.greaterThan=i,n.hasOwnProperty=N,n.invariant=function(n,t){if(!n)throw t instanceof String?t.valueOf():Error(t?h(t):t)},n.isArray=g,n.isBoolean=function(n){return!!n===n},n.isEmpty=y,n.isFunction=s,n.isNotArray=P,n.isNotEmpty=q,n.isNotNull=_,n.isNotNullish=A,n.isNotNumeric=m,n.isNotUndefined=j,n.isNull=c,n.isNullish=a,n.isNumeric=r,n.isPositive=function(n){return i(n,0)},n.isPromise=function(n){return n&&s(n.then)},n.isStringValue=function(n){return String(n)===n},n.isUndefined=f,n.last=p,n.lengthEquals=u,n.lengthNotEquals=O,n.longerThan=o,n.mapFirst=function(n,t){function r(n,t){n&&(e=!0,u=t)}for(var e=!1,u=null,i=0;i<n.length;i++)if(t(n[i],r,i),e)return u},n.nestedArray=T,n.numberEquals=e,n.numberNotEquals=E,n.optionalFunctionValue=h,Object.defineProperty(n,"__esModule",{value:!0})}));
{
"version": "0.0.4-dev-afe5de",
"version": "0.0.4-dev-c786f7",
"name": "vest-utils",

@@ -4,0 +4,0 @@ "author": "ealush",

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

declare let __DEV__: boolean;
declare let __LIB_VERSION__: string;
declare let LIBRARY_NAME: string;
declare const __DEV__: boolean;
declare const __LIB_VERSION__: string;
declare const LIBRARY_NAME: string;

@@ -13,3 +13,2 @@ export { default as cache } from 'cache';

export { default as isStringValue } from 'isStringValue';
export { default as partition } from 'partition';
export { default as bindNot } from 'bindNot';

@@ -16,0 +15,0 @@ export { default as either } from 'either';

@@ -31,5 +31,5 @@ /**

declare const _default: {
<T, U>(target: T, source: U): T & U;
<T_1, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
<T_2, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
<T extends {}, U>(target: T, source: U): T & U;
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
(target: object, ...sources: any[]): any;

@@ -46,6 +46,2 @@ };

declare function isStringValue(v: unknown): v is string;
declare function partition<T>(array: T[], predicate: (value: T, index: number, array: T[]) => boolean): [
T[],
T[]
];
declare function bindNot<T extends (...args: any[]) => unknown>(fn: T): (...args: Parameters<T>) => boolean;

@@ -98,2 +94,2 @@ declare function either(a: unknown, b: unknown): boolean;

declare function isPositive(value: number | string): boolean;
export { createCache as cache, isNullish, isNotNullish, nestedArray, asArray, callEach, hasOwnProperty, isPromise, optionalFunctionValue, _default as assign, defaultTo, invariant, StringObject, isStringValue, partition, bindNot, either, isBoolean, last, deferThrow, bus, genId, isFunction, mapFirst, greaterThan, longerThan, isNumeric, isNotNumeric, lengthEquals, lengthNotEquals, numberEquals, numberNotEquals, isNull, isNotNull, isUndefined, isNotUndefined, isArray, isNotArray, isEmpty, isNotEmpty, isPositive };
export { createCache as cache, isNullish, isNotNullish, nestedArray, asArray, callEach, hasOwnProperty, isPromise, optionalFunctionValue, _default as assign, defaultTo, invariant, StringObject, isStringValue, bindNot, either, isBoolean, last, deferThrow, bus, genId, isFunction, mapFirst, greaterThan, longerThan, isNumeric, isNotNumeric, lengthEquals, lengthNotEquals, numberEquals, numberNotEquals, isNull, isNotNull, isUndefined, isNotUndefined, isArray, isNotArray, isEmpty, isNotEmpty, isPositive };
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