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 1.2.13 to 1.2.14-dev-20240617-b233

5

dist/cjs/vest-utils.development.js

@@ -327,2 +327,6 @@ 'use strict';

function freezeAssign(...args) {
return Object.freeze(assign(...args));
}
exports.Predicates = Predicates;

@@ -340,2 +344,3 @@ exports.StateMachine = StateMachine;

exports.either = either;
exports.freezeAssign = freezeAssign;
exports.genSeq = genSeq;

@@ -342,0 +347,0 @@ exports.greaterThan = greaterThan;

2

dist/cjs/vest-utils.production.js

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

"use strict";function t(t){return(...n)=>!t(...n)}function n(t){const n=String(t),r=Number(t),e=!isNaN(parseFloat(n))&&!isNaN(Number(t))&&isFinite(r);return Boolean(e)}const r=t(n);function e(t,r){return n(t)&&n(r)&&Number(t)===Number(r)}const o=t(e);function i(t,n){return e(t.length,n)}const u=t(i);function s(t,r){return n(t)&&n(r)&&Number(t)>Number(r)}function c(t,n){return s(t.length,n)}function a(t){return null===t}const f=t(a);function l(t){return void 0===t}const p=t(l);function x(t){return a(t)||l(t)}const h=t(x);function N(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function g(t){return"function"==typeof t}function v(t,...n){return g(t)?t(...n):t}var y=Object.assign;function b(t,n){if(!t)throw n instanceof String?n.valueOf():new Error(n?v(n):n)}var d=Object.freeze({__proto__:null,createBus:function(){const t={};return{emit(t,r){n(t).concat(n("*")).forEach((t=>{t(r)}))},on:(r,e)=>(t[r]=n(r).concat(e),{off(){t[r]=n(r).filter((t=>t!==e))}})};function n(n){return t[n]||[]}}});const m=_();function _(t){return n=0,()=>`${t?t+"_":""}${n++}`;var n}function E(t){return"object"==typeof t&&!x(t)}function O(t){return Boolean(Array.isArray(t))}const S=t(O);function j(t){return!t||(N(t,"length")?i(t,0):!!E(t)&&i(Object.keys(t),0))}const w=t(j);const A=/{(.*?)}/g;var T=Object.freeze({__proto__:null,createTinyState:function(t){let n;return e(),()=>[n,r,e];function r(t){n=v(t,n)}function e(){r(v(t))}}});var q=Object.freeze({__proto__:null,all:function(...t){return n=>!j(t)&&t.every((t=>v(t,n)))},any:function(...t){return n=>!j(t)&&t.some((t=>v(t,n)))}});exports.Predicates=q,exports.StateMachine=function(t){let n=t.initial;return{getState:function(){return n},initial:function(){return t.initial},staticTransition:r,transition:function(t,e){return n=r(n,t,e)}};function r(n,r,e){var o,i,u;let s=null!==(i=null===(o=t.states[n])||void 0===o?void 0:o[r])&&void 0!==i?i:null===(u=t.states["*"])||void 0===u?void 0:u[r];if(Array.isArray(s)){const[,t]=s;if(!t(e))return n;s=s[0]}return s&&s!==n?s:n}},exports.StringObject=function(t){return new String(v(t))},exports.asArray=function(t){return[].concat(t)},exports.assign=y,exports.bindNot=t,exports.bus=d,exports.cache=function(t=1){const n=[],r=(e,o)=>{const i=r.get(e);if(i)return i[1];const u=o();return n.unshift([e.concat(),u]),c(n,t)&&(n.length=t),u};return r.invalidate=t=>{const r=e(t);r>-1&&n.splice(r,1)},r.get=t=>n[e(t)]||null,r;function e(t){return n.findIndex((([n])=>i(t,n.length)&&t.every(((t,r)=>t===n[r]))))}},exports.callEach=function(t){return t.forEach((t=>t()))},exports.defaultTo=function(t,n){var r;return null!==(r=v(t))&&void 0!==r?r:v(n)},exports.deferThrow=function(t){setTimeout((()=>{throw new Error(t)}),0)},exports.either=function(t,n){return!!t!=!!n},exports.genSeq=_,exports.greaterThan=s,exports.hasOwnProperty=N,exports.invariant=b,exports.isArray=O,exports.isBoolean=function(t){return!!t===t},exports.isEmpty=j,exports.isFunction=g,exports.isNotArray=S,exports.isNotEmpty=w,exports.isNotNull=f,exports.isNotNullish=h,exports.isNotNumeric=r,exports.isNotUndefined=p,exports.isNull=a,exports.isNullish=x,exports.isNumeric=n,exports.isObject=E,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=l,exports.lengthEquals=i,exports.lengthNotEquals=u,exports.longerThan=c,exports.mapFirst=function(t,n){let r=!1,e=null;for(let i=0;i<t.length;i++)if(n(t[i],o,i),r)return e;function o(t,n){t&&(r=!0,e=n)}},exports.nonnullish=function(t,n){return b(!x(t),n),t},exports.noop=function(){},exports.numberEquals=e,exports.numberNotEquals=o,exports.optionalFunctionValue=v,exports.seq=m,exports.text=function(t,...n){const r=n[0];if(E(r))return t.replace(A,((t,n)=>{var e;return`${null!==(e=r[n])&&void 0!==e?e:t}`}));const e=[...n];return t.replace(A,(t=>`${j(e)?t:e.shift()}`))},exports.tinyState=T;
"use strict";function t(t){return(...n)=>!t(...n)}function n(t){const n=String(t),r=Number(t),e=!isNaN(parseFloat(n))&&!isNaN(Number(t))&&isFinite(r);return Boolean(e)}const r=t(n);function e(t,r){return n(t)&&n(r)&&Number(t)===Number(r)}const o=t(e);function i(t,n){return e(t.length,n)}const u=t(i);function s(t,r){return n(t)&&n(r)&&Number(t)>Number(r)}function c(t,n){return s(t.length,n)}function f(t){return null===t}const a=t(f);function l(t){return void 0===t}const p=t(l);function x(t){return f(t)||l(t)}const h=t(x);function N(t,n){return Object.prototype.hasOwnProperty.call(t,n)}function g(t){return"function"==typeof t}function v(t,...n){return g(t)?t(...n):t}var b=Object.assign;function y(t,n){if(!t)throw n instanceof String?n.valueOf():new Error(n?v(n):n)}var d=Object.freeze({__proto__:null,createBus:function(){const t={};return{emit(t,r){n(t).concat(n("*")).forEach((t=>{t(r)}))},on:(r,e)=>(t[r]=n(r).concat(e),{off(){t[r]=n(r).filter((t=>t!==e))}})};function n(n){return t[n]||[]}}});const m=_();function _(t){return n=0,()=>`${t?t+"_":""}${n++}`;var n}function O(t){return"object"==typeof t&&!x(t)}function E(t){return Boolean(Array.isArray(t))}const S=t(E);function j(t){return!t||(N(t,"length")?i(t,0):!!O(t)&&i(Object.keys(t),0))}const w=t(j);const A=/{(.*?)}/g;var T=Object.freeze({__proto__:null,createTinyState:function(t){let n;return e(),()=>[n,r,e];function r(t){n=v(t,n)}function e(){r(v(t))}}});var q=Object.freeze({__proto__:null,all:function(...t){return n=>!j(t)&&t.every((t=>v(t,n)))},any:function(...t){return n=>!j(t)&&t.some((t=>v(t,n)))}});exports.Predicates=q,exports.StateMachine=function(t){let n=t.initial;return{getState:function(){return n},initial:function(){return t.initial},staticTransition:r,transition:function(t,e){return n=r(n,t,e)}};function r(n,r,e){var o,i,u;let s=null!==(i=null===(o=t.states[n])||void 0===o?void 0:o[r])&&void 0!==i?i:null===(u=t.states["*"])||void 0===u?void 0:u[r];if(Array.isArray(s)){const[,t]=s;if(!t(e))return n;s=s[0]}return s&&s!==n?s:n}},exports.StringObject=function(t){return new String(v(t))},exports.asArray=function(t){return[].concat(t)},exports.assign=b,exports.bindNot=t,exports.bus=d,exports.cache=function(t=1){const n=[],r=(e,o)=>{const i=r.get(e);if(i)return i[1];const u=o();return n.unshift([e.concat(),u]),c(n,t)&&(n.length=t),u};return r.invalidate=t=>{const r=e(t);r>-1&&n.splice(r,1)},r.get=t=>n[e(t)]||null,r;function e(t){return n.findIndex((([n])=>i(t,n.length)&&t.every(((t,r)=>t===n[r]))))}},exports.callEach=function(t){return t.forEach((t=>t()))},exports.defaultTo=function(t,n){var r;return null!==(r=v(t))&&void 0!==r?r:v(n)},exports.deferThrow=function(t){setTimeout((()=>{throw new Error(t)}),0)},exports.either=function(t,n){return!!t!=!!n},exports.freezeAssign=function(...t){return Object.freeze(b(...t))},exports.genSeq=_,exports.greaterThan=s,exports.hasOwnProperty=N,exports.invariant=y,exports.isArray=E,exports.isBoolean=function(t){return!!t===t},exports.isEmpty=j,exports.isFunction=g,exports.isNotArray=S,exports.isNotEmpty=w,exports.isNotNull=a,exports.isNotNullish=h,exports.isNotNumeric=r,exports.isNotUndefined=p,exports.isNull=f,exports.isNullish=x,exports.isNumeric=n,exports.isObject=O,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=l,exports.lengthEquals=i,exports.lengthNotEquals=u,exports.longerThan=c,exports.mapFirst=function(t,n){let r=!1,e=null;for(let i=0;i<t.length;i++)if(n(t[i],o,i),r)return e;function o(t,n){t&&(r=!0,e=n)}},exports.nonnullish=function(t,n){return y(!x(t),n),t},exports.noop=function(){},exports.numberEquals=e,exports.numberNotEquals=o,exports.optionalFunctionValue=v,exports.seq=m,exports.text=function(t,...n){const r=n[0];if(O(r))return t.replace(A,((t,n)=>{var e;return`${null!==(e=r[n])&&void 0!==e?e:t}`}));const e=[...n];return t.replace(A,(t=>`${j(e)?t:e.shift()}`))},exports.tinyState=T;
//# sourceMappingURL=vest-utils.production.js.map

@@ -325,3 +325,7 @@ function bindNot(fn) {

export { Predicates, StateMachine, StringObject, asArray, assign, bindNot, bus, createCache as cache, callEach, defaultTo, deferThrow, either, genSeq, greaterThan, hasOwnProperty, invariant, isArray, isBoolean, isEmpty, isFunction, isNotArray, isNotEmpty, isNotNull, isNotNullish, isNotNumeric, isNotUndefined, isNull, isNullish, isNumeric, isObject, isPositive, isPromise, isStringValue, isUndefined, lengthEquals, lengthNotEquals, longerThan, mapFirst, nonnullish, noop, numberEquals, numberNotEquals, optionalFunctionValue, seq, text, tinyState };
function freezeAssign(...args) {
return Object.freeze(assign(...args));
}
export { Predicates, StateMachine, StringObject, asArray, assign, bindNot, bus, createCache as cache, callEach, defaultTo, deferThrow, either, freezeAssign, genSeq, greaterThan, hasOwnProperty, invariant, isArray, isBoolean, isEmpty, isFunction, isNotArray, isNotEmpty, isNotNull, isNotNullish, isNotNumeric, isNotUndefined, isNull, isNullish, isNumeric, isObject, isPositive, isPromise, isStringValue, isUndefined, lengthEquals, lengthNotEquals, longerThan, mapFirst, nonnullish, noop, numberEquals, numberNotEquals, optionalFunctionValue, seq, text, tinyState };
//# sourceMappingURL=vest-utils.development.js.map

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

function n(n){return(...t)=>!n(...t)}function t(n){const t=String(n),r=Number(n),e=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(r);return Boolean(e)}const r=n(t);function e(n,r){return t(n)&&t(r)&&Number(n)===Number(r)}const u=n(e);function o(n,t){return e(n.length,t)}const i=n(o);function c(n,r){return t(n)&&t(r)&&Number(n)>Number(r)}function f(n,t){return c(n.length,t)}function a(n=1){const t=[],r=(e,u)=>{const o=r.get(e);if(o)return o[1];const i=u();return t.unshift([e.concat(),i]),f(t,n)&&(t.length=n),i};return r.invalidate=n=>{const r=e(n);r>-1&&t.splice(r,1)},r.get=n=>t[e(n)]||null,r;function e(n){return t.findIndex((([t])=>o(n,t.length)&&n.every(((n,r)=>n===t[r]))))}}function l(n){return null===n}const s=n(l);function v(n){return void 0===n}const g=n(v);function h(n){return l(n)||v(n)}const b=n(h);function p(n){return[].concat(n)}function y(n){return n.forEach((n=>n()))}function _(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function d(n){return"function"==typeof n}function N(n){return!!n&&d(n.then)}function m(n,...t){return d(n)?n(...t):n}var O=Object.assign;function j(n,t){var r;return null!==(r=m(n))&&void 0!==r?r:m(t)}function w(n,t){if(!n)throw t instanceof String?t.valueOf():new Error(t?m(t):t)}function S(n){return String(n)===n}function A(n,t){return!!n!=!!t}function E(n){return!!n===n}function $(n){setTimeout((()=>{throw new Error(n)}),0)}var z=Object.freeze({__proto__:null,createBus:function(){const n={};return{emit(n,r){t(n).concat(t("*")).forEach((n=>{n(r)}))},on:(r,e)=>(n[r]=t(r).concat(e),{off(){n[r]=t(r).filter((n=>n!==e))}})};function t(t){return n[t]||[]}}});const B=T();function T(n){return t=0,()=>`${n?n+"_":""}${t++}`;var t}function x(n,t){let r=!1,e=null;for(let o=0;o<n.length;o++)if(t(n[o],u,o),r)return e;function u(n,t){n&&(r=!0,e=t)}}function F(n){return"object"==typeof n&&!h(n)}function k(n){return Boolean(Array.isArray(n))}const I=n(k);function P(n){return!n||(_(n,"length")?o(n,0):!!F(n)&&o(Object.keys(n),0))}const q=n(P);function C(n){return c(n,0)}const D=/{(.*?)}/g;function G(n,...t){const r=t[0];if(F(r))return n.replace(D,((n,t)=>{var e;return`${null!==(e=r[t])&&void 0!==e?e:n}`}));const e=[...t];return n.replace(D,(n=>`${P(e)?n:e.shift()}`))}function H(n){let t=n.initial;return{getState:function(){return t},initial:function(){return n.initial},staticTransition:r,transition:function(n,e){return t=r(t,n,e)}};function r(t,r,e){var u,o,i;let c=null!==(o=null===(u=n.states[t])||void 0===u?void 0:u[r])&&void 0!==o?o:null===(i=n.states["*"])||void 0===i?void 0:i[r];if(Array.isArray(c)){const[,n]=c;if(!n(e))return t;c=c[0]}return c&&c!==t?c:t}}function J(n,t){return w(!h(n),t),n}var K=Object.freeze({__proto__:null,createTinyState:function(n){let t;return e(),()=>[t,r,e];function r(n){t=m(n,t)}function e(){r(m(n))}}});function L(n){return new String(m(n))}function M(){}var Q=Object.freeze({__proto__:null,all:function(...n){return t=>!P(n)&&n.every((n=>m(n,t)))},any:function(...n){return t=>!P(n)&&n.some((n=>m(n,t)))}});export{Q as Predicates,H as StateMachine,L as StringObject,p as asArray,O as assign,n as bindNot,z as bus,a as cache,y as callEach,j as defaultTo,$ as deferThrow,A as either,T as genSeq,c as greaterThan,_ as hasOwnProperty,w as invariant,k as isArray,E as isBoolean,P as isEmpty,d as isFunction,I as isNotArray,q as isNotEmpty,s as isNotNull,b as isNotNullish,r as isNotNumeric,g as isNotUndefined,l as isNull,h as isNullish,t as isNumeric,F as isObject,C as isPositive,N as isPromise,S as isStringValue,v as isUndefined,o as lengthEquals,i as lengthNotEquals,f as longerThan,x as mapFirst,J as nonnullish,M as noop,e as numberEquals,u as numberNotEquals,m as optionalFunctionValue,B as seq,G as text,K as tinyState};
function n(n){return(...t)=>!n(...t)}function t(n){const t=String(n),r=Number(n),e=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(r);return Boolean(e)}const r=n(t);function e(n,r){return t(n)&&t(r)&&Number(n)===Number(r)}const u=n(e);function o(n,t){return e(n.length,t)}const i=n(o);function c(n,r){return t(n)&&t(r)&&Number(n)>Number(r)}function f(n,t){return c(n.length,t)}function a(n=1){const t=[],r=(e,u)=>{const o=r.get(e);if(o)return o[1];const i=u();return t.unshift([e.concat(),i]),f(t,n)&&(t.length=n),i};return r.invalidate=n=>{const r=e(n);r>-1&&t.splice(r,1)},r.get=n=>t[e(n)]||null,r;function e(n){return t.findIndex((([t])=>o(n,t.length)&&n.every(((n,r)=>n===t[r]))))}}function l(n){return null===n}const s=n(l);function v(n){return void 0===n}const g=n(v);function h(n){return l(n)||v(n)}const b=n(h);function p(n){return[].concat(n)}function y(n){return n.forEach((n=>n()))}function _(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function d(n){return"function"==typeof n}function N(n){return!!n&&d(n.then)}function m(n,...t){return d(n)?n(...t):n}var O=Object.assign;function j(n,t){var r;return null!==(r=m(n))&&void 0!==r?r:m(t)}function w(n,t){if(!n)throw t instanceof String?t.valueOf():new Error(t?m(t):t)}function S(n){return String(n)===n}function z(n,t){return!!n!=!!t}function A(n){return!!n===n}function E(n){setTimeout((()=>{throw new Error(n)}),0)}var $=Object.freeze({__proto__:null,createBus:function(){const n={};return{emit(n,r){t(n).concat(t("*")).forEach((n=>{n(r)}))},on:(r,e)=>(n[r]=t(r).concat(e),{off(){n[r]=t(r).filter((n=>n!==e))}})};function t(t){return n[t]||[]}}});const B=T();function T(n){return t=0,()=>`${n?n+"_":""}${t++}`;var t}function x(n,t){let r=!1,e=null;for(let o=0;o<n.length;o++)if(t(n[o],u,o),r)return e;function u(n,t){n&&(r=!0,e=t)}}function F(n){return"object"==typeof n&&!h(n)}function k(n){return Boolean(Array.isArray(n))}const I=n(k);function P(n){return!n||(_(n,"length")?o(n,0):!!F(n)&&o(Object.keys(n),0))}const q=n(P);function C(n){return c(n,0)}const D=/{(.*?)}/g;function G(n,...t){const r=t[0];if(F(r))return n.replace(D,((n,t)=>{var e;return`${null!==(e=r[t])&&void 0!==e?e:n}`}));const e=[...t];return n.replace(D,(n=>`${P(e)?n:e.shift()}`))}function H(n){let t=n.initial;return{getState:function(){return t},initial:function(){return n.initial},staticTransition:r,transition:function(n,e){return t=r(t,n,e)}};function r(t,r,e){var u,o,i;let c=null!==(o=null===(u=n.states[t])||void 0===u?void 0:u[r])&&void 0!==o?o:null===(i=n.states["*"])||void 0===i?void 0:i[r];if(Array.isArray(c)){const[,n]=c;if(!n(e))return t;c=c[0]}return c&&c!==t?c:t}}function J(n,t){return w(!h(n),t),n}var K=Object.freeze({__proto__:null,createTinyState:function(n){let t;return e(),()=>[t,r,e];function r(n){t=m(n,t)}function e(){r(m(n))}}});function L(n){return new String(m(n))}function M(){}var Q=Object.freeze({__proto__:null,all:function(...n){return t=>!P(n)&&n.every((n=>m(n,t)))},any:function(...n){return t=>!P(n)&&n.some((n=>m(n,t)))}});function R(...n){return Object.freeze(O(...n))}export{Q as Predicates,H as StateMachine,L as StringObject,p as asArray,O as assign,n as bindNot,$ as bus,a as cache,y as callEach,j as defaultTo,E as deferThrow,z as either,R as freezeAssign,T as genSeq,c as greaterThan,_ as hasOwnProperty,w as invariant,k as isArray,A as isBoolean,P as isEmpty,d as isFunction,I as isNotArray,q as isNotEmpty,s as isNotNull,b as isNotNullish,r as isNotNumeric,g as isNotUndefined,l as isNull,h as isNullish,t as isNumeric,F as isObject,C as isPositive,N as isPromise,S as isStringValue,v as isUndefined,o as lengthEquals,i as lengthNotEquals,f as longerThan,x as mapFirst,J as nonnullish,M as noop,e as numberEquals,u as numberNotEquals,m as optionalFunctionValue,B as seq,G as text,K as tinyState};
//# sourceMappingURL=vest-utils.production.js.map

@@ -331,2 +331,6 @@ (function (global, factory) {

function freezeAssign(...args) {
return Object.freeze(assign(...args));
}
exports.Predicates = Predicates;

@@ -344,2 +348,3 @@ exports.StateMachine = StateMachine;

exports.either = either;
exports.freezeAssign = freezeAssign;
exports.genSeq = genSeq;

@@ -346,0 +351,0 @@ exports.greaterThan = greaterThan;

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

!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){"use strict";function t(n){return(...t)=>!n(...t)}function e(n){const t=String(n),e=Number(n),r=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(e);return Boolean(r)}const r=t(e);function i(n,t){return e(n)&&e(t)&&Number(n)===Number(t)}const o=t(i);function u(n,t){return i(n.length,t)}const c=t(u);function s(n,t){return e(n)&&e(t)&&Number(n)>Number(t)}function f(n,t){return s(n.length,t)}function l(n){return null===n}const a=t(l);function h(n){return void 0===n}const d=t(h);function g(n){return l(n)||h(n)}const p=t(g);function N(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function y(n){return"function"==typeof n}function v(n,...t){return y(n)?n(...t):n}var b=Object.assign;function m(n,t){if(!n)throw t instanceof String?t.valueOf():new Error(t?v(t):t)}var _=Object.freeze({__proto__:null,createBus:function(){const n={};return{emit(n,e){t(n).concat(t("*")).forEach((n=>{n(e)}))},on:(e,r)=>(n[e]=t(e).concat(r),{off(){n[e]=t(e).filter((n=>n!==r))}})};function t(t){return n[t]||[]}}});const E=O();function O(n){return t=0,()=>`${n?n+"_":""}${t++}`;var t}function S(n){return"object"==typeof n&&!g(n)}function j(n){return Boolean(Array.isArray(n))}const T=t(j);function w(n){return!n||(N(n,"length")?u(n,0):!!S(n)&&u(Object.keys(n),0))}const A=t(w);const q=/{(.*?)}/g;var x=Object.freeze({__proto__:null,createTinyState:function(n){let t;return r(),()=>[t,e,r];function e(n){t=v(n,t)}function r(){e(v(n))}}});var F=Object.freeze({__proto__:null,all:function(...n){return t=>!w(n)&&n.every((n=>v(n,t)))},any:function(...n){return t=>!w(n)&&n.some((n=>v(n,t)))}});n.Predicates=F,n.StateMachine=function(n){let t=n.initial;return{getState:function(){return t},initial:function(){return n.initial},staticTransition:e,transition:function(n,r){return t=e(t,n,r)}};function e(t,e,r){var i,o,u;let c=null!==(o=null===(i=n.states[t])||void 0===i?void 0:i[e])&&void 0!==o?o:null===(u=n.states["*"])||void 0===u?void 0:u[e];if(Array.isArray(c)){const[,n]=c;if(!n(r))return t;c=c[0]}return c&&c!==t?c:t}},n.StringObject=function(n){return new String(v(n))},n.asArray=function(n){return[].concat(n)},n.assign=b,n.bindNot=t,n.bus=_,n.cache=function(n=1){const t=[],e=(r,i)=>{const o=e.get(r);if(o)return o[1];const u=i();return t.unshift([r.concat(),u]),f(t,n)&&(t.length=n),u};return e.invalidate=n=>{const e=r(n);e>-1&&t.splice(e,1)},e.get=n=>t[r(n)]||null,e;function r(n){return t.findIndex((([t])=>u(n,t.length)&&n.every(((n,e)=>n===t[e]))))}},n.callEach=function(n){return n.forEach((n=>n()))},n.defaultTo=function(n,t){var e;return null!==(e=v(n))&&void 0!==e?e:v(t)},n.deferThrow=function(n){setTimeout((()=>{throw new Error(n)}),0)},n.either=function(n,t){return!!n!=!!t},n.genSeq=O,n.greaterThan=s,n.hasOwnProperty=N,n.invariant=m,n.isArray=j,n.isBoolean=function(n){return!!n===n},n.isEmpty=w,n.isFunction=y,n.isNotArray=T,n.isNotEmpty=A,n.isNotNull=a,n.isNotNullish=p,n.isNotNumeric=r,n.isNotUndefined=d,n.isNull=l,n.isNullish=g,n.isNumeric=e,n.isObject=S,n.isPositive=function(n){return s(n,0)},n.isPromise=function(n){return!!n&&y(n.then)},n.isStringValue=function(n){return String(n)===n},n.isUndefined=h,n.lengthEquals=u,n.lengthNotEquals=c,n.longerThan=f,n.mapFirst=function(n,t){let e=!1,r=null;for(let o=0;o<n.length;o++)if(t(n[o],i,o),e)return r;function i(n,t){n&&(e=!0,r=t)}},n.nonnullish=function(n,t){return m(!g(n),t),n},n.noop=function(){},n.numberEquals=i,n.numberNotEquals=o,n.optionalFunctionValue=v,n.seq=E,n.text=function(n,...t){const e=t[0];if(S(e))return n.replace(q,((n,t)=>{var r;return`${null!==(r=e[t])&&void 0!==r?r:n}`}));const r=[...t];return n.replace(q,(n=>`${w(r)?n:r.shift()}`))},n.tinyState=x}));
!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){"use strict";function t(n){return(...t)=>!n(...t)}function e(n){const t=String(n),e=Number(n),r=!isNaN(parseFloat(t))&&!isNaN(Number(n))&&isFinite(e);return Boolean(r)}const r=t(e);function i(n,t){return e(n)&&e(t)&&Number(n)===Number(t)}const o=t(i);function u(n,t){return i(n.length,t)}const c=t(u);function s(n,t){return e(n)&&e(t)&&Number(n)>Number(t)}function f(n,t){return s(n.length,t)}function l(n){return null===n}const a=t(l);function h(n){return void 0===n}const d=t(h);function g(n){return l(n)||h(n)}const p=t(g);function N(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function y(n){return"function"==typeof n}function b(n,...t){return y(n)?n(...t):n}var v=Object.assign;function m(n,t){if(!n)throw t instanceof String?t.valueOf():new Error(t?b(t):t)}var _=Object.freeze({__proto__:null,createBus:function(){const n={};return{emit(n,e){t(n).concat(t("*")).forEach((n=>{n(e)}))},on:(e,r)=>(n[e]=t(e).concat(r),{off(){n[e]=t(e).filter((n=>n!==r))}})};function t(t){return n[t]||[]}}});const O=j();function j(n){return t=0,()=>`${n?n+"_":""}${t++}`;var t}function E(n){return"object"==typeof n&&!g(n)}function S(n){return Boolean(Array.isArray(n))}const T=t(S);function w(n){return!n||(N(n,"length")?u(n,0):!!E(n)&&u(Object.keys(n),0))}const A=t(w);const q=/{(.*?)}/g;var x=Object.freeze({__proto__:null,createTinyState:function(n){let t;return r(),()=>[t,e,r];function e(n){t=b(n,t)}function r(){e(b(n))}}});var z=Object.freeze({__proto__:null,all:function(...n){return t=>!w(n)&&n.every((n=>b(n,t)))},any:function(...n){return t=>!w(n)&&n.some((n=>b(n,t)))}});n.Predicates=z,n.StateMachine=function(n){let t=n.initial;return{getState:function(){return t},initial:function(){return n.initial},staticTransition:e,transition:function(n,r){return t=e(t,n,r)}};function e(t,e,r){var i,o,u;let c=null!==(o=null===(i=n.states[t])||void 0===i?void 0:i[e])&&void 0!==o?o:null===(u=n.states["*"])||void 0===u?void 0:u[e];if(Array.isArray(c)){const[,n]=c;if(!n(r))return t;c=c[0]}return c&&c!==t?c:t}},n.StringObject=function(n){return new String(b(n))},n.asArray=function(n){return[].concat(n)},n.assign=v,n.bindNot=t,n.bus=_,n.cache=function(n=1){const t=[],e=(r,i)=>{const o=e.get(r);if(o)return o[1];const u=i();return t.unshift([r.concat(),u]),f(t,n)&&(t.length=n),u};return e.invalidate=n=>{const e=r(n);e>-1&&t.splice(e,1)},e.get=n=>t[r(n)]||null,e;function r(n){return t.findIndex((([t])=>u(n,t.length)&&n.every(((n,e)=>n===t[e]))))}},n.callEach=function(n){return n.forEach((n=>n()))},n.defaultTo=function(n,t){var e;return null!==(e=b(n))&&void 0!==e?e:b(t)},n.deferThrow=function(n){setTimeout((()=>{throw new Error(n)}),0)},n.either=function(n,t){return!!n!=!!t},n.freezeAssign=function(...n){return Object.freeze(v(...n))},n.genSeq=j,n.greaterThan=s,n.hasOwnProperty=N,n.invariant=m,n.isArray=S,n.isBoolean=function(n){return!!n===n},n.isEmpty=w,n.isFunction=y,n.isNotArray=T,n.isNotEmpty=A,n.isNotNull=a,n.isNotNullish=p,n.isNotNumeric=r,n.isNotUndefined=d,n.isNull=l,n.isNullish=g,n.isNumeric=e,n.isObject=E,n.isPositive=function(n){return s(n,0)},n.isPromise=function(n){return!!n&&y(n.then)},n.isStringValue=function(n){return String(n)===n},n.isUndefined=h,n.lengthEquals=u,n.lengthNotEquals=c,n.longerThan=f,n.mapFirst=function(n,t){let e=!1,r=null;for(let o=0;o<n.length;o++)if(t(n[o],i,o),e)return r;function i(n,t){n&&(e=!0,r=t)}},n.nonnullish=function(n,t){return m(!g(n),t),n},n.noop=function(){},n.numberEquals=i,n.numberNotEquals=o,n.optionalFunctionValue=b,n.seq=O,n.text=function(n,...t){const e=t[0];if(E(e))return n.replace(q,((n,t)=>{var r;return`${null!==(r=e[t])&&void 0!==r?r:n}`}));const r=[...t];return n.replace(q,(n=>`${w(r)?n:r.shift()}`))},n.tinyState=x}));
//# sourceMappingURL=vest-utils.production.js.map
{
"version": "1.2.13",
"version": "1.2.14-dev-20240617-b233",
"name": "vest-utils",

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

@@ -191,4 +191,5 @@ type DropFirst<T extends unknown[]> = T extends [

}
export { createCache as cache, CacheApi, BusType, TinyState, isNullish, isNotNullish, asArray, callEach, hasOwnProperty, isPromise, optionalFunctionValue, _default as assign, defaultTo, invariant, isStringValue, bindNot, either, isBoolean, deferThrow, bus, seq, genSeq, isFunction, mapFirst, greaterThan, longerThan, isNumeric, isNotNumeric, isObject, lengthEquals, lengthNotEquals, numberEquals, numberNotEquals, isNull, isNotNull, isUndefined, isNotUndefined, isArray, isNotArray, isEmpty, isNotEmpty, isPositive, text, TStateMachine, StateMachine, TStateMachineApi, nonnullish, tinyState, StringObject, noop, Predicates };
declare function freezeAssign<T extends object>(...args: Partial<T>[]): T;
export { createCache as cache, CacheApi, BusType, TinyState, isNullish, isNotNullish, asArray, callEach, hasOwnProperty, isPromise, optionalFunctionValue, _default as assign, defaultTo, invariant, isStringValue, bindNot, either, isBoolean, deferThrow, bus, seq, genSeq, isFunction, mapFirst, greaterThan, longerThan, isNumeric, isNotNumeric, isObject, lengthEquals, lengthNotEquals, numberEquals, numberNotEquals, isNull, isNotNull, isUndefined, isNotUndefined, isArray, isNotArray, isEmpty, isNotEmpty, isPositive, text, TStateMachine, StateMachine, TStateMachineApi, nonnullish, tinyState, StringObject, noop, Predicates, freezeAssign };
export type { DropFirst, Stringable, CB, ValueOf, Nullish, Nullable, Maybe, OneOrMoreOf, DynamicValue, BlankValue, Predicate };
//# sourceMappingURL=vest-utils.d.ts.map

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

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