@dinilmusick/gutts 0.0.0-stage → 0.1.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/README.md +25 -2
- package/dist/arrays/array-concepts.d.ts +2 -0
- package/dist/arrays/array-concepts.d.ts.map +1 -0
- package/dist/arrays/array-concepts.js +2 -0
- package/dist/arrays/array-concepts.js.map +1 -0
- package/dist/arrays/array-operations.d.ts +6 -0
- package/dist/arrays/array-operations.d.ts.map +1 -0
- package/dist/arrays/array-operations.js +11 -0
- package/dist/arrays/array-operations.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/json/json-concepts.d.ts +4 -0
- package/dist/json/json-concepts.d.ts.map +1 -0
- package/dist/json/json-concepts.js +3 -0
- package/dist/json/json-concepts.js.map +1 -0
- package/dist/json/json-parse.d.ts +5 -0
- package/dist/json/json-parse.d.ts.map +1 -0
- package/dist/json/json-parse.js +10 -0
- package/dist/json/json-parse.js.map +1 -0
- package/dist/json/json-value.d.ts +7 -0
- package/dist/json/json-value.d.ts.map +1 -0
- package/dist/json/json-value.js +12 -0
- package/dist/json/json-value.js.map +1 -0
- package/dist/numbers/number-concepts.d.ts +2 -0
- package/dist/numbers/number-concepts.d.ts.map +1 -0
- package/dist/numbers/number-concepts.js +2 -0
- package/dist/numbers/number-concepts.js.map +1 -0
- package/dist/numbers/number-operations.d.ts +6 -0
- package/dist/numbers/number-operations.d.ts.map +1 -0
- package/dist/numbers/number-operations.js +19 -0
- package/dist/numbers/number-operations.js.map +1 -0
- package/dist/objects/object-concepts.d.ts +2 -0
- package/dist/objects/object-concepts.d.ts.map +1 -0
- package/dist/objects/object-concepts.js +2 -0
- package/dist/objects/object-concepts.js.map +1 -0
- package/dist/objects/object-operations.d.ts +5 -0
- package/dist/objects/object-operations.d.ts.map +1 -0
- package/dist/objects/object-operations.js +6 -0
- package/dist/objects/object-operations.js.map +1 -0
- package/dist/strings/string-concepts.d.ts +4 -0
- package/dist/strings/string-concepts.d.ts.map +1 -0
- package/dist/strings/string-concepts.js +4 -0
- package/dist/strings/string-concepts.js.map +1 -0
- package/dist/strings/string-predicates.d.ts +6 -0
- package/dist/strings/string-predicates.d.ts.map +1 -0
- package/dist/strings/string-predicates.js +8 -0
- package/dist/strings/string-predicates.js.map +1 -0
- package/dist/strings/string-transform.d.ts +6 -0
- package/dist/strings/string-transform.d.ts.map +1 -0
- package/dist/strings/string-transform.js +11 -0
- package/dist/strings/string-transform.js.map +1 -0
- package/dist/strings/string-truncate-words.d.ts +10 -0
- package/dist/strings/string-truncate-words.d.ts.map +1 -0
- package/dist/strings/string-truncate-words.js +19 -0
- package/dist/strings/string-truncate-words.js.map +1 -0
- package/dist/urls/url-concepts.d.ts +2 -0
- package/dist/urls/url-concepts.d.ts.map +1 -0
- package/dist/urls/url-concepts.js +2 -0
- package/dist/urls/url-concepts.js.map +1 -0
- package/dist/urls/url-operations.d.ts +5 -0
- package/dist/urls/url-operations.d.ts.map +1 -0
- package/dist/urls/url-operations.js +11 -0
- package/dist/urls/url-operations.js.map +1 -0
- package/package.json +46 -4
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# GutTS
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Gut stands for Global Utilities. Gut is the aggregate library for the very basic functions and operations needed by KrnlTS services, FrnlTS components, Skipo applications, and other code assets. Its purpose is to prevent multiple libraries from solving the same foundational problems.
|
|
4
|
+
|
|
5
|
+
## Structure
|
|
6
|
+
|
|
7
|
+
Each category is a directory with a `<category>-concepts.ts` facade. The facade re-exports small implementation files containing focused functions and category-owned shared types.
|
|
8
|
+
|
|
9
|
+
Current categories: JSON, strings, arrays, objects, numbers, and URLs.
|
|
10
|
+
|
|
11
|
+
## Library policy
|
|
12
|
+
|
|
13
|
+
GutTS is an aggregation layer, not a collection of reimplemented utility algorithms.
|
|
14
|
+
|
|
15
|
+
- Prefer mature, widely adopted, well-maintained libraries when they provide the required primitive.
|
|
16
|
+
- Current third-party utility dependencies are Lodash ES modules for general-purpose collections/string/number/object operations and Validator for email validation.
|
|
17
|
+
- JSON and URL operations use the platform's native implementations because `JSON` and `URL` are established runtime primitives rather than functionality that benefits from another abstraction.
|
|
18
|
+
- Keep GutTS wrappers small and stable; do not duplicate the implementation of the underlying library.
|
|
19
|
+
- Keep application/domain-specific behavior out of GutTS.
|
|
20
|
+
|
|
21
|
+
## Design rules
|
|
22
|
+
|
|
23
|
+
- Prefer small, composable functions.
|
|
24
|
+
- Keep category facades stable.
|
|
25
|
+
- Keep shared types beside the category that owns them.
|
|
26
|
+
- Add regression tests for every public utility family.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-concepts.d.ts","sourceRoot":"","sources":["../../src/arrays/array-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-concepts.js","sourceRoot":"","sources":["../../src/arrays/array-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,EAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function compact<T>(values: readonly (T | null | undefined)[]): T[];
|
|
2
|
+
export declare function unique<T>(values: readonly T[]): T[];
|
|
3
|
+
export declare function chunk<T>(values: readonly T[], size: number): T[][];
|
|
4
|
+
export declare function flatten<T>(values: readonly (T | readonly T[])[]): T[];
|
|
5
|
+
export declare function last<T>(values: readonly T[]): T | undefined;
|
|
6
|
+
//# sourceMappingURL=array-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-operations.d.ts","sourceRoot":"","sources":["../../src/arrays/array-operations.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAC,SAAQ,CAAC,CAAC,GAAC,IAAI,GAAC,SAAS,CAAC,EAAE,GAAE,CAAC,EAAE,CAAsC;AACzG,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAC,SAAS,CAAC,EAAE,GAAE,CAAC,EAAE,CAAmC;AACrF,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAC,SAAS,CAAC,EAAE,EAAC,IAAI,EAAC,MAAM,GAAE,CAAC,EAAE,EAAE,CAG9D;AACD,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAC,SAAQ,CAAC,CAAC,GAAC,SAAS,CAAC,EAAE,CAAC,EAAE,GAAE,CAAC,EAAE,CAAwC;AACzG,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAC,SAAS,CAAC,EAAE,GAAE,CAAC,GAAC,SAAS,CAAmC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { chunk as lodashChunk, compact as lodashCompact, flatten as lodashFlatten, last as lodashLast, uniq as lodashUniq } from "lodash-es";
|
|
2
|
+
export function compact(values) { return lodashCompact(values); }
|
|
3
|
+
export function unique(values) { return lodashUniq(values); }
|
|
4
|
+
export function chunk(values, size) {
|
|
5
|
+
if (!Number.isInteger(size) || size <= 0)
|
|
6
|
+
throw new RangeError("size must be a positive integer");
|
|
7
|
+
return lodashChunk(values, size);
|
|
8
|
+
}
|
|
9
|
+
export function flatten(values) { return lodashFlatten(values); }
|
|
10
|
+
export function last(values) { return lodashLast(values); }
|
|
11
|
+
//# sourceMappingURL=array-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array-operations.js","sourceRoot":"","sources":["../../src/arrays/array-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,WAAW,EAAE,OAAO,IAAI,aAAa,EAAE,OAAO,IAAI,aAAa,EAAE,IAAI,IAAI,UAAU,EAAE,IAAI,IAAI,UAAU,EAAC,MAAM,WAAW,CAAC;AAE3I,MAAM,UAAU,OAAO,CAAI,MAAmC,IAAM,OAAO,aAAa,CAAC,MAAa,CAAC,CAAC,CAAA,CAAC;AACzG,MAAM,UAAU,MAAM,CAAI,MAAmB,IAAM,OAAO,UAAU,CAAC,MAAa,CAAC,CAAC,CAAA,CAAC;AACrF,MAAM,UAAU,KAAK,CAAI,MAAmB,EAAC,IAAW;IACtD,IAAG,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAE,IAAI,IAAE,CAAC;QAAC,MAAM,IAAI,UAAU,CAAC,iCAAiC,CAAC,CAAC;IAC5F,OAAO,WAAW,CAAC,MAAa,EAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AACD,MAAM,UAAU,OAAO,CAAI,MAAiC,IAAM,OAAO,aAAa,CAAC,MAAe,CAAC,CAAC,CAAA,CAAC;AACzG,MAAM,UAAU,IAAI,CAAI,MAAmB,IAAc,OAAO,UAAU,CAAC,MAAa,CAAC,CAAC,CAAA,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./json/json-concepts.js";
|
|
2
|
+
export * from "./strings/string-concepts.js";
|
|
3
|
+
export * from "./arrays/array-concepts.js";
|
|
4
|
+
export * from "./objects/object-concepts.js";
|
|
5
|
+
export * from "./numbers/number-concepts.js";
|
|
6
|
+
export * from "./urls/url-concepts.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./json/json-concepts.js";
|
|
2
|
+
export * from "./strings/string-concepts.js";
|
|
3
|
+
export * from "./arrays/array-concepts.js";
|
|
4
|
+
export * from "./objects/object-concepts.js";
|
|
5
|
+
export * from "./numbers/number-concepts.js";
|
|
6
|
+
export * from "./urls/url-concepts.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-concepts.d.ts","sourceRoot":"","sources":["../../src/json/json-concepts.ts"],"names":[],"mappings":"AAAA,YAAY,EAAC,aAAa,EAAC,SAAS,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,SAAS,EAAC,YAAY,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-concepts.js","sourceRoot":"","sources":["../../src/json/json-concepts.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,SAAS,EAAC,YAAY,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonValue } from "./json-value.js";
|
|
2
|
+
export declare function parseJson<T extends JsonValue = JsonValue>(text: string): T;
|
|
3
|
+
export declare function tryParseJson<T extends JsonValue = JsonValue>(text: string): T | undefined;
|
|
4
|
+
export declare function stringifyJson(value: JsonValue, space?: number): string;
|
|
5
|
+
//# sourceMappingURL=json-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-parse.d.ts","sourceRoot":"","sources":["../../src/json/json-parse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC/C,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,GAAC,SAAS,EAAE,IAAI,EAAC,MAAM,GAAE,CAAC,CAA+B;AACtG,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,GAAC,SAAS,EAAE,IAAI,EAAC,MAAM,GAAE,CAAC,GAAC,SAAS,CAAyD;AAC7I,wBAAgB,aAAa,CAAC,KAAK,EAAC,SAAS,EAAC,KAAK,CAAC,EAAC,MAAM,GAAE,MAAM,CAAiJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export function parseJson(text) { return JSON.parse(text); }
|
|
2
|
+
export function tryParseJson(text) { try {
|
|
3
|
+
return parseJson(text);
|
|
4
|
+
}
|
|
5
|
+
catch {
|
|
6
|
+
return undefined;
|
|
7
|
+
} }
|
|
8
|
+
export function stringifyJson(value, space) { const result = JSON.stringify(value, null, space); if (result === undefined)
|
|
9
|
+
throw new TypeError("Value could not be serialized as JSON"); return result; }
|
|
10
|
+
//# sourceMappingURL=json-parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-parse.js","sourceRoot":"","sources":["../../src/json/json-parse.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CAAgC,IAAW,IAAI,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAM,CAAC,CAAA,CAAC;AACtG,MAAM,UAAU,YAAY,CAAgC,IAAW,IAAc,IAAG,CAAC;IAAA,OAAO,SAAS,CAAI,IAAI,CAAC,CAAC;AAAA,CAAC;AAAA,MAAK,CAAC;IAAA,OAAO,SAAS,CAAC;AAAA,CAAC,CAAA,CAAC;AAC7I,MAAM,UAAU,aAAa,CAAC,KAAe,EAAC,KAAa,IAAS,MAAM,MAAM,GAAC,IAAI,CAAC,SAAS,CAAC,KAAK,EAAC,IAAI,EAAC,KAAK,CAAC,CAAC,CAAA,IAAG,MAAM,KAAG,SAAS;IAAC,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC,CAAA,OAAO,MAAM,CAAC,CAAA,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
2
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
|
|
3
|
+
export type JsonObject = {
|
|
4
|
+
[key: string]: JsonValue;
|
|
5
|
+
};
|
|
6
|
+
export declare function isJsonValue(value: unknown): value is JsonValue;
|
|
7
|
+
//# sourceMappingURL=json-value.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-value.d.ts","sourceRoot":"","sources":["../../src/json/json-value.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAC,MAAM,GAAC,MAAM,GAAC,OAAO,GAAC,IAAI,CAAC;AACrD,MAAM,MAAM,SAAS,GAAC,aAAa,GAAC,UAAU,GAAC,SAAS,EAAE,CAAC;AAC3D,MAAM,MAAM,UAAU,GAAC;IAAC,CAAC,GAAG,EAAC,MAAM,GAAE,SAAS,CAAA;CAAC,CAAC;AAChD,wBAAgB,WAAW,CAAC,KAAK,EAAC,OAAO,GAAE,KAAK,IAAI,SAAS,CAM5D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function isJsonValue(value) {
|
|
2
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
3
|
+
return true;
|
|
4
|
+
if (typeof value === "number")
|
|
5
|
+
return Number.isFinite(value);
|
|
6
|
+
if (Array.isArray(value))
|
|
7
|
+
return value.every(isJsonValue);
|
|
8
|
+
if (typeof value === "object")
|
|
9
|
+
return Object.values(value).every(isJsonValue);
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=json-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-value.js","sourceRoot":"","sources":["../../src/json/json-value.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,IAAG,KAAK,KAAG,IAAI,IAAE,OAAO,KAAK,KAAG,QAAQ,IAAE,OAAO,KAAK,KAAG,SAAS;QAAC,OAAO,IAAI,CAAC;IAC/E,IAAG,OAAO,KAAK,KAAG,QAAQ;QAAC,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACzD,IAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAC,OAAO,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACxD,IAAG,OAAO,KAAK,KAAG,QAAQ;QAAC,OAAO,MAAM,CAAC,MAAM,CAAC,KAA+B,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IACpG,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-concepts.d.ts","sourceRoot":"","sources":["../../src/numbers/number-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,cAAc,EAAC,GAAG,EAAC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-concepts.js","sourceRoot":"","sources":["../../src/numbers/number-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,OAAO,EAAC,cAAc,EAAC,GAAG,EAAC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
2
|
+
export declare function inRange(value: number, min: number, max: number): boolean;
|
|
3
|
+
export declare function roundTo(value: number, decimals?: number): number;
|
|
4
|
+
export declare function isFiniteNumber(value: unknown): value is number;
|
|
5
|
+
export declare function sum(values: readonly number[]): number;
|
|
6
|
+
//# sourceMappingURL=number-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-operations.d.ts","sourceRoot":"","sources":["../../src/numbers/number-operations.ts"],"names":[],"mappings":"AAEA,wBAAgB,KAAK,CAAC,KAAK,EAAC,MAAM,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,MAAM,GAAE,MAAM,CAG/D;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAC,MAAM,EAAC,GAAG,EAAC,MAAM,EAAC,GAAG,EAAC,MAAM,GAAE,OAAO,CAGlE;AACD,wBAAgB,OAAO,CAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,SAAE,GAAE,MAAM,CAGtD;AACD,wBAAgB,cAAc,CAAC,KAAK,EAAC,OAAO,GAAE,KAAK,IAAI,MAAM,CAAwD;AACrH,wBAAgB,GAAG,CAAC,MAAM,EAAC,SAAS,MAAM,EAAE,GAAE,MAAM,CAAuC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { clamp as lodashClamp, inRange as lodashInRange, isFinite as lodashIsFinite, round as lodashRound, sum as lodashSum } from "lodash-es";
|
|
2
|
+
export function clamp(value, min, max) {
|
|
3
|
+
if (min > max)
|
|
4
|
+
throw new RangeError("min must not exceed max");
|
|
5
|
+
return lodashClamp(value, min, max);
|
|
6
|
+
}
|
|
7
|
+
export function inRange(value, min, max) {
|
|
8
|
+
if (min > max)
|
|
9
|
+
throw new RangeError("min must not exceed max");
|
|
10
|
+
return lodashInRange(value, min, max);
|
|
11
|
+
}
|
|
12
|
+
export function roundTo(value, decimals = 0) {
|
|
13
|
+
if (!Number.isInteger(decimals) || decimals < 0)
|
|
14
|
+
throw new RangeError("decimals must be a non-negative integer");
|
|
15
|
+
return lodashRound(value, decimals);
|
|
16
|
+
}
|
|
17
|
+
export function isFiniteNumber(value) { return typeof value === "number" && lodashIsFinite(value); }
|
|
18
|
+
export function sum(values) { return lodashSum(values); }
|
|
19
|
+
//# sourceMappingURL=number-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-operations.js","sourceRoot":"","sources":["../../src/numbers/number-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,WAAW,EAAE,OAAO,IAAI,aAAa,EAAE,QAAQ,IAAI,cAAc,EAAE,KAAK,IAAI,WAAW,EAAE,GAAG,IAAI,SAAS,EAAC,MAAM,WAAW,CAAC;AAE7I,MAAM,UAAU,KAAK,CAAC,KAAY,EAAC,GAAU,EAAC,GAAU;IACtD,IAAG,GAAG,GAAC,GAAG;QAAC,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAC3D,OAAO,WAAW,CAAC,KAAK,EAAC,GAAG,EAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AACD,MAAM,UAAU,OAAO,CAAC,KAAY,EAAC,GAAU,EAAC,GAAU;IACxD,IAAG,GAAG,GAAC,GAAG;QAAC,MAAM,IAAI,UAAU,CAAC,yBAAyB,CAAC,CAAC;IAC3D,OAAO,aAAa,CAAC,KAAK,EAAC,GAAG,EAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AACD,MAAM,UAAU,OAAO,CAAC,KAAY,EAAC,QAAQ,GAAC,CAAC;IAC7C,IAAG,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAE,QAAQ,GAAC,CAAC;QAAC,MAAM,IAAI,UAAU,CAAC,yCAAyC,CAAC,CAAC;IAC3G,OAAO,WAAW,CAAC,KAAK,EAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AACD,MAAM,UAAU,cAAc,CAAC,KAAa,IAAkB,OAAO,OAAO,KAAK,KAAG,QAAQ,IAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AACrH,MAAM,UAAU,GAAG,CAAC,MAAwB,IAAS,OAAO,SAAS,CAAC,MAAkB,CAAC,CAAC,CAAA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-concepts.d.ts","sourceRoot":"","sources":["../../src/objects/object-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-concepts.js","sourceRoot":"","sources":["../../src/objects/object-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,IAAI,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function hasOwn<T extends object>(value: T, key: PropertyKey): boolean;
|
|
2
|
+
export declare function pick<T extends object, K extends keyof T>(value: T, keys: readonly K[]): Pick<T, K>;
|
|
3
|
+
export declare function omit<T extends object, K extends keyof T>(value: T, keys: readonly K[]): Omit<T, K>;
|
|
4
|
+
export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
|
|
5
|
+
//# sourceMappingURL=object-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-operations.d.ts","sourceRoot":"","sources":["../../src/objects/object-operations.ts"],"names":[],"mappings":"AAEA,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAC,CAAC,EAAC,GAAG,EAAC,WAAW,GAAE,OAAO,CAA8B;AACvG,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,CAAC,EAAE,GAAE,IAAI,CAAC,CAAC,EAAC,CAAC,CAAC,CAAuC;AACpI,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAC,CAAC,EAAC,IAAI,EAAC,SAAS,CAAC,EAAE,GAAE,IAAI,CAAC,CAAC,EAAC,CAAC,CAAC,CAAuC;AACpI,wBAAgB,aAAa,CAAC,KAAK,EAAC,OAAO,GAAE,KAAK,IAAI,MAAM,CAAC,MAAM,EAAC,OAAO,CAAC,CAAoC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { has as lodashHas, isPlainObject as lodashIsPlainObject, omit as lodashOmit, pick as lodashPick } from "lodash-es";
|
|
2
|
+
export function hasOwn(value, key) { return lodashHas(value, key); }
|
|
3
|
+
export function pick(value, keys) { return lodashPick(value, keys); }
|
|
4
|
+
export function omit(value, keys) { return lodashOmit(value, keys); }
|
|
5
|
+
export function isPlainObject(value) { return lodashIsPlainObject(value); }
|
|
6
|
+
//# sourceMappingURL=object-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-operations.js","sourceRoot":"","sources":["../../src/objects/object-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,IAAI,SAAS,EAAE,aAAa,IAAI,mBAAmB,EAAE,IAAI,IAAI,UAAU,EAAE,IAAI,IAAI,UAAU,EAAC,MAAM,WAAW,CAAC;AAEzH,MAAM,UAAU,MAAM,CAAmB,KAAO,EAAC,GAAe,IAAU,OAAO,SAAS,CAAC,KAAK,EAAC,GAAG,CAAC,CAAC,CAAA,CAAC;AACvG,MAAM,UAAU,IAAI,CAAqC,KAAO,EAAC,IAAiB,IAAY,OAAO,UAAU,CAAC,KAAK,EAAC,IAAW,CAAC,CAAC,CAAA,CAAC;AACpI,MAAM,UAAU,IAAI,CAAqC,KAAO,EAAC,IAAiB,IAAY,OAAO,UAAU,CAAC,KAAK,EAAC,IAAW,CAAC,CAAC,CAAA,CAAC;AACpI,MAAM,UAAU,aAAa,CAAC,KAAa,IAAkC,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { isBlank, isNonBlank, isEmail, startsWithAny, endsWithAny } from "./string-predicates.js";
|
|
2
|
+
export { capitalize, camelCase, kebabCase, snakeCase, truncate } from "./string-transform.js";
|
|
3
|
+
export { truncateWords } from "./string-truncate-words.js";
|
|
4
|
+
//# sourceMappingURL=string-concepts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-concepts.d.ts","sourceRoot":"","sources":["../../src/strings/string-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAC,aAAa,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAC,UAAU,EAAC,SAAS,EAAC,SAAS,EAAC,SAAS,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { isBlank, isNonBlank, isEmail, startsWithAny, endsWithAny } from "./string-predicates.js";
|
|
2
|
+
export { capitalize, camelCase, kebabCase, snakeCase, truncate } from "./string-transform.js";
|
|
3
|
+
export { truncateWords } from "./string-truncate-words.js";
|
|
4
|
+
//# sourceMappingURL=string-concepts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-concepts.js","sourceRoot":"","sources":["../../src/strings/string-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,UAAU,EAAC,OAAO,EAAC,aAAa,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAC,UAAU,EAAC,SAAS,EAAC,SAAS,EAAC,SAAS,EAAC,QAAQ,EAAC,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isBlank(value: string): boolean;
|
|
2
|
+
export declare function isNonBlank(value: string): boolean;
|
|
3
|
+
export declare function isEmail(value: string): boolean;
|
|
4
|
+
export declare function startsWithAny(value: string, prefixes: readonly string[]): boolean;
|
|
5
|
+
export declare function endsWithAny(value: string, suffixes: readonly string[]): boolean;
|
|
6
|
+
//# sourceMappingURL=string-predicates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-predicates.d.ts","sourceRoot":"","sources":["../../src/strings/string-predicates.ts"],"names":[],"mappings":"AAGA,wBAAgB,OAAO,CAAC,KAAK,EAAC,MAAM,GAAE,OAAO,CAAiC;AAC9E,wBAAgB,UAAU,CAAC,KAAK,EAAC,MAAM,GAAE,OAAO,CAAyB;AACzE,wBAAgB,OAAO,CAAC,KAAK,EAAC,MAAM,GAAE,OAAO,CAAkC;AAC/E,wBAAgB,aAAa,CAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,MAAM,EAAE,GAAE,OAAO,CAA+D;AAC7I,wBAAgB,WAAW,CAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,EAAC,SAAS,MAAM,EAAE,GAAE,OAAO,CAA6D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { endsWith as lodashEndsWith, startsWith as lodashStartsWith } from "lodash-es";
|
|
2
|
+
import validator from "validator";
|
|
3
|
+
export function isBlank(value) { return value.trim().length === 0; }
|
|
4
|
+
export function isNonBlank(value) { return !isBlank(value); }
|
|
5
|
+
export function isEmail(value) { return validator.isEmail(value); }
|
|
6
|
+
export function startsWithAny(value, prefixes) { return prefixes.some(prefix => lodashStartsWith(value, prefix)); }
|
|
7
|
+
export function endsWithAny(value, suffixes) { return suffixes.some(suffix => lodashEndsWith(value, suffix)); }
|
|
8
|
+
//# sourceMappingURL=string-predicates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-predicates.js","sourceRoot":"","sources":["../../src/strings/string-predicates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,IAAI,cAAc,EAAE,UAAU,IAAI,gBAAgB,EAAC,MAAM,WAAW,CAAC;AACrF,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,OAAO,CAAC,KAAY,IAAU,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAG,CAAC,CAAC,CAAA,CAAC;AAC9E,MAAM,UAAU,UAAU,CAAC,KAAY,IAAU,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AACzE,MAAM,UAAU,OAAO,CAAC,KAAY,IAAU,OAAO,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AAC/E,MAAM,UAAU,aAAa,CAAC,KAAY,EAAC,QAA0B,IAAU,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAA,EAAE,CAAA,gBAAgB,CAAC,KAAK,EAAC,MAAM,CAAC,CAAC,CAAC,CAAA,CAAC;AAC7I,MAAM,UAAU,WAAW,CAAC,KAAY,EAAC,QAA0B,IAAU,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAA,EAAE,CAAA,cAAc,CAAC,KAAK,EAAC,MAAM,CAAC,CAAC,CAAC,CAAA,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function capitalize(value: string): string;
|
|
2
|
+
export declare function camelCase(value: string): string;
|
|
3
|
+
export declare function kebabCase(value: string): string;
|
|
4
|
+
export declare function snakeCase(value: string): string;
|
|
5
|
+
export declare function truncate(value: string, maxLength: number, suffix?: string): string;
|
|
6
|
+
//# sourceMappingURL=string-transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-transform.d.ts","sourceRoot":"","sources":["../../src/strings/string-transform.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,KAAK,EAAC,MAAM,GAAE,MAAM,CAAiC;AAChF,wBAAgB,SAAS,CAAC,KAAK,EAAC,MAAM,GAAE,MAAM,CAAgC;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAC,MAAM,GAAE,MAAM,CAAgC;AAC9E,wBAAgB,SAAS,CAAC,KAAK,EAAC,MAAM,GAAE,MAAM,CAAgC;AAC9E,wBAAgB,QAAQ,CAAC,KAAK,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM,EAAC,MAAM,SAAI,GAAE,MAAM,CAGxE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { camelCase as lodashCamelCase, capitalize as lodashCapitalize, kebabCase as lodashKebabCase, snakeCase as lodashSnakeCase, truncate as lodashTruncate } from "lodash-es";
|
|
2
|
+
export function capitalize(value) { return lodashCapitalize(value); }
|
|
3
|
+
export function camelCase(value) { return lodashCamelCase(value); }
|
|
4
|
+
export function kebabCase(value) { return lodashKebabCase(value); }
|
|
5
|
+
export function snakeCase(value) { return lodashSnakeCase(value); }
|
|
6
|
+
export function truncate(value, maxLength, suffix = "…") {
|
|
7
|
+
if (maxLength < 0)
|
|
8
|
+
throw new RangeError("maxLength must be non-negative");
|
|
9
|
+
return lodashTruncate(value, { length: maxLength, omission: suffix });
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=string-transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-transform.js","sourceRoot":"","sources":["../../src/strings/string-transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,IAAI,eAAe,EAAE,UAAU,IAAI,gBAAgB,EAAE,SAAS,IAAI,eAAe,EAAE,SAAS,IAAI,eAAe,EAAE,QAAQ,IAAI,cAAc,EAAC,MAAM,WAAW,CAAC;AAE/K,MAAM,UAAU,UAAU,CAAC,KAAY,IAAS,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AAChF,MAAM,UAAU,SAAS,CAAC,KAAY,IAAS,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AAC9E,MAAM,UAAU,SAAS,CAAC,KAAY,IAAS,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AAC9E,MAAM,UAAU,SAAS,CAAC,KAAY,IAAS,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC,CAAA,CAAC;AAC9E,MAAM,UAAU,QAAQ,CAAC,KAAY,EAAC,SAAgB,EAAC,MAAM,GAAC,GAAG;IAC/D,IAAG,SAAS,GAAC,CAAC;QAAC,MAAM,IAAI,UAAU,CAAC,gCAAgC,CAAC,CAAC;IACtE,OAAO,cAAc,CAAC,KAAK,EAAC,EAAC,MAAM,EAAC,SAAS,EAAC,QAAQ,EAAC,MAAM,EAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncates an input string to a maximum number of words.
|
|
3
|
+
*
|
|
4
|
+
* @param value The input string to truncate.
|
|
5
|
+
* @param maxWords Maximum number of words allowed.
|
|
6
|
+
* @param suffix Suffix to append if truncated (default: '…').
|
|
7
|
+
* @returns Truncated string.
|
|
8
|
+
*/
|
|
9
|
+
export declare function truncateWords(value: string, maxWords: number, suffix?: string): string;
|
|
10
|
+
//# sourceMappingURL=string-truncate-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-truncate-words.d.ts","sourceRoot":"","sources":["../../src/strings/string-truncate-words.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAM,GAAG,MAAM,CAMnF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Truncates an input string to a maximum number of words.
|
|
3
|
+
*
|
|
4
|
+
* @param value The input string to truncate.
|
|
5
|
+
* @param maxWords Maximum number of words allowed.
|
|
6
|
+
* @param suffix Suffix to append if truncated (default: '…').
|
|
7
|
+
* @returns Truncated string.
|
|
8
|
+
*/
|
|
9
|
+
export function truncateWords(value, maxWords, suffix = "…") {
|
|
10
|
+
if (maxWords < 0)
|
|
11
|
+
throw new RangeError("maxWords must be non-negative");
|
|
12
|
+
if (!value)
|
|
13
|
+
return "";
|
|
14
|
+
const words = value.trim().split(/\s+/);
|
|
15
|
+
if (words.length <= maxWords)
|
|
16
|
+
return value;
|
|
17
|
+
return `${words.slice(0, maxWords).join(" ")}${suffix}`;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=string-truncate-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-truncate-words.js","sourceRoot":"","sources":["../../src/strings/string-truncate-words.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,QAAgB,EAAE,MAAM,GAAG,GAAG;IACzE,IAAI,QAAQ,GAAG,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,+BAA+B,CAAC,CAAC;IACxE,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-concepts.d.ts","sourceRoot":"","sources":["../../src/urls/url-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,aAAa,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-concepts.js","sourceRoot":"","sources":["../../src/urls/url-concepts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,OAAO,EAAC,aAAa,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function isUrl(value: string): boolean;
|
|
2
|
+
export declare function joinUrl(base: string, ...parts: string[]): string;
|
|
3
|
+
export declare function getQueryParam(url: string | URL, key: string): string | null;
|
|
4
|
+
export declare function setQueryParam(url: string | URL, key: string, value: string): string;
|
|
5
|
+
//# sourceMappingURL=url-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-operations.d.ts","sourceRoot":"","sources":["../../src/urls/url-operations.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,KAAK,EAAC,MAAM,GAAE,OAAO,CAAsD;AACjG,wBAAgB,OAAO,CAAC,IAAI,EAAC,MAAM,EAAC,GAAG,KAAK,EAAC,MAAM,EAAE,GAAE,MAAM,CAAyL;AACtP,wBAAgB,aAAa,CAAC,GAAG,EAAC,MAAM,GAAC,GAAG,EAAC,GAAG,EAAC,MAAM,GAAE,MAAM,GAAC,IAAI,CAA4C;AAChH,wBAAgB,aAAa,CAAC,GAAG,EAAC,MAAM,GAAC,GAAG,EAAC,GAAG,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAE,MAAM,CAAwF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function isUrl(value) { try {
|
|
2
|
+
new URL(value);
|
|
3
|
+
return true;
|
|
4
|
+
}
|
|
5
|
+
catch {
|
|
6
|
+
return false;
|
|
7
|
+
} }
|
|
8
|
+
export function joinUrl(base, ...parts) { const normalizedBase = base.replace(/\/+$/, ""); const normalizedParts = parts.map(part => part.replace(/^\/+|\/+$/g, "")); return [normalizedBase, ...normalizedParts].filter(Boolean).join("/"); }
|
|
9
|
+
export function getQueryParam(url, key) { return new URL(url).searchParams.get(key); }
|
|
10
|
+
export function setQueryParam(url, key, value) { const result = new URL(url); result.searchParams.set(key, value); return result.toString(); }
|
|
11
|
+
//# sourceMappingURL=url-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url-operations.js","sourceRoot":"","sources":["../../src/urls/url-operations.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK,CAAC,KAAY,IAAU,IAAG,CAAC;IAAA,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAAA,OAAO,IAAI,CAAC;AAAA,CAAC;AAAA,MAAK,CAAC;IAAA,OAAO,KAAK,CAAC;AAAA,CAAC,CAAA,CAAC;AACjG,MAAM,UAAU,OAAO,CAAC,IAAW,EAAC,GAAG,KAAc,IAAS,MAAM,cAAc,GAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAC,EAAE,CAAC,CAAC,CAAA,MAAM,eAAe,GAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAA,EAAE,CAAA,IAAI,CAAC,OAAO,CAAC,YAAY,EAAC,EAAE,CAAC,CAAC,CAAC,CAAA,OAAO,CAAC,cAAc,EAAC,GAAG,eAAe,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA,CAAC;AACtP,MAAM,UAAU,aAAa,CAAC,GAAc,EAAC,GAAU,IAAc,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA,CAAC;AAChH,MAAM,UAAU,aAAa,CAAC,GAAc,EAAC,GAAU,EAAC,KAAY,IAAS,MAAM,MAAM,GAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAC,KAAK,CAAC,CAAC,CAAA,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAA,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dinilmusick/gutts",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Global Utilities for TypeScript applications.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/index.js",
|
|
11
|
+
"./json": "./dist/json/json-concepts.js",
|
|
12
|
+
"./strings": "./dist/strings/string-concepts.js",
|
|
13
|
+
"./arrays": "./dist/arrays/array-concepts.js",
|
|
14
|
+
"./objects": "./dist/objects/object-concepts.js",
|
|
15
|
+
"./numbers": "./dist/numbers/number-concepts.js",
|
|
16
|
+
"./urls": "./dist/urls/url-concepts.js"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.json",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
22
|
+
"prepublishOnly": "pnpm run build"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"lodash-es": "^4.17.21",
|
|
26
|
+
"validator": "^13.15.15"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/lodash-es": "^4.17.12",
|
|
30
|
+
"@types/validator": "^13.12.2",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"vitest": "^3.2.4"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
41
|
+
},
|
|
42
|
+
"packageManager": "pnpm@9.15.0",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/dinilmusick/GutTS.git"
|
|
46
|
+
},
|
|
47
|
+
"license": "MIT"
|
|
48
|
+
}
|