@choksheak/ts-utils 0.2.9 → 0.3.1
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/README.md +2 -0
- package/{arrayBuffer.js → arrayBuffer.cjs} +0 -1
- package/arrayBuffer.d.mts +10 -0
- package/arrayBuffer.d.ts +4 -2
- package/arrayBuffer.min.cjs +2 -0
- package/arrayBuffer.min.cjs.map +1 -0
- package/arrayBuffer.min.mjs +2 -0
- package/{arrayBuffer.js.map → arrayBuffer.min.mjs.map} +1 -1
- package/arrayBuffer.mjs +14 -0
- package/{assert.js → assert.cjs} +0 -1
- package/assert.d.mts +7 -0
- package/assert.d.ts +3 -1
- package/assert.min.cjs +2 -0
- package/assert.min.cjs.map +1 -0
- package/assert.min.mjs +2 -0
- package/{assert.js.map → assert.min.mjs.map} +1 -1
- package/assert.mjs +11 -0
- package/{average.js → average.cjs} +0 -1
- package/average.d.mts +7 -0
- package/average.d.ts +3 -1
- package/average.min.cjs +2 -0
- package/{average.js.map → average.min.cjs.map} +1 -1
- package/average.min.mjs +2 -0
- package/average.min.mjs.map +1 -0
- package/average.mjs +20 -0
- package/{base64Url.js → base64Url.cjs} +0 -1
- package/base64Url.d.mts +10 -0
- package/base64Url.d.ts +4 -2
- package/base64Url.min.cjs +2 -0
- package/base64Url.min.cjs.map +1 -0
- package/base64Url.min.mjs +2 -0
- package/{base64Url.js.map → base64Url.min.mjs.map} +1 -1
- package/base64Url.mjs +14 -0
- package/{dateTimeStr.js → dateTimeStr.cjs} +0 -1
- package/dateTimeStr.d.mts +85 -0
- package/dateTimeStr.d.ts +15 -13
- package/dateTimeStr.min.cjs +2 -0
- package/dateTimeStr.min.cjs.map +1 -0
- package/dateTimeStr.min.mjs +2 -0
- package/{dateTimeStr.js.map → dateTimeStr.min.mjs.map} +1 -1
- package/dateTimeStr.mjs +83 -0
- package/{duration.js → duration.cjs} +9 -11
- package/duration.d.mts +78 -0
- package/duration.d.ts +15 -13
- package/duration.min.cjs +2 -0
- package/duration.min.cjs.map +1 -0
- package/duration.min.mjs +2 -0
- package/duration.min.mjs.map +1 -0
- package/duration.mjs +154 -0
- package/{isEmpty.js → isEmpty.cjs} +0 -1
- package/isEmpty.d.mts +6 -0
- package/isEmpty.d.ts +3 -1
- package/isEmpty.min.cjs +2 -0
- package/isEmpty.min.cjs.map +1 -0
- package/isEmpty.min.mjs +2 -0
- package/{isEmpty.js.map → isEmpty.min.mjs.map} +1 -1
- package/isEmpty.mjs +22 -0
- package/iterators.cjs +34 -0
- package/iterators.d.mts +4 -0
- package/iterators.d.ts +4 -0
- package/iterators.min.cjs +2 -0
- package/iterators.min.cjs.map +1 -0
- package/iterators.min.mjs +2 -0
- package/iterators.min.mjs.map +1 -0
- package/iterators.mjs +9 -0
- package/kvStore.cjs +365 -0
- package/kvStore.d.mts +139 -0
- package/kvStore.d.ts +95 -50
- package/kvStore.min.cjs +2 -0
- package/kvStore.min.cjs.map +1 -0
- package/kvStore.min.mjs +2 -0
- package/kvStore.min.mjs.map +1 -0
- package/kvStore.mjs +333 -0
- package/localStore.cjs +267 -0
- package/localStore.d.mts +119 -0
- package/localStore.d.ts +119 -0
- package/localStore.min.cjs +2 -0
- package/localStore.min.cjs.map +1 -0
- package/localStore.min.mjs +2 -0
- package/localStore.min.mjs.map +1 -0
- package/localStore.mjs +235 -0
- package/{logging.js → logging.cjs} +0 -1
- package/logging.d.mts +4 -0
- package/logging.d.ts +4 -2
- package/logging.min.cjs +2 -0
- package/logging.min.cjs.map +1 -0
- package/logging.min.mjs +2 -0
- package/{logging.js.map → logging.min.mjs.map} +1 -1
- package/logging.mjs +21 -0
- package/{nonEmpty.js → nonEmpty.cjs} +0 -1
- package/nonEmpty.d.mts +10 -0
- package/nonEmpty.d.ts +3 -1
- package/nonEmpty.min.cjs +2 -0
- package/{nonEmpty.js.map → nonEmpty.min.cjs.map} +1 -1
- package/nonEmpty.min.mjs +2 -0
- package/nonEmpty.min.mjs.map +1 -0
- package/nonEmpty.mjs +30 -0
- package/{nonNil.js → nonNil.cjs} +0 -1
- package/{src/nonNil.ts → nonNil.d.mts} +3 -6
- package/nonNil.d.ts +3 -1
- package/nonNil.min.cjs +2 -0
- package/nonNil.min.cjs.map +1 -0
- package/nonNil.min.mjs +2 -0
- package/{nonNil.js.map → nonNil.min.mjs.map} +1 -1
- package/nonNil.mjs +10 -0
- package/package.json +447 -24
- package/{round.js → round.cjs} +0 -1
- package/{src/round.ts → round.d.mts} +4 -8
- package/round.d.ts +4 -2
- package/round.min.cjs +2 -0
- package/round.min.cjs.map +1 -0
- package/round.min.mjs +2 -0
- package/{round.js.map → round.min.mjs.map} +1 -1
- package/round.mjs +12 -0
- package/{safeBtoa.js → safeBtoa.cjs} +0 -1
- package/safeBtoa.d.mts +6 -0
- package/safeBtoa.d.ts +3 -1
- package/safeBtoa.min.cjs +2 -0
- package/safeBtoa.min.cjs.map +1 -0
- package/safeBtoa.min.mjs +2 -0
- package/{safeBtoa.js.map → safeBtoa.min.mjs.map} +1 -1
- package/safeBtoa.mjs +9 -0
- package/{safeParseFloat.js → safeParseFloat.cjs} +0 -1
- package/safeParseFloat.d.mts +6 -0
- package/safeParseFloat.d.ts +3 -1
- package/safeParseFloat.min.cjs +2 -0
- package/safeParseFloat.min.cjs.map +1 -0
- package/safeParseFloat.min.mjs +2 -0
- package/{safeParseFloat.js.map → safeParseFloat.min.mjs.map} +1 -1
- package/safeParseFloat.mjs +8 -0
- package/{safeParseInt.js → safeParseInt.cjs} +0 -1
- package/safeParseInt.d.mts +6 -0
- package/safeParseInt.d.ts +3 -1
- package/safeParseInt.min.cjs +2 -0
- package/safeParseInt.min.cjs.map +1 -0
- package/safeParseInt.min.mjs +2 -0
- package/{safeParseInt.js.map → safeParseInt.min.mjs.map} +1 -1
- package/safeParseInt.mjs +8 -0
- package/sha256.cjs +35 -0
- package/sha256.d.mts +6 -0
- package/sha256.d.ts +3 -1
- package/sha256.min.cjs +2 -0
- package/sha256.min.cjs.map +1 -0
- package/sha256.min.mjs +2 -0
- package/{sha256.js.map → sha256.min.mjs.map} +1 -1
- package/sha256.mjs +10 -0
- package/{sleep.js → sleep.cjs} +0 -1
- package/{src/sleep.ts → sleep.d.mts} +3 -3
- package/sleep.d.ts +3 -1
- package/sleep.min.cjs +2 -0
- package/sleep.min.cjs.map +1 -0
- package/sleep.min.mjs +2 -0
- package/{sleep.js.map → sleep.min.mjs.map} +1 -1
- package/sleep.mjs +7 -0
- package/storageAdapter.cjs +18 -0
- package/storageAdapter.d.mts +33 -0
- package/storageAdapter.d.ts +33 -0
- package/storageAdapter.min.cjs +2 -0
- package/storageAdapter.min.cjs.map +1 -0
- package/storageAdapter.min.mjs +1 -0
- package/storageAdapter.min.mjs.map +1 -0
- package/storageAdapter.mjs +0 -0
- package/{sum.js → sum.cjs} +0 -1
- package/sum.d.mts +7 -0
- package/sum.d.ts +3 -1
- package/sum.min.cjs +2 -0
- package/sum.min.cjs.map +1 -0
- package/sum.min.mjs +2 -0
- package/{sum.js.map → sum.min.mjs.map} +1 -1
- package/sum.mjs +13 -0
- package/{timeConstants.js → timeConstants.cjs} +0 -1
- package/timeConstants.d.mts +20 -0
- package/timeConstants.d.ts +16 -14
- package/timeConstants.min.cjs +2 -0
- package/timeConstants.min.cjs.map +1 -0
- package/timeConstants.min.mjs +2 -0
- package/{timeConstants.js.map → timeConstants.min.mjs.map} +1 -1
- package/timeConstants.mjs +31 -0
- package/{timer.js → timer.cjs} +6 -6
- package/timer.d.mts +13 -0
- package/timer.d.ts +4 -2
- package/timer.min.cjs +2 -0
- package/timer.min.cjs.map +1 -0
- package/timer.min.mjs +2 -0
- package/timer.min.mjs.map +1 -0
- package/timer.mjs +161 -0
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -22
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1640
- package/docs/classes/kvStore.KVStore.html +0 -26
- package/docs/classes/kvStore.KVStoreField.html +0 -7
- package/docs/classes/timer.Timer.html +0 -8
- package/docs/functions/arrayBuffer.arrayBufferToBase64.html +0 -2
- package/docs/functions/arrayBuffer.arrayBufferToHex.html +0 -2
- package/docs/functions/assert.assert.html +0 -3
- package/docs/functions/average.average.html +0 -3
- package/docs/functions/base64Url.base64ToBase64URL.html +0 -2
- package/docs/functions/base64Url.base64UrlToBase64.html +0 -2
- package/docs/functions/dateTimeStr.getDisplayDateTime.html +0 -3
- package/docs/functions/dateTimeStr.getLongMonthNameOneIndexed.html +0 -4
- package/docs/functions/dateTimeStr.getLongMonthNameZeroIndexed.html +0 -4
- package/docs/functions/dateTimeStr.getShortMonthNameOneIndexed.html +0 -4
- package/docs/functions/dateTimeStr.getShortMonthNameZeroIndexed.html +0 -4
- package/docs/functions/dateTimeStr.hhMm.html +0 -4
- package/docs/functions/dateTimeStr.hhMmSs.html +0 -4
- package/docs/functions/dateTimeStr.hhMmSsMs.html +0 -5
- package/docs/functions/dateTimeStr.toDate.html +0 -4
- package/docs/functions/dateTimeStr.tzShort.html +0 -4
- package/docs/functions/dateTimeStr.yyyyMm.html +0 -4
- package/docs/functions/dateTimeStr.yyyyMmDd.html +0 -4
- package/docs/functions/duration.durationOrMsToMs.html +0 -2
- package/docs/functions/duration.durationToMs.html +0 -2
- package/docs/functions/duration.elapsed.html +0 -2
- package/docs/functions/duration.formatDuration.html +0 -4
- package/docs/functions/duration.msToDuration.html +0 -5
- package/docs/functions/duration.readableDuration.html +0 -4
- package/docs/functions/isEmpty.isEmpty.html +0 -2
- package/docs/functions/kvStore.kvStoreItem.html +0 -2
- package/docs/functions/localStorageCache.storeItem.html +0 -15
- package/docs/functions/logging.capLength.html +0 -1
- package/docs/functions/logging.stringify.html +0 -1
- package/docs/functions/nonEmpty.nonEmpty.html +0 -5
- package/docs/functions/nonNil.nonNil.html +0 -5
- package/docs/functions/round.round.html +0 -5
- package/docs/functions/round.roundS.html +0 -3
- package/docs/functions/safeBtoa.safeBtoa.html +0 -2
- package/docs/functions/safeParseFloat.safeParseFloat.html +0 -2
- package/docs/functions/safeParseInt.safeParseInt.html +0 -2
- package/docs/functions/sha256.sha256.html +0 -2
- package/docs/functions/sleep.sleep.html +0 -3
- package/docs/functions/sum.sum.html +0 -3
- package/docs/functions/timer.timer.html +0 -2
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -4
- package/docs/modules/arrayBuffer.html +0 -1
- package/docs/modules/assert.html +0 -1
- package/docs/modules/average.html +0 -1
- package/docs/modules/base64Url.html +0 -1
- package/docs/modules/dateTimeStr.html +0 -1
- package/docs/modules/duration.html +0 -1
- package/docs/modules/isEmpty.html +0 -1
- package/docs/modules/kvStore.html +0 -1
- package/docs/modules/localStorageCache.html +0 -1
- package/docs/modules/logging.html +0 -1
- package/docs/modules/nonEmpty.html +0 -1
- package/docs/modules/nonNil.html +0 -1
- package/docs/modules/round.html +0 -1
- package/docs/modules/safeBtoa.html +0 -1
- package/docs/modules/safeParseFloat.html +0 -1
- package/docs/modules/safeParseInt.html +0 -1
- package/docs/modules/sha256.html +0 -1
- package/docs/modules/sleep.html +0 -1
- package/docs/modules/sum.html +0 -1
- package/docs/modules/timeConstants.html +0 -1
- package/docs/modules/timer.html +0 -1
- package/docs/modules.html +0 -1
- package/docs/types/dateTimeStr.AnyDateTime.html +0 -1
- package/docs/types/duration.Duration.html +0 -6
- package/docs/types/duration.DurationStyle.html +0 -6
- package/docs/types/duration.DurationSuffixMap.html +0 -6
- package/docs/types/duration.DurationSuffixType.html +0 -1
- package/docs/types/duration.DurationType.html +0 -2
- package/docs/types/localStorageCache.StoredItem.html +0 -4
- package/docs/variables/duration.DURATION_STYLE_SUFFIX_MAP.html +0 -1
- package/docs/variables/duration.DURATION_TYPE_SEQUENCE.html +0 -2
- package/docs/variables/kvStore.DEFAULT_EXPIRY_DELTA_MS.html +0 -2
- package/docs/variables/kvStore.GC_INTERVAL_MS.html +0 -2
- package/docs/variables/kvStore.MILLIS_PER_DAY.html +0 -2
- package/docs/variables/kvStore.kvStore.html +0 -3
- package/docs/variables/timeConstants.HOURS_PER_DAY.html +0 -1
- package/docs/variables/timeConstants.HOURS_PER_WEEK.html +0 -1
- package/docs/variables/timeConstants.MINUTES_PER_DAY.html +0 -1
- package/docs/variables/timeConstants.MINUTES_PER_HOUR.html +0 -1
- package/docs/variables/timeConstants.MINUTES_PER_WEEK.html +0 -1
- package/docs/variables/timeConstants.MS_PER_DAY.html +0 -1
- package/docs/variables/timeConstants.MS_PER_HOUR.html +0 -1
- package/docs/variables/timeConstants.MS_PER_MINUTE.html +0 -1
- package/docs/variables/timeConstants.MS_PER_SECOND.html +0 -3
- package/docs/variables/timeConstants.MS_PER_WEEK.html +0 -1
- package/docs/variables/timeConstants.SECONDS_PER_DAY.html +0 -1
- package/docs/variables/timeConstants.SECONDS_PER_HOUR.html +0 -1
- package/docs/variables/timeConstants.SECONDS_PER_MINUTE.html +0 -1
- package/docs/variables/timeConstants.SECONDS_PER_WEEK.html +0 -1
- package/duration.js.map +0 -1
- package/kvStore.js +0 -383
- package/kvStore.js.map +0 -1
- package/localStorageCache.d.ts +0 -55
- package/localStorageCache.js +0 -121
- package/localStorageCache.js.map +0 -1
- package/sha256.js +0 -58
- package/src/arrayBuffer.ts +0 -29
- package/src/assert.ts +0 -14
- package/src/average.ts +0 -13
- package/src/base64Url.ts +0 -20
- package/src/dateTimeStr.ts +0 -184
- package/src/duration.ts +0 -260
- package/src/isEmpty.ts +0 -32
- package/src/kvStore.ts +0 -444
- package/src/localStorageCache.ts +0 -121
- package/src/logging.ts +0 -26
- package/src/nonEmpty.ts +0 -18
- package/src/safeBtoa.ts +0 -15
- package/src/safeParseFloat.ts +0 -10
- package/src/safeParseInt.ts +0 -10
- package/src/sha256.ts +0 -13
- package/src/sum.ts +0 -17
- package/src/timeConstants.ts +0 -22
- package/src/timer.ts +0 -33
- package/timer.js.map +0 -1
package/logging.mjs
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/logging.ts
|
|
2
|
+
function stringify(u) {
|
|
3
|
+
if (typeof u === "string") {
|
|
4
|
+
return u;
|
|
5
|
+
}
|
|
6
|
+
if (u !== null && typeof u === "object" && u.toString !== Object.prototype.toString) {
|
|
7
|
+
return u.toString();
|
|
8
|
+
}
|
|
9
|
+
return JSON.stringify(u);
|
|
10
|
+
}
|
|
11
|
+
function capLength(u, maxLength = 400) {
|
|
12
|
+
const s = stringify(u);
|
|
13
|
+
if (s.length <= maxLength) {
|
|
14
|
+
return s;
|
|
15
|
+
}
|
|
16
|
+
return s.slice(0, maxLength) + ` ... (${s.length - maxLength} more)`;
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
capLength,
|
|
20
|
+
stringify
|
|
21
|
+
};
|
package/nonEmpty.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type asserts that `t` is truthy.
|
|
3
|
+
* Throws an error if `t` is null or undefined.
|
|
4
|
+
*
|
|
5
|
+
* @param varName The variable name to include in the error to throw when t is
|
|
6
|
+
* empty. Defaults to 'value'.
|
|
7
|
+
*/
|
|
8
|
+
declare function nonEmpty<T>(t: T | null | undefined | "" | 0 | -0 | 0n | false | typeof NaN, varName?: string): T;
|
|
9
|
+
|
|
10
|
+
export { nonEmpty };
|
package/nonEmpty.d.ts
CHANGED
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
* @param varName The variable name to include in the error to throw when t is
|
|
6
6
|
* empty. Defaults to 'value'.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare function nonEmpty<T>(t: T | null | undefined | "" | 0 | -0 | 0n | false | typeof NaN, varName?: string): T;
|
|
9
|
+
|
|
10
|
+
export { nonEmpty };
|
package/nonEmpty.min.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var s=(n,e)=>{for(var o in e)t(n,o,{get:e[o],enumerable:!0})},a=(n,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of l(e))!p.call(n,r)&&r!==o&&t(n,r,{get:()=>e[r],enumerable:!(i=u(e,r))||i.enumerable});return n};var m=n=>a(t({},"__esModule",{value:!0}),n);var E={};s(E,{nonEmpty:()=>y});module.exports=m(E);function f(n){if(!n)return!0;if(typeof n!="object")return!1;if("length"in n)return n.length===0;if("size"in n)return n.size===0;for(let e in n)return!1;return!0}function y(n,e="value"){if(f(n))throw new Error(`Empty ${e}: ${n}`);return n}0&&(module.exports={nonEmpty});
|
|
2
|
+
//# sourceMappingURL=nonEmpty.min.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/nonEmpty.ts","../src/isEmpty.ts"],"sourcesContent":["import { isEmpty } from \"./isEmpty\";\n\n/**\n * Type asserts that `t` is truthy.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * empty. Defaults to 'value'.\n */\nexport function nonEmpty<T>(\n t: T | null | undefined | \"\" | 0 | -0 | 0n | false | typeof NaN,\n varName = \"value\",\n): T {\n if (isEmpty(t)) {\n throw new Error(`Empty ${varName}: ${t}`);\n }\n return t as T;\n}\n","/**\n * Returns true if `t` is empty.\n */\nexport function isEmpty(t: unknown): boolean {\n // Anything falsy is considered empty.\n if (!t) {\n return true;\n }\n\n // Arrays are also of type `object`.\n if (typeof t !== \"object\") {\n return false;\n }\n\n // `length` includes arrays as well.\n if (\"length\" in t) {\n return t.length === 0;\n }\n\n // `size` is for Set, Map, Blob etc.\n if (\"size\" in t) {\n return t.size === 0;\n }\n\n // Super fast check for object emptiness.\n // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object\n for (const k in t) {\n return false;\n }\n\n return true;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/nonEmpty.ts","../src/isEmpty.ts"],"sourcesContent":["import { isEmpty } from \"./isEmpty\";\n\n/**\n * Type asserts that `t` is truthy.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * empty. Defaults to 'value'.\n */\nexport function nonEmpty<T>(\n t: T | null | undefined | \"\" | 0 | -0 | 0n | false | typeof NaN,\n varName = \"value\",\n): T {\n if (isEmpty(t)) {\n throw new Error(`Empty ${varName}: ${t}`);\n }\n return t as T;\n}\n","/**\n * Returns true if `t` is empty.\n */\nexport function isEmpty(t: unknown): boolean {\n // Anything falsy is considered empty.\n if (!t) {\n return true;\n }\n\n // Arrays are also of type `object`.\n if (typeof t !== \"object\") {\n return false;\n }\n\n // `length` includes arrays as well.\n if (\"length\" in t) {\n return t.length === 0;\n }\n\n // `size` is for Set, Map, Blob etc.\n if (\"size\" in t) {\n return t.size === 0;\n }\n\n // Super fast check for object emptiness.\n // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object\n for (const k in t) {\n return false;\n }\n\n return true;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GCGO,SAASI,EAAQC,EAAqB,CAE3C,GAAI,CAACA,EACH,MAAO,GAIT,GAAI,OAAOA,GAAM,SACf,MAAO,GAIT,GAAI,WAAYA,EACd,OAAOA,EAAE,SAAW,EAItB,GAAI,SAAUA,EACZ,OAAOA,EAAE,OAAS,EAKpB,QAAWC,KAAKD,EACd,MAAO,GAGT,MAAO,EACT,CDtBO,SAASE,EACdC,EACAC,EAAU,QACP,CACH,GAAIC,EAAQF,CAAC,EACX,MAAM,IAAI,MAAM,SAASC,CAAO,KAAKD,CAAC,EAAE,EAE1C,OAAOA,CACT","names":["nonEmpty_exports","__export","nonEmpty","__toCommonJS","isEmpty","t","k","nonEmpty","t","varName","isEmpty"]}
|
package/nonEmpty.min.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function r(n){if(!n)return!0;if(typeof n!="object")return!1;if("length"in n)return n.length===0;if("size"in n)return n.size===0;for(let e in n)return!1;return!0}function i(n,e="value"){if(r(n))throw new Error(`Empty ${e}: ${n}`);return n}export{i as nonEmpty};
|
|
2
|
+
//# sourceMappingURL=nonEmpty.min.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/isEmpty.ts","../src/nonEmpty.ts"],"sourcesContent":["/**\n * Returns true if `t` is empty.\n */\nexport function isEmpty(t: unknown): boolean {\n // Anything falsy is considered empty.\n if (!t) {\n return true;\n }\n\n // Arrays are also of type `object`.\n if (typeof t !== \"object\") {\n return false;\n }\n\n // `length` includes arrays as well.\n if (\"length\" in t) {\n return t.length === 0;\n }\n\n // `size` is for Set, Map, Blob etc.\n if (\"size\" in t) {\n return t.size === 0;\n }\n\n // Super fast check for object emptiness.\n // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object\n for (const k in t) {\n return false;\n }\n\n return true;\n}\n","import { isEmpty } from \"./isEmpty\";\n\n/**\n * Type asserts that `t` is truthy.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * empty. Defaults to 'value'.\n */\nexport function nonEmpty<T>(\n t: T | null | undefined | \"\" | 0 | -0 | 0n | false | typeof NaN,\n varName = \"value\",\n): T {\n if (isEmpty(t)) {\n throw new Error(`Empty ${varName}: ${t}`);\n }\n return t as T;\n}\n"],"mappings":"AAGO,SAASA,EAAQC,EAAqB,CAE3C,GAAI,CAACA,EACH,MAAO,GAIT,GAAI,OAAOA,GAAM,SACf,MAAO,GAIT,GAAI,WAAYA,EACd,OAAOA,EAAE,SAAW,EAItB,GAAI,SAAUA,EACZ,OAAOA,EAAE,OAAS,EAKpB,QAAWC,KAAKD,EACd,MAAO,GAGT,MAAO,EACT,CCtBO,SAASE,EACdC,EACAC,EAAU,QACP,CACH,GAAIC,EAAQF,CAAC,EACX,MAAM,IAAI,MAAM,SAASC,CAAO,KAAKD,CAAC,EAAE,EAE1C,OAAOA,CACT","names":["isEmpty","t","k","nonEmpty","t","varName","isEmpty"]}
|
package/nonEmpty.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/isEmpty.ts
|
|
2
|
+
function isEmpty(t) {
|
|
3
|
+
if (!t) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
if (typeof t !== "object") {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if ("length" in t) {
|
|
10
|
+
return t.length === 0;
|
|
11
|
+
}
|
|
12
|
+
if ("size" in t) {
|
|
13
|
+
return t.size === 0;
|
|
14
|
+
}
|
|
15
|
+
for (const k in t) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// src/nonEmpty.ts
|
|
22
|
+
function nonEmpty(t, varName = "value") {
|
|
23
|
+
if (isEmpty(t)) {
|
|
24
|
+
throw new Error(`Empty ${varName}: ${t}`);
|
|
25
|
+
}
|
|
26
|
+
return t;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
nonEmpty
|
|
30
|
+
};
|
package/{nonNil.js → nonNil.cjs}
RENAMED
|
@@ -5,9 +5,6 @@
|
|
|
5
5
|
* @param varName The variable name to include in the error to throw when t is
|
|
6
6
|
* nil. Defaults to 'value'.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
return t;
|
|
13
|
-
}
|
|
8
|
+
declare function nonNil<T>(t: T | null | undefined, varName?: string): T;
|
|
9
|
+
|
|
10
|
+
export { nonNil };
|
package/nonNil.d.ts
CHANGED
|
@@ -5,4 +5,6 @@
|
|
|
5
5
|
* @param varName The variable name to include in the error to throw when t is
|
|
6
6
|
* nil. Defaults to 'value'.
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
declare function nonNil<T>(t: T | null | undefined, varName?: string): T;
|
|
9
|
+
|
|
10
|
+
export { nonNil };
|
package/nonNil.min.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var T=(n,e)=>{for(var r in e)u(n,r,{get:e[r],enumerable:!0})},s=(n,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of d(e))!f.call(n,i)&&i!==r&&u(n,i,{get:()=>e[i],enumerable:!(l=o(e,i))||l.enumerable});return n};var w=n=>s(u({},"__esModule",{value:!0}),n);var a={};T(a,{nonNil:()=>$});module.exports=w(a);function $(n,e="value"){if(n==null)throw new Error(`Missing ${e}: ${n}`);return n}0&&(module.exports={nonNil});
|
|
2
|
+
//# sourceMappingURL=nonNil.min.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/nonNil.ts"],"sourcesContent":["/**\n * Type asserts that `t` is neither null nor undefined.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * nil. Defaults to 'value'.\n */\nexport function nonNil<T>(t: T | null | undefined, varName = \"value\"): T {\n if (t === null || t === undefined) {\n throw new Error(`Missing ${varName}: ${t}`);\n }\n return t;\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GAOO,SAASE,EAAUE,EAAyBC,EAAU,QAAY,CACvE,GAAID,GAAM,KACR,MAAM,IAAI,MAAM,WAAWC,CAAO,KAAKD,CAAC,EAAE,EAE5C,OAAOA,CACT","names":["nonNil_exports","__export","nonNil","__toCommonJS","t","varName"]}
|
package/nonNil.min.mjs
ADDED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/nonNil.ts"],"sourcesContent":["/**\n * Type asserts that `t` is neither null nor undefined.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * nil. Defaults to 'value'.\n */\nexport function nonNil<T>(t: T | null | undefined, varName = \"value\"): T {\n if (t === null || t === undefined) {\n throw new Error(`Missing ${varName}: ${t}`);\n }\n return t;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/nonNil.ts"],"sourcesContent":["/**\n * Type asserts that `t` is neither null nor undefined.\n * Throws an error if `t` is null or undefined.\n *\n * @param varName The variable name to include in the error to throw when t is\n * nil. Defaults to 'value'.\n */\nexport function nonNil<T>(t: T | null | undefined, varName = \"value\"): T {\n if (t === null || t === undefined) {\n throw new Error(`Missing ${varName}: ${t}`);\n }\n return t;\n}\n"],"mappings":"AAOO,SAASA,EAAUC,EAAyBC,EAAU,QAAY,CACvE,GAAID,GAAM,KACR,MAAM,IAAI,MAAM,WAAWC,CAAO,KAAKD,CAAC,EAAE,EAE5C,OAAOA,CACT","names":["nonNil","t","varName"]}
|
package/nonNil.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,38 +1,461 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choksheak/ts-utils",
|
|
3
3
|
"license": "The Unlicense",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.1",
|
|
5
5
|
"description": "Random Typescript utilities with support for full tree-shaking",
|
|
6
6
|
"private": false,
|
|
7
7
|
"scripts": {
|
|
8
|
-
"lint": "eslint
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
8
|
+
"lint": "eslint .",
|
|
9
|
+
"fix": "eslint . --fix",
|
|
10
|
+
"tsc": "npx tsc",
|
|
11
|
+
"ft": "npm run fix && npm run tsc",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"ci": "npm run lint && npm run tsc && npm run build && npm run test",
|
|
15
|
+
"ls": "lint-staged",
|
|
16
|
+
"docs": "rm -rf docs && typedoc `find src -name '*.ts' ! -name '*.test.ts'` --out docs --name 'Chok’s Typescript Utilities'",
|
|
12
17
|
"clean": "rm -rf dist",
|
|
13
|
-
"ci": "npm run lint && npm run format && npm run test",
|
|
14
18
|
"build": "tsup src/*",
|
|
15
19
|
"gen-types": "tsc --emitDeclarationOnly --declaration",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
20
|
+
"gen-exports": "tsx scripts/gen-exports.ts",
|
|
21
|
+
"bump": "tsx scripts/bump-version.ts",
|
|
22
|
+
"bump:patch": "tsx scripts/bump-version.ts --patch",
|
|
23
|
+
"bump:minor": "tsx scripts/bump-version.ts --minor",
|
|
24
|
+
"bump:major": "tsx scripts/bump-version.ts --major",
|
|
25
|
+
"pkg": "scripts/package.sh",
|
|
26
|
+
"pub": "npm publish dist/ --access=public",
|
|
27
|
+
"commit": "scripts/commit-release.sh",
|
|
28
|
+
"release": "npm run ci && npm run bump && npm i && npm run pkg && npm run pub && npm run commit",
|
|
29
|
+
"postinstall": "simple-git-hooks"
|
|
30
|
+
},
|
|
31
|
+
"simple-git-hooks": {
|
|
32
|
+
"pre-commit": "npx lint-staged"
|
|
33
|
+
},
|
|
34
|
+
"lint-staged": {
|
|
35
|
+
"*.{ts,tsx,js,jsx}": [
|
|
36
|
+
"echo Using `eslint --fix` will revert changes without printing errors!",
|
|
37
|
+
"npm run lint"
|
|
38
|
+
],
|
|
39
|
+
"*.{ts,tsx}": [
|
|
40
|
+
"echo `tsc-files --noEmit` cannot read *.module.css files",
|
|
41
|
+
"bash -c 'npx tsc'"
|
|
42
|
+
]
|
|
18
43
|
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/choksheak/ts-utils.git"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"chok",
|
|
50
|
+
"TS",
|
|
51
|
+
"utils",
|
|
52
|
+
"typescript",
|
|
53
|
+
"library"
|
|
54
|
+
],
|
|
55
|
+
"author": "ChokSheak Lau",
|
|
56
|
+
"type": "commonjs",
|
|
57
|
+
"homepage": "https://github.com/choksheak/ts-utils#readme",
|
|
19
58
|
"devDependencies": {
|
|
20
|
-
"@eslint/
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@types/
|
|
24
|
-
"eslint": "^
|
|
59
|
+
"@eslint/compat": "^1.4.0",
|
|
60
|
+
"@eslint/js": "^9.38.0",
|
|
61
|
+
"@swc/core": "^1.14.0",
|
|
62
|
+
"@types/jest": "^30.0.0",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
|
64
|
+
"@typescript-eslint/parser": "^8.46.2",
|
|
65
|
+
"eslint": "^9.38.0",
|
|
66
|
+
"eslint-config": "^0.3.0",
|
|
67
|
+
"eslint-config-prettier": "^10.1.8",
|
|
68
|
+
"eslint-plugin-import": "^2.32.0",
|
|
69
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
70
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
25
71
|
"fake-indexeddb": "^6.0.0",
|
|
26
|
-
"globals": "^
|
|
27
|
-
"jest": "^29.7.0",
|
|
72
|
+
"globals": "^16.4.0",
|
|
28
73
|
"jest-environment-jsdom": "^29.7.0",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
74
|
+
"jiti": "^2.6.1",
|
|
75
|
+
"lint-staged": "^16.2.6",
|
|
76
|
+
"mock-local-storage": "^1.1.24",
|
|
77
|
+
"prettier": "^3.6.2",
|
|
78
|
+
"simple-git-hooks": "^2.13.1",
|
|
79
|
+
"tsup": "^8.5.0",
|
|
80
|
+
"tsx": "^4.20.6",
|
|
81
|
+
"typedoc": "^0.28.14",
|
|
82
|
+
"typescript": "^5.9.3",
|
|
83
|
+
"typescript-eslint": "^8.46.2",
|
|
84
|
+
"vitest": "^4.0.3"
|
|
85
|
+
},
|
|
86
|
+
"exports": {
|
|
87
|
+
"./package.json": "./package.json",
|
|
88
|
+
"./arrayBuffer": {
|
|
89
|
+
"types": "./arrayBuffer.d.ts",
|
|
90
|
+
"import": {
|
|
91
|
+
"production": "./arrayBuffer.min.mjs",
|
|
92
|
+
"development": "./arrayBuffer.mjs",
|
|
93
|
+
"default": "./arrayBuffer.mjs"
|
|
94
|
+
},
|
|
95
|
+
"require": {
|
|
96
|
+
"production": "./arrayBuffer.min.cjs",
|
|
97
|
+
"development": "./arrayBuffer.cjs",
|
|
98
|
+
"default": "./arrayBuffer.cjs"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"./assert": {
|
|
102
|
+
"types": "./assert.d.ts",
|
|
103
|
+
"import": {
|
|
104
|
+
"production": "./assert.min.mjs",
|
|
105
|
+
"development": "./assert.mjs",
|
|
106
|
+
"default": "./assert.mjs"
|
|
107
|
+
},
|
|
108
|
+
"require": {
|
|
109
|
+
"production": "./assert.min.cjs",
|
|
110
|
+
"development": "./assert.cjs",
|
|
111
|
+
"default": "./assert.cjs"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"./average": {
|
|
115
|
+
"types": "./average.d.ts",
|
|
116
|
+
"import": {
|
|
117
|
+
"production": "./average.min.mjs",
|
|
118
|
+
"development": "./average.mjs",
|
|
119
|
+
"default": "./average.mjs"
|
|
120
|
+
},
|
|
121
|
+
"require": {
|
|
122
|
+
"production": "./average.min.cjs",
|
|
123
|
+
"development": "./average.cjs",
|
|
124
|
+
"default": "./average.cjs"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"./base64Url": {
|
|
128
|
+
"types": "./base64Url.d.ts",
|
|
129
|
+
"import": {
|
|
130
|
+
"production": "./base64Url.min.mjs",
|
|
131
|
+
"development": "./base64Url.mjs",
|
|
132
|
+
"default": "./base64Url.mjs"
|
|
133
|
+
},
|
|
134
|
+
"require": {
|
|
135
|
+
"production": "./base64Url.min.cjs",
|
|
136
|
+
"development": "./base64Url.cjs",
|
|
137
|
+
"default": "./base64Url.cjs"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"./dateTimeStr": {
|
|
141
|
+
"types": "./dateTimeStr.d.ts",
|
|
142
|
+
"import": {
|
|
143
|
+
"production": "./dateTimeStr.min.mjs",
|
|
144
|
+
"development": "./dateTimeStr.mjs",
|
|
145
|
+
"default": "./dateTimeStr.mjs"
|
|
146
|
+
},
|
|
147
|
+
"require": {
|
|
148
|
+
"production": "./dateTimeStr.min.cjs",
|
|
149
|
+
"development": "./dateTimeStr.cjs",
|
|
150
|
+
"default": "./dateTimeStr.cjs"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"./duration": {
|
|
154
|
+
"types": "./duration.d.ts",
|
|
155
|
+
"import": {
|
|
156
|
+
"production": "./duration.min.mjs",
|
|
157
|
+
"development": "./duration.mjs",
|
|
158
|
+
"default": "./duration.mjs"
|
|
159
|
+
},
|
|
160
|
+
"require": {
|
|
161
|
+
"production": "./duration.min.cjs",
|
|
162
|
+
"development": "./duration.cjs",
|
|
163
|
+
"default": "./duration.cjs"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"./isEmpty": {
|
|
167
|
+
"types": "./isEmpty.d.ts",
|
|
168
|
+
"import": {
|
|
169
|
+
"production": "./isEmpty.min.mjs",
|
|
170
|
+
"development": "./isEmpty.mjs",
|
|
171
|
+
"default": "./isEmpty.mjs"
|
|
172
|
+
},
|
|
173
|
+
"require": {
|
|
174
|
+
"production": "./isEmpty.min.cjs",
|
|
175
|
+
"development": "./isEmpty.cjs",
|
|
176
|
+
"default": "./isEmpty.cjs"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"./iterators": {
|
|
180
|
+
"types": "./iterators.d.ts",
|
|
181
|
+
"import": {
|
|
182
|
+
"production": "./iterators.min.mjs",
|
|
183
|
+
"development": "./iterators.mjs",
|
|
184
|
+
"default": "./iterators.mjs"
|
|
185
|
+
},
|
|
186
|
+
"require": {
|
|
187
|
+
"production": "./iterators.min.cjs",
|
|
188
|
+
"development": "./iterators.cjs",
|
|
189
|
+
"default": "./iterators.cjs"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
"./kvStore": {
|
|
193
|
+
"types": "./kvStore.d.ts",
|
|
194
|
+
"import": {
|
|
195
|
+
"production": "./kvStore.min.mjs",
|
|
196
|
+
"development": "./kvStore.mjs",
|
|
197
|
+
"default": "./kvStore.mjs"
|
|
198
|
+
},
|
|
199
|
+
"require": {
|
|
200
|
+
"production": "./kvStore.min.cjs",
|
|
201
|
+
"development": "./kvStore.cjs",
|
|
202
|
+
"default": "./kvStore.cjs"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"./localStore": {
|
|
206
|
+
"types": "./localStore.d.ts",
|
|
207
|
+
"import": {
|
|
208
|
+
"production": "./localStore.min.mjs",
|
|
209
|
+
"development": "./localStore.mjs",
|
|
210
|
+
"default": "./localStore.mjs"
|
|
211
|
+
},
|
|
212
|
+
"require": {
|
|
213
|
+
"production": "./localStore.min.cjs",
|
|
214
|
+
"development": "./localStore.cjs",
|
|
215
|
+
"default": "./localStore.cjs"
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"./logging": {
|
|
219
|
+
"types": "./logging.d.ts",
|
|
220
|
+
"import": {
|
|
221
|
+
"production": "./logging.min.mjs",
|
|
222
|
+
"development": "./logging.mjs",
|
|
223
|
+
"default": "./logging.mjs"
|
|
224
|
+
},
|
|
225
|
+
"require": {
|
|
226
|
+
"production": "./logging.min.cjs",
|
|
227
|
+
"development": "./logging.cjs",
|
|
228
|
+
"default": "./logging.cjs"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"./nonEmpty": {
|
|
232
|
+
"types": "./nonEmpty.d.ts",
|
|
233
|
+
"import": {
|
|
234
|
+
"production": "./nonEmpty.min.mjs",
|
|
235
|
+
"development": "./nonEmpty.mjs",
|
|
236
|
+
"default": "./nonEmpty.mjs"
|
|
237
|
+
},
|
|
238
|
+
"require": {
|
|
239
|
+
"production": "./nonEmpty.min.cjs",
|
|
240
|
+
"development": "./nonEmpty.cjs",
|
|
241
|
+
"default": "./nonEmpty.cjs"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"./nonNil": {
|
|
245
|
+
"types": "./nonNil.d.ts",
|
|
246
|
+
"import": {
|
|
247
|
+
"production": "./nonNil.min.mjs",
|
|
248
|
+
"development": "./nonNil.mjs",
|
|
249
|
+
"default": "./nonNil.mjs"
|
|
250
|
+
},
|
|
251
|
+
"require": {
|
|
252
|
+
"production": "./nonNil.min.cjs",
|
|
253
|
+
"development": "./nonNil.cjs",
|
|
254
|
+
"default": "./nonNil.cjs"
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
"./round": {
|
|
258
|
+
"types": "./round.d.ts",
|
|
259
|
+
"import": {
|
|
260
|
+
"production": "./round.min.mjs",
|
|
261
|
+
"development": "./round.mjs",
|
|
262
|
+
"default": "./round.mjs"
|
|
263
|
+
},
|
|
264
|
+
"require": {
|
|
265
|
+
"production": "./round.min.cjs",
|
|
266
|
+
"development": "./round.cjs",
|
|
267
|
+
"default": "./round.cjs"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"./safeBtoa": {
|
|
271
|
+
"types": "./safeBtoa.d.ts",
|
|
272
|
+
"import": {
|
|
273
|
+
"production": "./safeBtoa.min.mjs",
|
|
274
|
+
"development": "./safeBtoa.mjs",
|
|
275
|
+
"default": "./safeBtoa.mjs"
|
|
276
|
+
},
|
|
277
|
+
"require": {
|
|
278
|
+
"production": "./safeBtoa.min.cjs",
|
|
279
|
+
"development": "./safeBtoa.cjs",
|
|
280
|
+
"default": "./safeBtoa.cjs"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"./safeParseFloat": {
|
|
284
|
+
"types": "./safeParseFloat.d.ts",
|
|
285
|
+
"import": {
|
|
286
|
+
"production": "./safeParseFloat.min.mjs",
|
|
287
|
+
"development": "./safeParseFloat.mjs",
|
|
288
|
+
"default": "./safeParseFloat.mjs"
|
|
289
|
+
},
|
|
290
|
+
"require": {
|
|
291
|
+
"production": "./safeParseFloat.min.cjs",
|
|
292
|
+
"development": "./safeParseFloat.cjs",
|
|
293
|
+
"default": "./safeParseFloat.cjs"
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
"./safeParseInt": {
|
|
297
|
+
"types": "./safeParseInt.d.ts",
|
|
298
|
+
"import": {
|
|
299
|
+
"production": "./safeParseInt.min.mjs",
|
|
300
|
+
"development": "./safeParseInt.mjs",
|
|
301
|
+
"default": "./safeParseInt.mjs"
|
|
302
|
+
},
|
|
303
|
+
"require": {
|
|
304
|
+
"production": "./safeParseInt.min.cjs",
|
|
305
|
+
"development": "./safeParseInt.cjs",
|
|
306
|
+
"default": "./safeParseInt.cjs"
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
"./sha256": {
|
|
310
|
+
"types": "./sha256.d.ts",
|
|
311
|
+
"import": {
|
|
312
|
+
"production": "./sha256.min.mjs",
|
|
313
|
+
"development": "./sha256.mjs",
|
|
314
|
+
"default": "./sha256.mjs"
|
|
315
|
+
},
|
|
316
|
+
"require": {
|
|
317
|
+
"production": "./sha256.min.cjs",
|
|
318
|
+
"development": "./sha256.cjs",
|
|
319
|
+
"default": "./sha256.cjs"
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"./sleep": {
|
|
323
|
+
"types": "./sleep.d.ts",
|
|
324
|
+
"import": {
|
|
325
|
+
"production": "./sleep.min.mjs",
|
|
326
|
+
"development": "./sleep.mjs",
|
|
327
|
+
"default": "./sleep.mjs"
|
|
328
|
+
},
|
|
329
|
+
"require": {
|
|
330
|
+
"production": "./sleep.min.cjs",
|
|
331
|
+
"development": "./sleep.cjs",
|
|
332
|
+
"default": "./sleep.cjs"
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
"./storageAdapter": {
|
|
336
|
+
"types": "./storageAdapter.d.ts",
|
|
337
|
+
"import": {
|
|
338
|
+
"production": "./storageAdapter.min.mjs",
|
|
339
|
+
"development": "./storageAdapter.mjs",
|
|
340
|
+
"default": "./storageAdapter.mjs"
|
|
341
|
+
},
|
|
342
|
+
"require": {
|
|
343
|
+
"production": "./storageAdapter.min.cjs",
|
|
344
|
+
"development": "./storageAdapter.cjs",
|
|
345
|
+
"default": "./storageAdapter.cjs"
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
"./sum": {
|
|
349
|
+
"types": "./sum.d.ts",
|
|
350
|
+
"import": {
|
|
351
|
+
"production": "./sum.min.mjs",
|
|
352
|
+
"development": "./sum.mjs",
|
|
353
|
+
"default": "./sum.mjs"
|
|
354
|
+
},
|
|
355
|
+
"require": {
|
|
356
|
+
"production": "./sum.min.cjs",
|
|
357
|
+
"development": "./sum.cjs",
|
|
358
|
+
"default": "./sum.cjs"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"./timeConstants": {
|
|
362
|
+
"types": "./timeConstants.d.ts",
|
|
363
|
+
"import": {
|
|
364
|
+
"production": "./timeConstants.min.mjs",
|
|
365
|
+
"development": "./timeConstants.mjs",
|
|
366
|
+
"default": "./timeConstants.mjs"
|
|
367
|
+
},
|
|
368
|
+
"require": {
|
|
369
|
+
"production": "./timeConstants.min.cjs",
|
|
370
|
+
"development": "./timeConstants.cjs",
|
|
371
|
+
"default": "./timeConstants.cjs"
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"./timer": {
|
|
375
|
+
"types": "./timer.d.ts",
|
|
376
|
+
"import": {
|
|
377
|
+
"production": "./timer.min.mjs",
|
|
378
|
+
"development": "./timer.mjs",
|
|
379
|
+
"default": "./timer.mjs"
|
|
380
|
+
},
|
|
381
|
+
"require": {
|
|
382
|
+
"production": "./timer.min.cjs",
|
|
383
|
+
"development": "./timer.cjs",
|
|
384
|
+
"default": "./timer.cjs"
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"typesVersions": {
|
|
389
|
+
"*": {
|
|
390
|
+
"arrayBuffer": [
|
|
391
|
+
"./arrayBuffer.d.ts"
|
|
392
|
+
],
|
|
393
|
+
"assert": [
|
|
394
|
+
"./assert.d.ts"
|
|
395
|
+
],
|
|
396
|
+
"average": [
|
|
397
|
+
"./average.d.ts"
|
|
398
|
+
],
|
|
399
|
+
"base64Url": [
|
|
400
|
+
"./base64Url.d.ts"
|
|
401
|
+
],
|
|
402
|
+
"dateTimeStr": [
|
|
403
|
+
"./dateTimeStr.d.ts"
|
|
404
|
+
],
|
|
405
|
+
"duration": [
|
|
406
|
+
"./duration.d.ts"
|
|
407
|
+
],
|
|
408
|
+
"isEmpty": [
|
|
409
|
+
"./isEmpty.d.ts"
|
|
410
|
+
],
|
|
411
|
+
"iterators": [
|
|
412
|
+
"./iterators.d.ts"
|
|
413
|
+
],
|
|
414
|
+
"kvStore": [
|
|
415
|
+
"./kvStore.d.ts"
|
|
416
|
+
],
|
|
417
|
+
"localStore": [
|
|
418
|
+
"./localStore.d.ts"
|
|
419
|
+
],
|
|
420
|
+
"logging": [
|
|
421
|
+
"./logging.d.ts"
|
|
422
|
+
],
|
|
423
|
+
"nonEmpty": [
|
|
424
|
+
"./nonEmpty.d.ts"
|
|
425
|
+
],
|
|
426
|
+
"nonNil": [
|
|
427
|
+
"./nonNil.d.ts"
|
|
428
|
+
],
|
|
429
|
+
"round": [
|
|
430
|
+
"./round.d.ts"
|
|
431
|
+
],
|
|
432
|
+
"safeBtoa": [
|
|
433
|
+
"./safeBtoa.d.ts"
|
|
434
|
+
],
|
|
435
|
+
"safeParseFloat": [
|
|
436
|
+
"./safeParseFloat.d.ts"
|
|
437
|
+
],
|
|
438
|
+
"safeParseInt": [
|
|
439
|
+
"./safeParseInt.d.ts"
|
|
440
|
+
],
|
|
441
|
+
"sha256": [
|
|
442
|
+
"./sha256.d.ts"
|
|
443
|
+
],
|
|
444
|
+
"sleep": [
|
|
445
|
+
"./sleep.d.ts"
|
|
446
|
+
],
|
|
447
|
+
"storageAdapter": [
|
|
448
|
+
"./storageAdapter.d.ts"
|
|
449
|
+
],
|
|
450
|
+
"sum": [
|
|
451
|
+
"./sum.d.ts"
|
|
452
|
+
],
|
|
453
|
+
"timeConstants": [
|
|
454
|
+
"./timeConstants.d.ts"
|
|
455
|
+
],
|
|
456
|
+
"timer": [
|
|
457
|
+
"./timer.d.ts"
|
|
458
|
+
]
|
|
459
|
+
}
|
|
37
460
|
}
|
|
38
|
-
}
|
|
461
|
+
}
|
package/{round.js → round.cjs}
RENAMED