@zenstackhq/common-helpers 3.0.0-beta.4 → 3.0.0-beta.6
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/index.cjs +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -26,7 +26,8 @@ __export(src_exports, {
|
|
|
26
26
|
lowerCaseFirst: () => lowerCaseFirst,
|
|
27
27
|
paramCase: () => paramCase,
|
|
28
28
|
sleep: () => sleep,
|
|
29
|
-
upperCaseFirst: () => upperCaseFirst
|
|
29
|
+
upperCaseFirst: () => upperCaseFirst,
|
|
30
|
+
zip: () => zip
|
|
30
31
|
});
|
|
31
32
|
module.exports = __toCommonJS(src_exports);
|
|
32
33
|
|
|
@@ -95,6 +96,20 @@ function upperCaseFirst(input) {
|
|
|
95
96
|
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
96
97
|
}
|
|
97
98
|
__name(upperCaseFirst, "upperCaseFirst");
|
|
99
|
+
|
|
100
|
+
// src/zip.ts
|
|
101
|
+
function zip(arr1, arr2) {
|
|
102
|
+
const length = Math.min(arr1.length, arr2.length);
|
|
103
|
+
const result = [];
|
|
104
|
+
for (let i = 0; i < length; i++) {
|
|
105
|
+
result.push([
|
|
106
|
+
arr1[i],
|
|
107
|
+
arr2[i]
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
__name(zip, "zip");
|
|
98
113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
99
114
|
0 && (module.exports = {
|
|
100
115
|
invariant,
|
|
@@ -102,6 +117,7 @@ __name(upperCaseFirst, "upperCaseFirst");
|
|
|
102
117
|
lowerCaseFirst,
|
|
103
118
|
paramCase,
|
|
104
119
|
sleep,
|
|
105
|
-
upperCaseFirst
|
|
120
|
+
upperCaseFirst,
|
|
121
|
+
zip
|
|
106
122
|
});
|
|
107
123
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/is-plain-object.ts","../src/lower-case-first.ts","../src/param-case.ts","../src/sleep.ts","../src/tiny-invariant.ts","../src/upper-case-first.ts"],"sourcesContent":["export * from './is-plain-object';\nexport * from './lower-case-first';\nexport * from './param-case';\nexport * from './sleep';\nexport * from './tiny-invariant';\nexport * from './upper-case-first';\n","function isObject(o: unknown) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(o: unknown) {\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n const ctor = (o as { constructor: unknown }).constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n const prot = (ctor as { prototype: unknown }).prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","export function lowerCaseFirst(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n","const DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;\nconst DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\nexport function paramCase(input: string) {\n const result = input\n .replace(DEFAULT_SPLIT_REGEXP_1, '$1\\0$2')\n .replace(DEFAULT_SPLIT_REGEXP_2, '$1\\0$2')\n .replace(DEFAULT_STRIP_REGEXP, '\\0');\n\n let start = 0;\n let end = result.length;\n\n while (result.charAt(start) === '\\0') start++;\n while (result.charAt(end - 1) === '\\0') end--;\n\n return result\n .slice(start, end)\n .split('\\0')\n .map((str) => str.toLowerCase())\n .join('-');\n}\n","export function sleep(timeout: number) {\n return new Promise<void>((resolve) => {\n setTimeout(() => resolve(), timeout);\n });\n}\n","const isProduction = process.env['NODE_ENV'] === 'production';\nconst prefix = 'Invariant failed';\n\nexport function invariant(condition: unknown, message?: string): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n }\n\n throw new Error(message ? `${prefix}: ${message}` : prefix);\n}\n","export function upperCaseFirst(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/is-plain-object.ts","../src/lower-case-first.ts","../src/param-case.ts","../src/sleep.ts","../src/tiny-invariant.ts","../src/upper-case-first.ts","../src/zip.ts"],"sourcesContent":["export * from './is-plain-object';\nexport * from './lower-case-first';\nexport * from './param-case';\nexport * from './sleep';\nexport * from './tiny-invariant';\nexport * from './upper-case-first';\nexport * from './zip';\n","function isObject(o: unknown) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(o: unknown) {\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n const ctor = (o as { constructor: unknown }).constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n const prot = (ctor as { prototype: unknown }).prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","export function lowerCaseFirst(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n","const DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;\nconst DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\nexport function paramCase(input: string) {\n const result = input\n .replace(DEFAULT_SPLIT_REGEXP_1, '$1\\0$2')\n .replace(DEFAULT_SPLIT_REGEXP_2, '$1\\0$2')\n .replace(DEFAULT_STRIP_REGEXP, '\\0');\n\n let start = 0;\n let end = result.length;\n\n while (result.charAt(start) === '\\0') start++;\n while (result.charAt(end - 1) === '\\0') end--;\n\n return result\n .slice(start, end)\n .split('\\0')\n .map((str) => str.toLowerCase())\n .join('-');\n}\n","export function sleep(timeout: number) {\n return new Promise<void>((resolve) => {\n setTimeout(() => resolve(), timeout);\n });\n}\n","const isProduction = process.env['NODE_ENV'] === 'production';\nconst prefix = 'Invariant failed';\n\nexport function invariant(condition: unknown, message?: string): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n }\n\n throw new Error(message ? `${prefix}: ${message}` : prefix);\n}\n","export function upperCaseFirst(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n","/**\n * Zips two arrays into an array of tuples.\n */\nexport function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]> {\n const length = Math.min(arr1.length, arr2.length);\n const result: Array<[T, U]> = [];\n for (let i = 0; i < length; i++) {\n result.push([arr1[i]!, arr2[i]!]);\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;ACAA,SAASA,SAASC,GAAU;AACxB,SAAOC,OAAOC,UAAUC,SAASC,KAAKJ,CAAAA,MAAO;AACjD;AAFSD;AAIF,SAASM,cAAcL,GAAU;AACpC,MAAID,SAASC,CAAAA,MAAO,MAAO,QAAO;AAGlC,QAAMM,OAAQN,EAA+B;AAC7C,MAAIM,SAASC,OAAW,QAAO;AAG/B,QAAMC,OAAQF,KAAgCJ;AAC9C,MAAIH,SAASS,IAAAA,MAAU,MAAO,QAAO;AAGrC,MAAIP,OAAOC,UAAUO,eAAeL,KAAKI,MAAM,eAAA,MAAqB,OAAO;AACvE,WAAO;EACX;AAGA,SAAO;AACX;AAlBgBH;;;ACJT,SAASK,eAAeC,OAAa;AACxC,SAAOA,MAAMC,OAAO,CAAA,EAAGC,YAAW,IAAKF,MAAMG,MAAM,CAAA;AACvD;AAFgBJ;;;ACAhB,IAAMK,yBAAyB;AAC/B,IAAMC,yBAAyB;AAC/B,IAAMC,uBAAuB;AAEtB,SAASC,UAAUC,OAAa;AACnC,QAAMC,SAASD,MACVE,QAAQN,wBAAwB,QAAA,EAChCM,QAAQL,wBAAwB,QAAA,EAChCK,QAAQJ,sBAAsB,IAAA;AAEnC,MAAIK,QAAQ;AACZ,MAAIC,MAAMH,OAAOI;AAEjB,SAAOJ,OAAOK,OAAOH,KAAAA,MAAW,KAAMA;AACtC,SAAOF,OAAOK,OAAOF,MAAM,CAAA,MAAO,KAAMA;AAExC,SAAOH,OACFM,MAAMJ,OAAOC,GAAAA,EACbI,MAAM,IAAA,EACNC,IAAI,CAACC,QAAQA,IAAIC,YAAW,CAAA,EAC5BC,KAAK,GAAA;AACd;AAjBgBb;;;ACJT,SAASc,MAAMC,SAAe;AACjC,SAAO,IAAIC,QAAc,CAACC,YAAAA;AACtBC,eAAW,MAAMD,QAAAA,GAAWF,OAAAA;EAChC,CAAA;AACJ;AAJgBD;;;ACAhB,IAAMK,eAAeC,QAAQC,IAAI,UAAA,MAAgB;AACjD,IAAMC,SAAS;AAER,SAASC,UAAUC,WAAoBC,SAAgB;AAC1D,MAAID,WAAW;AACX;EACJ;AAEA,MAAIL,cAAc;AACd,UAAM,IAAIO,MAAMJ,MAAAA;EACpB;AAEA,QAAM,IAAII,MAAMD,UAAU,GAAGH,MAAAA,KAAWG,OAAAA,KAAYH,MAAAA;AACxD;AAVgBC;;;ACHT,SAASI,eAAeC,OAAa;AACxC,SAAOA,MAAMC,OAAO,CAAA,EAAGC,YAAW,IAAKF,MAAMG,MAAM,CAAA;AACvD;AAFgBJ;;;ACGT,SAASK,IAAUC,MAAWC,MAAS;AAC1C,QAAMC,SAASC,KAAKC,IAAIJ,KAAKE,QAAQD,KAAKC,MAAM;AAChD,QAAMG,SAAwB,CAAA;AAC9B,WAASC,IAAI,GAAGA,IAAIJ,QAAQI,KAAK;AAC7BD,WAAOE,KAAK;MAACP,KAAKM,CAAAA;MAAKL,KAAKK,CAAAA;KAAI;EACpC;AACA,SAAOD;AACX;AAPgBN;","names":["isObject","o","Object","prototype","toString","call","isPlainObject","ctor","undefined","prot","hasOwnProperty","lowerCaseFirst","input","charAt","toLowerCase","slice","DEFAULT_SPLIT_REGEXP_1","DEFAULT_SPLIT_REGEXP_2","DEFAULT_STRIP_REGEXP","paramCase","input","result","replace","start","end","length","charAt","slice","split","map","str","toLowerCase","join","sleep","timeout","Promise","resolve","setTimeout","isProduction","process","env","prefix","invariant","condition","message","Error","upperCaseFirst","input","charAt","toUpperCase","slice","zip","arr1","arr2","length","Math","min","result","i","push"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -10,4 +10,9 @@ declare function invariant(condition: unknown, message?: string): asserts condit
|
|
|
10
10
|
|
|
11
11
|
declare function upperCaseFirst(input: string): string;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Zips two arrays into an array of tuples.
|
|
15
|
+
*/
|
|
16
|
+
declare function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]>;
|
|
17
|
+
|
|
18
|
+
export { invariant, isPlainObject, lowerCaseFirst, paramCase, sleep, upperCaseFirst, zip };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,4 +10,9 @@ declare function invariant(condition: unknown, message?: string): asserts condit
|
|
|
10
10
|
|
|
11
11
|
declare function upperCaseFirst(input: string): string;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Zips two arrays into an array of tuples.
|
|
15
|
+
*/
|
|
16
|
+
declare function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]>;
|
|
17
|
+
|
|
18
|
+
export { invariant, isPlainObject, lowerCaseFirst, paramCase, sleep, upperCaseFirst, zip };
|
package/dist/index.js
CHANGED
|
@@ -66,12 +66,27 @@ function upperCaseFirst(input) {
|
|
|
66
66
|
return input.charAt(0).toUpperCase() + input.slice(1);
|
|
67
67
|
}
|
|
68
68
|
__name(upperCaseFirst, "upperCaseFirst");
|
|
69
|
+
|
|
70
|
+
// src/zip.ts
|
|
71
|
+
function zip(arr1, arr2) {
|
|
72
|
+
const length = Math.min(arr1.length, arr2.length);
|
|
73
|
+
const result = [];
|
|
74
|
+
for (let i = 0; i < length; i++) {
|
|
75
|
+
result.push([
|
|
76
|
+
arr1[i],
|
|
77
|
+
arr2[i]
|
|
78
|
+
]);
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
__name(zip, "zip");
|
|
69
83
|
export {
|
|
70
84
|
invariant,
|
|
71
85
|
isPlainObject,
|
|
72
86
|
lowerCaseFirst,
|
|
73
87
|
paramCase,
|
|
74
88
|
sleep,
|
|
75
|
-
upperCaseFirst
|
|
89
|
+
upperCaseFirst,
|
|
90
|
+
zip
|
|
76
91
|
};
|
|
77
92
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/is-plain-object.ts","../src/lower-case-first.ts","../src/param-case.ts","../src/sleep.ts","../src/tiny-invariant.ts","../src/upper-case-first.ts"],"sourcesContent":["function isObject(o: unknown) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(o: unknown) {\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n const ctor = (o as { constructor: unknown }).constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n const prot = (ctor as { prototype: unknown }).prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","export function lowerCaseFirst(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n","const DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;\nconst DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\nexport function paramCase(input: string) {\n const result = input\n .replace(DEFAULT_SPLIT_REGEXP_1, '$1\\0$2')\n .replace(DEFAULT_SPLIT_REGEXP_2, '$1\\0$2')\n .replace(DEFAULT_STRIP_REGEXP, '\\0');\n\n let start = 0;\n let end = result.length;\n\n while (result.charAt(start) === '\\0') start++;\n while (result.charAt(end - 1) === '\\0') end--;\n\n return result\n .slice(start, end)\n .split('\\0')\n .map((str) => str.toLowerCase())\n .join('-');\n}\n","export function sleep(timeout: number) {\n return new Promise<void>((resolve) => {\n setTimeout(() => resolve(), timeout);\n });\n}\n","const isProduction = process.env['NODE_ENV'] === 'production';\nconst prefix = 'Invariant failed';\n\nexport function invariant(condition: unknown, message?: string): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n }\n\n throw new Error(message ? `${prefix}: ${message}` : prefix);\n}\n","export function upperCaseFirst(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n"],"mappings":";;;;AAAA,SAASA,SAASC,GAAU;AACxB,SAAOC,OAAOC,UAAUC,SAASC,KAAKJ,CAAAA,MAAO;AACjD;AAFSD;AAIF,SAASM,cAAcL,GAAU;AACpC,MAAID,SAASC,CAAAA,MAAO,MAAO,QAAO;AAGlC,QAAMM,OAAQN,EAA+B;AAC7C,MAAIM,SAASC,OAAW,QAAO;AAG/B,QAAMC,OAAQF,KAAgCJ;AAC9C,MAAIH,SAASS,IAAAA,MAAU,MAAO,QAAO;AAGrC,MAAIP,OAAOC,UAAUO,eAAeL,KAAKI,MAAM,eAAA,MAAqB,OAAO;AACvE,WAAO;EACX;AAGA,SAAO;AACX;AAlBgBH;;;ACJT,SAASK,eAAeC,OAAa;AACxC,SAAOA,MAAMC,OAAO,CAAA,EAAGC,YAAW,IAAKF,MAAMG,MAAM,CAAA;AACvD;AAFgBJ;;;ACAhB,IAAMK,yBAAyB;AAC/B,IAAMC,yBAAyB;AAC/B,IAAMC,uBAAuB;AAEtB,SAASC,UAAUC,OAAa;AACnC,QAAMC,SAASD,MACVE,QAAQN,wBAAwB,QAAA,EAChCM,QAAQL,wBAAwB,QAAA,EAChCK,QAAQJ,sBAAsB,IAAA;AAEnC,MAAIK,QAAQ;AACZ,MAAIC,MAAMH,OAAOI;AAEjB,SAAOJ,OAAOK,OAAOH,KAAAA,MAAW,KAAMA;AACtC,SAAOF,OAAOK,OAAOF,MAAM,CAAA,MAAO,KAAMA;AAExC,SAAOH,OACFM,MAAMJ,OAAOC,GAAAA,EACbI,MAAM,IAAA,EACNC,IAAI,CAACC,QAAQA,IAAIC,YAAW,CAAA,EAC5BC,KAAK,GAAA;AACd;AAjBgBb;;;ACJT,SAASc,MAAMC,SAAe;AACjC,SAAO,IAAIC,QAAc,CAACC,YAAAA;AACtBC,eAAW,MAAMD,QAAAA,GAAWF,OAAAA;EAChC,CAAA;AACJ;AAJgBD;;;ACAhB,IAAMK,eAAeC,QAAQC,IAAI,UAAA,MAAgB;AACjD,IAAMC,SAAS;AAER,SAASC,UAAUC,WAAoBC,SAAgB;AAC1D,MAAID,WAAW;AACX;EACJ;AAEA,MAAIL,cAAc;AACd,UAAM,IAAIO,MAAMJ,MAAAA;EACpB;AAEA,QAAM,IAAII,MAAMD,UAAU,GAAGH,MAAAA,KAAWG,OAAAA,KAAYH,MAAAA;AACxD;AAVgBC;;;ACHT,SAASI,eAAeC,OAAa;AACxC,SAAOA,MAAMC,OAAO,CAAA,EAAGC,YAAW,IAAKF,MAAMG,MAAM,CAAA;AACvD;AAFgBJ;","names":["isObject","o","Object","prototype","toString","call","isPlainObject","ctor","undefined","prot","hasOwnProperty","lowerCaseFirst","input","charAt","toLowerCase","slice","DEFAULT_SPLIT_REGEXP_1","DEFAULT_SPLIT_REGEXP_2","DEFAULT_STRIP_REGEXP","paramCase","input","result","replace","start","end","length","charAt","slice","split","map","str","toLowerCase","join","sleep","timeout","Promise","resolve","setTimeout","isProduction","process","env","prefix","invariant","condition","message","Error","upperCaseFirst","input","charAt","toUpperCase","slice"]}
|
|
1
|
+
{"version":3,"sources":["../src/is-plain-object.ts","../src/lower-case-first.ts","../src/param-case.ts","../src/sleep.ts","../src/tiny-invariant.ts","../src/upper-case-first.ts","../src/zip.ts"],"sourcesContent":["function isObject(o: unknown) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nexport function isPlainObject(o: unknown) {\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n const ctor = (o as { constructor: unknown }).constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n const prot = (ctor as { prototype: unknown }).prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (Object.prototype.hasOwnProperty.call(prot, 'isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n","export function lowerCaseFirst(input: string) {\n return input.charAt(0).toLowerCase() + input.slice(1);\n}\n","const DEFAULT_SPLIT_REGEXP_1 = /([a-z0-9])([A-Z])/g;\nconst DEFAULT_SPLIT_REGEXP_2 = /([A-Z])([A-Z][a-z])/g;\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\nexport function paramCase(input: string) {\n const result = input\n .replace(DEFAULT_SPLIT_REGEXP_1, '$1\\0$2')\n .replace(DEFAULT_SPLIT_REGEXP_2, '$1\\0$2')\n .replace(DEFAULT_STRIP_REGEXP, '\\0');\n\n let start = 0;\n let end = result.length;\n\n while (result.charAt(start) === '\\0') start++;\n while (result.charAt(end - 1) === '\\0') end--;\n\n return result\n .slice(start, end)\n .split('\\0')\n .map((str) => str.toLowerCase())\n .join('-');\n}\n","export function sleep(timeout: number) {\n return new Promise<void>((resolve) => {\n setTimeout(() => resolve(), timeout);\n });\n}\n","const isProduction = process.env['NODE_ENV'] === 'production';\nconst prefix = 'Invariant failed';\n\nexport function invariant(condition: unknown, message?: string): asserts condition {\n if (condition) {\n return;\n }\n\n if (isProduction) {\n throw new Error(prefix);\n }\n\n throw new Error(message ? `${prefix}: ${message}` : prefix);\n}\n","export function upperCaseFirst(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}\n","/**\n * Zips two arrays into an array of tuples.\n */\nexport function zip<T, U>(arr1: T[], arr2: U[]): Array<[T, U]> {\n const length = Math.min(arr1.length, arr2.length);\n const result: Array<[T, U]> = [];\n for (let i = 0; i < length; i++) {\n result.push([arr1[i]!, arr2[i]!]);\n }\n return result;\n}\n"],"mappings":";;;;AAAA,SAASA,SAASC,GAAU;AACxB,SAAOC,OAAOC,UAAUC,SAASC,KAAKJ,CAAAA,MAAO;AACjD;AAFSD;AAIF,SAASM,cAAcL,GAAU;AACpC,MAAID,SAASC,CAAAA,MAAO,MAAO,QAAO;AAGlC,QAAMM,OAAQN,EAA+B;AAC7C,MAAIM,SAASC,OAAW,QAAO;AAG/B,QAAMC,OAAQF,KAAgCJ;AAC9C,MAAIH,SAASS,IAAAA,MAAU,MAAO,QAAO;AAGrC,MAAIP,OAAOC,UAAUO,eAAeL,KAAKI,MAAM,eAAA,MAAqB,OAAO;AACvE,WAAO;EACX;AAGA,SAAO;AACX;AAlBgBH;;;ACJT,SAASK,eAAeC,OAAa;AACxC,SAAOA,MAAMC,OAAO,CAAA,EAAGC,YAAW,IAAKF,MAAMG,MAAM,CAAA;AACvD;AAFgBJ;;;ACAhB,IAAMK,yBAAyB;AAC/B,IAAMC,yBAAyB;AAC/B,IAAMC,uBAAuB;AAEtB,SAASC,UAAUC,OAAa;AACnC,QAAMC,SAASD,MACVE,QAAQN,wBAAwB,QAAA,EAChCM,QAAQL,wBAAwB,QAAA,EAChCK,QAAQJ,sBAAsB,IAAA;AAEnC,MAAIK,QAAQ;AACZ,MAAIC,MAAMH,OAAOI;AAEjB,SAAOJ,OAAOK,OAAOH,KAAAA,MAAW,KAAMA;AACtC,SAAOF,OAAOK,OAAOF,MAAM,CAAA,MAAO,KAAMA;AAExC,SAAOH,OACFM,MAAMJ,OAAOC,GAAAA,EACbI,MAAM,IAAA,EACNC,IAAI,CAACC,QAAQA,IAAIC,YAAW,CAAA,EAC5BC,KAAK,GAAA;AACd;AAjBgBb;;;ACJT,SAASc,MAAMC,SAAe;AACjC,SAAO,IAAIC,QAAc,CAACC,YAAAA;AACtBC,eAAW,MAAMD,QAAAA,GAAWF,OAAAA;EAChC,CAAA;AACJ;AAJgBD;;;ACAhB,IAAMK,eAAeC,QAAQC,IAAI,UAAA,MAAgB;AACjD,IAAMC,SAAS;AAER,SAASC,UAAUC,WAAoBC,SAAgB;AAC1D,MAAID,WAAW;AACX;EACJ;AAEA,MAAIL,cAAc;AACd,UAAM,IAAIO,MAAMJ,MAAAA;EACpB;AAEA,QAAM,IAAII,MAAMD,UAAU,GAAGH,MAAAA,KAAWG,OAAAA,KAAYH,MAAAA;AACxD;AAVgBC;;;ACHT,SAASI,eAAeC,OAAa;AACxC,SAAOA,MAAMC,OAAO,CAAA,EAAGC,YAAW,IAAKF,MAAMG,MAAM,CAAA;AACvD;AAFgBJ;;;ACGT,SAASK,IAAUC,MAAWC,MAAS;AAC1C,QAAMC,SAASC,KAAKC,IAAIJ,KAAKE,QAAQD,KAAKC,MAAM;AAChD,QAAMG,SAAwB,CAAA;AAC9B,WAASC,IAAI,GAAGA,IAAIJ,QAAQI,KAAK;AAC7BD,WAAOE,KAAK;MAACP,KAAKM,CAAAA;MAAKL,KAAKK,CAAAA;KAAI;EACpC;AACA,SAAOD;AACX;AAPgBN;","names":["isObject","o","Object","prototype","toString","call","isPlainObject","ctor","undefined","prot","hasOwnProperty","lowerCaseFirst","input","charAt","toLowerCase","slice","DEFAULT_SPLIT_REGEXP_1","DEFAULT_SPLIT_REGEXP_2","DEFAULT_STRIP_REGEXP","paramCase","input","result","replace","start","end","length","charAt","slice","split","map","str","toLowerCase","join","sleep","timeout","Promise","resolve","setTimeout","isProduction","process","env","prefix","invariant","condition","message","Error","upperCaseFirst","input","charAt","toUpperCase","slice","zip","arr1","arr2","length","Math","min","result","i","push"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/common-helpers",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.6",
|
|
4
4
|
"description": "ZenStack Common Helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@zenstackhq/typescript-config": "3.0.0-beta.
|
|
26
|
-
"@zenstackhq/eslint-config": "3.0.0-beta.
|
|
25
|
+
"@zenstackhq/typescript-config": "3.0.0-beta.6",
|
|
26
|
+
"@zenstackhq/eslint-config": "3.0.0-beta.6"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsc --noEmit && tsup-node",
|