@zthun/helpful-fn 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var n,t;let
|
|
1
|
+
var n,t;function r(n,t,r,o){if(void 0===r&&(r=0),void 0===o&&(o=Infinity),n=Math.max(0,n),t=Math.max(0,t),Number.isNaN(n)||Number.isNaN(t))return NaN;if(0===t)return r;var e=Infinity===n?1:Math.ceil(t/n);return Math.min(o,Math.max(r,e))}let o;!function(n){n.Top="top",n.Middle="middle",n.Bottom="bottom"}(n||(n={})),function(n){n.Left="left",n.Center="center",n.Right="right"}(t||(t={}));const e=new Uint8Array(16);function i(){if(!o&&(o="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!o))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return o(e)}const u=[];for(let n=0;n<256;++n)u.push((n+256).toString(16).slice(1));var a={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},l=function(n,t,r){if(a.randomUUID&&!t&&!n)return a.randomUUID();const o=(n=n||{}).random||(n.rng||i)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let n=0;n<16;++n)t[r+n]=o[n];return t}return function(n,t=0){return(u[n[t+0]]+u[n[t+1]]+u[n[t+2]]+u[n[t+3]]+"-"+u[n[t+4]]+u[n[t+5]]+"-"+u[n[t+6]]+u[n[t+7]]+"-"+u[n[t+8]]+u[n[t+9]]+"-"+u[n[t+10]]+u[n[t+11]]+u[n[t+12]]+u[n[t+13]]+u[n[t+14]]+u[n[t+15]]).toLowerCase()}(o)};function c(n,t){var r=[].slice.call(arguments,2);if(null!=t)return t;for(var o=0;o<r.length;++o){var e=r[o];if(null!=e)return e}return n}function f(n){return[].slice.call(arguments,1).map(function(n){return n instanceof Array?n[1]?n[0]:null:n}).filter(function(n){return null!=n}).join(n)}var d,m=f.bind(null," "),p=m,s=f.bind(null,","),y=f.bind(null,";"),h=f.bind(null,"|");function v(n,t,r){n(null!=r&&r.length?r[0]:t)}function g(n){return void 0===n&&(n=0),new Promise(function(t){return setTimeout(t,n)})}!function(n){n.Horizontal="horizontal",n.Vertical="vertical"}(d||(d={}));export{t as ZHorizontalAnchor,d as ZOrientation,n as ZVerticalAnchor,s as commaJoinDefined,r as countBuckets,l as createGuid,p as cssJoinDefined,c as firstDefined,f as joinDefined,h as pipeJoinDefined,y as semiColonJoinDefined,v as setFirst,g as sleep,m as spaceJoinDefined};
|
package/dist/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t,n;let r;exports.ZVerticalAnchor=void 0,(t=exports.ZVerticalAnchor||(exports.ZVerticalAnchor={})).Top="top",t.Middle="middle",t.Bottom="bottom",exports.ZHorizontalAnchor=void 0,(n=exports.ZHorizontalAnchor||(exports.ZHorizontalAnchor={})).Left="left",n.Center="center",n.Right="right";const
|
|
1
|
+
var t,n;let r;exports.ZVerticalAnchor=void 0,(t=exports.ZVerticalAnchor||(exports.ZVerticalAnchor={})).Top="top",t.Middle="middle",t.Bottom="bottom",exports.ZHorizontalAnchor=void 0,(n=exports.ZHorizontalAnchor||(exports.ZHorizontalAnchor={})).Left="left",n.Center="center",n.Right="right";const e=new Uint8Array(16);function o(){if(!r&&(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!r))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(e)}const i=[];for(let t=0;t<256;++t)i.push((t+256).toString(16).slice(1));var u={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function a(t){return[].slice.call(arguments,1).map(function(t){return t instanceof Array?t[1]?t[0]:null:t}).filter(function(t){return null!=t}).join(t)}var l,s=a.bind(null," "),c=s,p=a.bind(null,","),d=a.bind(null,";"),f=a.bind(null,"|");exports.ZOrientation=void 0,(l=exports.ZOrientation||(exports.ZOrientation={})).Horizontal="horizontal",l.Vertical="vertical",exports.commaJoinDefined=p,exports.countBuckets=function(t,n,r,e){if(void 0===r&&(r=0),void 0===e&&(e=Infinity),t=Math.max(0,t),n=Math.max(0,n),Number.isNaN(t)||Number.isNaN(n))return NaN;if(0===n)return r;var o=Infinity===t?1:Math.ceil(n/t);return Math.min(e,Math.max(r,o))},exports.createGuid=function(t,n,r){if(u.randomUUID&&!n&&!t)return u.randomUUID();const e=(t=t||{}).random||(t.rng||o)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,n){r=r||0;for(let t=0;t<16;++t)n[r+t]=e[t];return n}return function(t,n=0){return(i[t[n+0]]+i[t[n+1]]+i[t[n+2]]+i[t[n+3]]+"-"+i[t[n+4]]+i[t[n+5]]+"-"+i[t[n+6]]+i[t[n+7]]+"-"+i[t[n+8]]+i[t[n+9]]+"-"+i[t[n+10]]+i[t[n+11]]+i[t[n+12]]+i[t[n+13]]+i[t[n+14]]+i[t[n+15]]).toLowerCase()}(e)},exports.cssJoinDefined=c,exports.firstDefined=function(t,n){var r=[].slice.call(arguments,2);if(null!=n)return n;for(var e=0;e<r.length;++e){var o=r[e];if(null!=o)return o}return t},exports.joinDefined=a,exports.pipeJoinDefined=f,exports.semiColonJoinDefined=d,exports.setFirst=function(t,n,r){t(null!=r&&r.length?r[0]:n)},exports.sleep=function(t){return void 0===t&&(t=0),new Promise(function(n){return setTimeout(n,t)})},exports.spaceJoinDefined=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function countBuckets(weight: number, items: number, min?: number, max?: number): number;
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zthun/helpful-fn",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Helpful, isolated pure functions that are not found in other libraries such as lodash.",
|
|
5
5
|
"author": "Anthony Bonta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"dist"
|
|
29
29
|
],
|
|
30
30
|
"sideEffects": false,
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "11dcfaa4311e4d9b1a13fdb03d53e7d01c9cc47c"
|
|
32
32
|
}
|