@alextheman/utility 1.16.3 → 1.17.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/index.cjs +15 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +14 -0
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -61,6 +61,7 @@ __export(index_exports, {
|
|
|
61
61
|
formatDateAndTime: () => formatDateAndTime_default,
|
|
62
62
|
getRandomNumber: () => getRandomNumber_default,
|
|
63
63
|
httpErrorCodeLookup: () => httpErrorCodeLookup,
|
|
64
|
+
interpolateObjects: () => interpolateObjects_default,
|
|
64
65
|
isLeapYear: () => isLeapYear_default,
|
|
65
66
|
isMonthlyMultiple: () => isMonthlyMultiple_default,
|
|
66
67
|
isSameDate: () => isSameDate_default,
|
|
@@ -313,6 +314,19 @@ function wait(seconds) {
|
|
|
313
314
|
});
|
|
314
315
|
}
|
|
315
316
|
var wait_default = wait;
|
|
317
|
+
|
|
318
|
+
// src/functions/taggedTemplate/interpolateObjects.ts
|
|
319
|
+
function interpolateObjects(strings, ...values) {
|
|
320
|
+
let result = "";
|
|
321
|
+
for (let i = 0; i < strings.length; i++) {
|
|
322
|
+
result += strings[i];
|
|
323
|
+
if (i !== strings.length - 1) {
|
|
324
|
+
result += values[i] && typeof values[i] === "object" ? JSON.stringify(values[i]) : values[i];
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return result;
|
|
328
|
+
}
|
|
329
|
+
var interpolateObjects_default = interpolateObjects;
|
|
316
330
|
// Annotate the CommonJS export names for ESM import in node:
|
|
317
331
|
0 && (module.exports = {
|
|
318
332
|
APIError,
|
|
@@ -324,6 +338,7 @@ var wait_default = wait;
|
|
|
324
338
|
formatDateAndTime,
|
|
325
339
|
getRandomNumber,
|
|
326
340
|
httpErrorCodeLookup,
|
|
341
|
+
interpolateObjects,
|
|
327
342
|
isLeapYear,
|
|
328
343
|
isMonthlyMultiple,
|
|
329
344
|
isSameDate,
|
package/dist/index.d.cts
CHANGED
|
@@ -45,4 +45,6 @@ declare function validateUUID(UUID: string, error?: Error | APIError): string;
|
|
|
45
45
|
|
|
46
46
|
declare function wait(seconds: number): Promise<void>;
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
49
|
+
|
|
50
|
+
export { APIError, type Env, type HTTPErrorCodes, addDaysToDate, appendSemicolon, convertFileToBase64, fillArray, fillArrayAsync, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, parseEnv, randomiseArray, range, truncate, validateUUID, wait };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,4 +45,6 @@ declare function validateUUID(UUID: string, error?: Error | APIError): string;
|
|
|
45
45
|
|
|
46
46
|
declare function wait(seconds: number): Promise<void>;
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
49
|
+
|
|
50
|
+
export { APIError, type Env, type HTTPErrorCodes, addDaysToDate, appendSemicolon, convertFileToBase64, fillArray, fillArrayAsync, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isSameDate, parseEnv, randomiseArray, range, truncate, validateUUID, wait };
|
package/dist/index.js
CHANGED
|
@@ -262,6 +262,19 @@ function wait(seconds) {
|
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
var wait_default = wait;
|
|
265
|
+
|
|
266
|
+
// src/functions/taggedTemplate/interpolateObjects.ts
|
|
267
|
+
function interpolateObjects(strings, ...values) {
|
|
268
|
+
let result = "";
|
|
269
|
+
for (let i = 0; i < strings.length; i++) {
|
|
270
|
+
result += strings[i];
|
|
271
|
+
if (i !== strings.length - 1) {
|
|
272
|
+
result += values[i] && typeof values[i] === "object" ? JSON.stringify(values[i]) : values[i];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return result;
|
|
276
|
+
}
|
|
277
|
+
var interpolateObjects_default = interpolateObjects;
|
|
265
278
|
export {
|
|
266
279
|
APIError_default as APIError,
|
|
267
280
|
addDaysToDate_default as addDaysToDate,
|
|
@@ -272,6 +285,7 @@ export {
|
|
|
272
285
|
formatDateAndTime_default as formatDateAndTime,
|
|
273
286
|
getRandomNumber_default as getRandomNumber,
|
|
274
287
|
httpErrorCodeLookup,
|
|
288
|
+
interpolateObjects_default as interpolateObjects,
|
|
275
289
|
isLeapYear_default as isLeapYear,
|
|
276
290
|
isMonthlyMultiple_default as isMonthlyMultiple,
|
|
277
291
|
isSameDate_default as isSameDate,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/utility",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
"description": "",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@alextheman/eslint-plugin": "^1.14.1",
|
|
29
|
-
"@eslint/js": "^9.
|
|
30
|
-
"@types/node": "^24.
|
|
31
|
-
"eslint": "^9.
|
|
29
|
+
"@eslint/js": "^9.36.0",
|
|
30
|
+
"@types/node": "^24.5.2",
|
|
31
|
+
"eslint": "^9.36.0",
|
|
32
32
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
33
33
|
"eslint-plugin-import": "^2.32.0",
|
|
34
34
|
"globals": "^16.4.0",
|
|
35
35
|
"husky": "^9.1.7",
|
|
36
|
-
"jsdom": "^
|
|
36
|
+
"jsdom": "^27.0.0",
|
|
37
37
|
"prettier": "^3.6.2",
|
|
38
38
|
"tsup": "^8.5.0",
|
|
39
39
|
"typescript": "^5.9.2",
|
|
40
|
-
"typescript-eslint": "^8.
|
|
40
|
+
"typescript-eslint": "^8.44.0",
|
|
41
41
|
"vite-tsconfig-paths": "^5.1.4",
|
|
42
42
|
"vitest": "^3.2.4"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"zod": "^4.1.
|
|
45
|
+
"zod": "^4.1.9"
|
|
46
46
|
}
|
|
47
47
|
}
|