@stackone/utils 0.19.0 → 0.21.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/edge/index.d.mts +11 -2
- package/dist/edge/index.mjs +2 -2
- package/dist/node/index.cjs +2 -2
- package/dist/node/index.d.cts +11 -1
- package/dist/node/index.d.mts +11 -2
- package/dist/node/index.mjs +2 -2
- package/package.json +1 -1
package/dist/node/index.d.cts
CHANGED
|
@@ -8,6 +8,12 @@ import { randomUUID } from "crypto";
|
|
|
8
8
|
declare function encodeToBase64(data: string): string;
|
|
9
9
|
declare function decodeFromBase64(encodedData: string): string;
|
|
10
10
|
//#endregion
|
|
11
|
+
//#region src/shared/caseConversion.d.ts
|
|
12
|
+
declare const snakeToCamel: (str: string) => string;
|
|
13
|
+
declare const camelToSnake: (str: string) => string;
|
|
14
|
+
declare const convertKeysToCamelCase: <T>(obj: T) => T;
|
|
15
|
+
declare const convertKeysToSnakeCase: <T>(obj: T) => T;
|
|
16
|
+
//#endregion
|
|
11
17
|
//#region src/shared/countries/types.d.ts
|
|
12
18
|
type ISO31662SubDivisionCodeNamePairs = {
|
|
13
19
|
[subDivisionCode: string]: string;
|
|
@@ -90,6 +96,10 @@ declare const isValidIpRanges: (patterns: string[]) => boolean;
|
|
|
90
96
|
declare const isIpInRanges: (ip: string, patterns: string[]) => boolean;
|
|
91
97
|
declare const isIpInRange: (ip: string, pattern: string) => boolean;
|
|
92
98
|
//#endregion
|
|
99
|
+
//#region src/shared/objectSize.d.ts
|
|
100
|
+
declare function calculateSize(obj: unknown): number;
|
|
101
|
+
declare function exceedsSize(obj: unknown, maxSize: number): boolean;
|
|
102
|
+
//#endregion
|
|
93
103
|
//#region src/shared/parsers.d.ts
|
|
94
104
|
declare const safeParseToString: ({
|
|
95
105
|
value
|
|
@@ -203,4 +213,4 @@ declare const generateRequestId: (randomUUIDGenerator?: typeof randomUUID) => st
|
|
|
203
213
|
declare const generateActionRunId: (randomUUIDGenerator?: typeof randomUUID) => string;
|
|
204
214
|
declare const generateEventId: (randomUUIDGenerator?: typeof randomUUID) => string;
|
|
205
215
|
//#endregion
|
|
206
|
-
export { NON_BACKGROUND_LOGS_SOURCE_TYPES, NormalizedKeyMap, RequestSourceType, ZodType, calculateNextAnniversary, calculateYearsElapsed, dateHasPassed, decodeFromBase64, deepCopy, delay, encodeToBase64, exponentialBackoffInMS, generateActionRunId, generateEventId, generateRequestId, generateSamlAssertion, getContentHash, getCountryAlpha2CodeByAlpha2Code, getCountryAlpha2CodeByAlpha3Code, getCountryAlpha2CodeByCitizenship, getCountryAlpha2CodeByCountryCode, getCountryAlpha2CodeByCountryName, getCountryAlpha3CodeByAlpha2Code, getCountryAlpha3CodeByAlpha3Code, getCountryAlpha3CodeByCountryCode, getCountryAlpha3CodeByCountryName, getCountryCodeByAlpha2Code, getCountryCodeByAlpha3Code, getCountryCodeByCountryCode, getCountryCodeByCountryName, getCountryNameByAlpha2Code, getCountryNameByAlpha3Code, getCountryNameByCountryCode, getCountryNameByCountryName, getCountrySubDivisionByAlpha2CodeAndName, getCountrySubDivisionCodeBySubDivisionName, getCountrySubDivisionNameBySubDivisionCode, getCountrySubDivisionsByAlpha2Code, getDocumentFileFormatFromExtension, isBoolean, isDate, isFunction, isFutureUnixTimestamp, isIpInRange, isIpInRanges, isMissing, isNumber, isObject, isString, isValidIp, isValidIpRange, isValidIpRanges, isValidUUID, notMissing, safeParseToBoolean, safeParseToDateTime, safeParseToDateTimeString, safeParseToNumber, safeParseToString, z, zStrictObject };
|
|
216
|
+
export { NON_BACKGROUND_LOGS_SOURCE_TYPES, NormalizedKeyMap, RequestSourceType, ZodType, calculateNextAnniversary, calculateSize, calculateYearsElapsed, camelToSnake, convertKeysToCamelCase, convertKeysToSnakeCase, dateHasPassed, decodeFromBase64, deepCopy, delay, encodeToBase64, exceedsSize, exponentialBackoffInMS, generateActionRunId, generateEventId, generateRequestId, generateSamlAssertion, getContentHash, getCountryAlpha2CodeByAlpha2Code, getCountryAlpha2CodeByAlpha3Code, getCountryAlpha2CodeByCitizenship, getCountryAlpha2CodeByCountryCode, getCountryAlpha2CodeByCountryName, getCountryAlpha3CodeByAlpha2Code, getCountryAlpha3CodeByAlpha3Code, getCountryAlpha3CodeByCountryCode, getCountryAlpha3CodeByCountryName, getCountryCodeByAlpha2Code, getCountryCodeByAlpha3Code, getCountryCodeByCountryCode, getCountryCodeByCountryName, getCountryNameByAlpha2Code, getCountryNameByAlpha3Code, getCountryNameByCountryCode, getCountryNameByCountryName, getCountrySubDivisionByAlpha2CodeAndName, getCountrySubDivisionCodeBySubDivisionName, getCountrySubDivisionNameBySubDivisionCode, getCountrySubDivisionsByAlpha2Code, getDocumentFileFormatFromExtension, isBoolean, isDate, isFunction, isFutureUnixTimestamp, isIpInRange, isIpInRanges, isMissing, isNumber, isObject, isString, isValidIp, isValidIpRange, isValidIpRanges, isValidUUID, notMissing, safeParseToBoolean, safeParseToDateTime, safeParseToDateTimeString, safeParseToNumber, safeParseToString, snakeToCamel, z, zStrictObject };
|
package/dist/node/index.d.mts
CHANGED
|
@@ -7,8 +7,13 @@ import { ZodType, z } from "zod/v4";
|
|
|
7
7
|
declare function encodeToBase64(data: string): string;
|
|
8
8
|
declare function decodeFromBase64(encodedData: string): string;
|
|
9
9
|
//#endregion
|
|
10
|
+
//#region src/shared/caseConversion.d.ts
|
|
11
|
+
declare const snakeToCamel: (str: string) => string;
|
|
12
|
+
declare const camelToSnake: (str: string) => string;
|
|
13
|
+
declare const convertKeysToCamelCase: <T>(obj: T) => T;
|
|
14
|
+
declare const convertKeysToSnakeCase: <T>(obj: T) => T;
|
|
15
|
+
//#endregion
|
|
10
16
|
//#region src/shared/countries/types.d.ts
|
|
11
|
-
|
|
12
17
|
type ISO31662SubDivisionCodeNamePairs = {
|
|
13
18
|
[subDivisionCode: string]: string;
|
|
14
19
|
};
|
|
@@ -90,6 +95,10 @@ declare const isValidIpRanges: (patterns: string[]) => boolean;
|
|
|
90
95
|
declare const isIpInRanges: (ip: string, patterns: string[]) => boolean;
|
|
91
96
|
declare const isIpInRange: (ip: string, pattern: string) => boolean;
|
|
92
97
|
//#endregion
|
|
98
|
+
//#region src/shared/objectSize.d.ts
|
|
99
|
+
declare function calculateSize(obj: unknown): number;
|
|
100
|
+
declare function exceedsSize(obj: unknown, maxSize: number): boolean;
|
|
101
|
+
//#endregion
|
|
93
102
|
//#region src/shared/parsers.d.ts
|
|
94
103
|
declare const safeParseToString: ({
|
|
95
104
|
value
|
|
@@ -203,4 +212,4 @@ declare const generateRequestId: (randomUUIDGenerator?: typeof randomUUID) => st
|
|
|
203
212
|
declare const generateActionRunId: (randomUUIDGenerator?: typeof randomUUID) => string;
|
|
204
213
|
declare const generateEventId: (randomUUIDGenerator?: typeof randomUUID) => string;
|
|
205
214
|
//#endregion
|
|
206
|
-
export { NON_BACKGROUND_LOGS_SOURCE_TYPES, NormalizedKeyMap, RequestSourceType, type ZodType, calculateNextAnniversary, calculateYearsElapsed, dateHasPassed, decodeFromBase64, deepCopy, delay, encodeToBase64, exponentialBackoffInMS, generateActionRunId, generateEventId, generateRequestId, generateSamlAssertion, getContentHash, getCountryAlpha2CodeByAlpha2Code, getCountryAlpha2CodeByAlpha3Code, getCountryAlpha2CodeByCitizenship, getCountryAlpha2CodeByCountryCode, getCountryAlpha2CodeByCountryName, getCountryAlpha3CodeByAlpha2Code, getCountryAlpha3CodeByAlpha3Code, getCountryAlpha3CodeByCountryCode, getCountryAlpha3CodeByCountryName, getCountryCodeByAlpha2Code, getCountryCodeByAlpha3Code, getCountryCodeByCountryCode, getCountryCodeByCountryName, getCountryNameByAlpha2Code, getCountryNameByAlpha3Code, getCountryNameByCountryCode, getCountryNameByCountryName, getCountrySubDivisionByAlpha2CodeAndName, getCountrySubDivisionCodeBySubDivisionName, getCountrySubDivisionNameBySubDivisionCode, getCountrySubDivisionsByAlpha2Code, getDocumentFileFormatFromExtension, isBoolean, isDate, isFunction, isFutureUnixTimestamp, isIpInRange, isIpInRanges, isMissing, isNumber, isObject, isString, isValidIp, isValidIpRange, isValidIpRanges, isValidUUID, notMissing, safeParseToBoolean, safeParseToDateTime, safeParseToDateTimeString, safeParseToNumber, safeParseToString, z, zStrictObject };
|
|
215
|
+
export { NON_BACKGROUND_LOGS_SOURCE_TYPES, NormalizedKeyMap, RequestSourceType, type ZodType, calculateNextAnniversary, calculateSize, calculateYearsElapsed, camelToSnake, convertKeysToCamelCase, convertKeysToSnakeCase, dateHasPassed, decodeFromBase64, deepCopy, delay, encodeToBase64, exceedsSize, exponentialBackoffInMS, generateActionRunId, generateEventId, generateRequestId, generateSamlAssertion, getContentHash, getCountryAlpha2CodeByAlpha2Code, getCountryAlpha2CodeByAlpha3Code, getCountryAlpha2CodeByCitizenship, getCountryAlpha2CodeByCountryCode, getCountryAlpha2CodeByCountryName, getCountryAlpha3CodeByAlpha2Code, getCountryAlpha3CodeByAlpha3Code, getCountryAlpha3CodeByCountryCode, getCountryAlpha3CodeByCountryName, getCountryCodeByAlpha2Code, getCountryCodeByAlpha3Code, getCountryCodeByCountryCode, getCountryCodeByCountryName, getCountryNameByAlpha2Code, getCountryNameByAlpha3Code, getCountryNameByCountryCode, getCountryNameByCountryName, getCountrySubDivisionByAlpha2CodeAndName, getCountrySubDivisionCodeBySubDivisionName, getCountrySubDivisionNameBySubDivisionCode, getCountrySubDivisionsByAlpha2Code, getDocumentFileFormatFromExtension, isBoolean, isDate, isFunction, isFutureUnixTimestamp, isIpInRange, isIpInRanges, isMissing, isNumber, isObject, isString, isValidIp, isValidIpRange, isValidIpRanges, isValidUUID, notMissing, safeParseToBoolean, safeParseToDateTime, safeParseToDateTimeString, safeParseToNumber, safeParseToString, snakeToCamel, z, zStrictObject };
|