@alextheman/utility 2.12.1 → 2.13.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 +8 -0
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -0
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -54,6 +54,7 @@ __export(index_exports, {
|
|
|
54
54
|
fillArray: () => fillArray_default,
|
|
55
55
|
formatDateAndTime: () => formatDateAndTime_default,
|
|
56
56
|
getRandomNumber: () => getRandomNumber_default,
|
|
57
|
+
getRecordKeys: () => getRecordKeys_default,
|
|
57
58
|
httpErrorCodeLookup: () => httpErrorCodeLookup,
|
|
58
59
|
interpolateObjects: () => interpolateObjects_default,
|
|
59
60
|
isLeapYear: () => isLeapYear_default,
|
|
@@ -276,6 +277,12 @@ function getRandomNumber(lowerBound, upperBound) {
|
|
|
276
277
|
}
|
|
277
278
|
var getRandomNumber_default = getRandomNumber;
|
|
278
279
|
|
|
280
|
+
// src/functions/getRecordKeys.ts
|
|
281
|
+
function getRecordKeys(record) {
|
|
282
|
+
return Object.keys(record);
|
|
283
|
+
}
|
|
284
|
+
var getRecordKeys_default = getRecordKeys;
|
|
285
|
+
|
|
279
286
|
// src/functions/isLeapYear.ts
|
|
280
287
|
function isLeapYear(year) {
|
|
281
288
|
const parsedYear = parseIntStrict_default(`${year}`);
|
|
@@ -509,6 +516,7 @@ var UUID_default = parseUUID;
|
|
|
509
516
|
fillArray,
|
|
510
517
|
formatDateAndTime,
|
|
511
518
|
getRandomNumber,
|
|
519
|
+
getRecordKeys,
|
|
512
520
|
httpErrorCodeLookup,
|
|
513
521
|
interpolateObjects,
|
|
514
522
|
isLeapYear,
|
package/dist/index.d.cts
CHANGED
|
@@ -67,6 +67,8 @@ declare function formatDateAndTime(inputDate: Date): string;
|
|
|
67
67
|
|
|
68
68
|
declare function getRandomNumber(lowerBound: number, upperBound: number): number;
|
|
69
69
|
|
|
70
|
+
declare function getRecordKeys<T extends Record<RecordKey, unknown>>(record: T & object): (keyof T)[];
|
|
71
|
+
|
|
70
72
|
declare function isLeapYear(year: number): boolean;
|
|
71
73
|
|
|
72
74
|
declare function isMonthlyMultiple(firstDate: Date, secondDate: Date): boolean;
|
|
@@ -99,4 +101,4 @@ declare function wait(seconds: number): Promise<void>;
|
|
|
99
101
|
|
|
100
102
|
declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
101
103
|
|
|
102
|
-
export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
|
|
104
|
+
export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ declare function formatDateAndTime(inputDate: Date): string;
|
|
|
67
67
|
|
|
68
68
|
declare function getRandomNumber(lowerBound: number, upperBound: number): number;
|
|
69
69
|
|
|
70
|
+
declare function getRecordKeys<T extends Record<RecordKey, unknown>>(record: T & object): (keyof T)[];
|
|
71
|
+
|
|
70
72
|
declare function isLeapYear(year: number): boolean;
|
|
71
73
|
|
|
72
74
|
declare function isMonthlyMultiple(firstDate: Date, secondDate: Date): boolean;
|
|
@@ -99,4 +101,4 @@ declare function wait(seconds: number): Promise<void>;
|
|
|
99
101
|
|
|
100
102
|
declare function interpolateObjects(strings: TemplateStringsArray, ...values: unknown[]): string;
|
|
101
103
|
|
|
102
|
-
export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
|
|
104
|
+
export { APIError, type CreateFormDataOptions, type CreateFormDataOptionsNullableResolution, type CreateFormDataOptionsUndefinedOrNullResolution, type DisallowUndefined, type Email, type Env, type FormDataNullableResolutionStrategy as FormDataResolutionStrategy, type HTTPErrorCode, type HTTPErrorCodes, type NonUndefined, type OptionalOnCondition, type RecordKey, type StringListToArrayOptions, type UUID, addDaysToDate, appendSemicolon, camelToKebab, convertFileToBase64, createFormData, fillArray, formatDateAndTime, getRandomNumber, getRecordKeys, httpErrorCodeLookup, interpolateObjects, isLeapYear, isMonthlyMultiple, isOrdered, isSameDate, omitProperties, parseEmail, parseEnv, parseIntStrict, parseUUID, randomiseArray, range, removeDuplicates, stringListToArray, stringToBoolean, truncate, wait };
|
package/dist/index.js
CHANGED
|
@@ -217,6 +217,12 @@ function getRandomNumber(lowerBound, upperBound) {
|
|
|
217
217
|
}
|
|
218
218
|
var getRandomNumber_default = getRandomNumber;
|
|
219
219
|
|
|
220
|
+
// src/functions/getRecordKeys.ts
|
|
221
|
+
function getRecordKeys(record) {
|
|
222
|
+
return Object.keys(record);
|
|
223
|
+
}
|
|
224
|
+
var getRecordKeys_default = getRecordKeys;
|
|
225
|
+
|
|
220
226
|
// src/functions/isLeapYear.ts
|
|
221
227
|
function isLeapYear(year) {
|
|
222
228
|
const parsedYear = parseIntStrict_default(`${year}`);
|
|
@@ -449,6 +455,7 @@ export {
|
|
|
449
455
|
fillArray_default as fillArray,
|
|
450
456
|
formatDateAndTime_default as formatDateAndTime,
|
|
451
457
|
getRandomNumber_default as getRandomNumber,
|
|
458
|
+
getRecordKeys_default as getRecordKeys,
|
|
452
459
|
httpErrorCodeLookup,
|
|
453
460
|
interpolateObjects_default as interpolateObjects,
|
|
454
461
|
isLeapYear_default as isLeapYear,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alextheman/utility",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "Helpful utility functions",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "alextheman",
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@alextheman/eslint-plugin": "^2.5.0",
|
|
40
|
-
"@eslint/js": "^9.39.
|
|
41
|
-
"@types/node": "^24.
|
|
42
|
-
"eslint": "^9.39.
|
|
40
|
+
"@eslint/js": "^9.39.1",
|
|
41
|
+
"@types/node": "^24.10.0",
|
|
42
|
+
"eslint": "^9.39.1",
|
|
43
43
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
44
44
|
"eslint-plugin-import": "^2.32.0",
|
|
45
|
-
"globals": "^16.
|
|
45
|
+
"globals": "^16.5.0",
|
|
46
46
|
"husky": "^9.1.7",
|
|
47
47
|
"jsdom": "^27.1.0",
|
|
48
48
|
"prettier": "^3.6.2",
|
|
49
49
|
"tsup": "^8.5.0",
|
|
50
50
|
"typescript": "^5.9.3",
|
|
51
|
-
"typescript-eslint": "^8.46.
|
|
51
|
+
"typescript-eslint": "^8.46.3",
|
|
52
52
|
"vite-tsconfig-paths": "^5.1.4",
|
|
53
|
-
"vitest": "^4.0.
|
|
53
|
+
"vitest": "^4.0.8"
|
|
54
54
|
}
|
|
55
55
|
}
|