@sanity/util 6.13.1 → 6.13.2-next.3
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/lib/client.d.ts +1 -2
- package/lib/concurrency-limiter.d.ts +1 -2
- package/lib/content.d.ts +7 -8
- package/lib/createSafeJsonParser.d.ts +1 -2
- package/lib/fs.d.ts +3 -4
- package/lib/legacyDateFormat.d.ts +6 -6
- package/lib/paths.d.ts +18 -19
- package/package.json +3 -3
package/lib/client.d.ts
CHANGED
|
@@ -4,6 +4,5 @@ import { SanityClient } from "@sanity/client";
|
|
|
4
4
|
* requests. Keeps the concurrency limit state and returns wrapped clients with
|
|
5
5
|
* that same state if the `clone` `config` or `withConfig` methods are called.
|
|
6
6
|
*/
|
|
7
|
-
declare function createClientConcurrencyLimiter(maxConcurrency: number, defaultSignal?: AbortSignal): (input: SanityClient) => SanityClient;
|
|
8
|
-
export { createClientConcurrencyLimiter };
|
|
7
|
+
export declare function createClientConcurrencyLimiter(maxConcurrency: number, defaultSignal?: AbortSignal): (input: SanityClient) => SanityClient;
|
|
9
8
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ConcurrencyLimiter manages the number of concurrent operations that can be performed.
|
|
3
3
|
* It ensures that the number of operations does not exceed a specified maximum limit.
|
|
4
4
|
*/
|
|
5
|
-
declare class ConcurrencyLimiter {
|
|
5
|
+
export declare class ConcurrencyLimiter {
|
|
6
6
|
current: number;
|
|
7
7
|
resolvers: Array<{
|
|
8
8
|
resolve: () => void;
|
|
@@ -25,5 +25,4 @@ declare class ConcurrencyLimiter {
|
|
|
25
25
|
*/
|
|
26
26
|
release: () => void;
|
|
27
27
|
}
|
|
28
|
-
export { ConcurrencyLimiter };
|
|
29
28
|
//# sourceMappingURL=concurrency-limiter.d.ts.map
|
package/lib/content.d.ts
CHANGED
|
@@ -10,28 +10,27 @@ declare function isDeepEmptyArray(value: unknown[]): boolean;
|
|
|
10
10
|
* - an array where all items are deeply empty
|
|
11
11
|
* @param value - the value to check for deep emptiness
|
|
12
12
|
*/
|
|
13
|
-
declare function isDeepEmpty(value: unknown): boolean;
|
|
13
|
+
export declare function isDeepEmpty(value: unknown): boolean;
|
|
14
14
|
/**
|
|
15
15
|
* @deprecated Use `isDeepEmpty` instead
|
|
16
16
|
* todo: remove in v4
|
|
17
17
|
*/
|
|
18
|
-
declare const isEmptyArray: typeof isDeepEmptyArray;
|
|
18
|
+
export declare const isEmptyArray: typeof isDeepEmptyArray;
|
|
19
19
|
/**
|
|
20
20
|
* @deprecated Use `isDeepEmpty` instead
|
|
21
21
|
* todo: remove in v4
|
|
22
22
|
* @alias
|
|
23
23
|
*/
|
|
24
|
-
declare const isEmpty: typeof isDeepEmpty;
|
|
24
|
+
export declare const isEmpty: typeof isDeepEmpty;
|
|
25
25
|
/**
|
|
26
26
|
* @deprecated Use `isDeepEmpty` instead
|
|
27
27
|
* todo: remove in v4
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
|
-
declare const isEmptyObject: typeof isDeepEmptyObject;
|
|
31
|
-
declare function isShallowEmptyObject(value: {
|
|
30
|
+
export declare const isEmptyObject: typeof isDeepEmptyObject;
|
|
31
|
+
export declare function isShallowEmptyObject(value: {
|
|
32
32
|
[key: string]: unknown;
|
|
33
33
|
}): boolean;
|
|
34
|
-
declare function randomKey(length?: number): string;
|
|
35
|
-
declare function resolveTypeName(value: unknown): string;
|
|
36
|
-
export { isDeepEmpty, isEmpty, isEmptyArray, isEmptyObject, isShallowEmptyObject, randomKey, resolveTypeName };
|
|
34
|
+
export declare function randomKey(length?: number): string;
|
|
35
|
+
export declare function resolveTypeName(value: unknown): string;
|
|
37
36
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -10,6 +10,5 @@ type Parser<Type> = (line: string) => Type;
|
|
|
10
10
|
* @internal
|
|
11
11
|
* @see {@link https://github.com/sanity-io/sanity/pull/1787 | Initial pull request}
|
|
12
12
|
*/
|
|
13
|
-
declare function createSafeJsonParser<Type>({ errorLabel }: Options): Parser<Type>;
|
|
14
|
-
export { createSafeJsonParser };
|
|
13
|
+
export declare function createSafeJsonParser<Type>({ errorLabel }: Options): Parser<Type>;
|
|
15
14
|
//# sourceMappingURL=createSafeJsonParser.d.ts.map
|
package/lib/fs.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
declare function pathIsEmpty(dir: string): Promise<boolean>;
|
|
2
|
-
declare function expandHome(filePath: string): string;
|
|
3
|
-
declare function absolutify(dir: string): string;
|
|
4
|
-
export { absolutify, expandHome, pathIsEmpty };
|
|
1
|
+
export declare function pathIsEmpty(dir: string): Promise<boolean>;
|
|
2
|
+
export declare function expandHome(filePath: string): string;
|
|
3
|
+
export declare function absolutify(dir: string): string;
|
|
5
4
|
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const sanitizeLocale: (locale: string) => string;
|
|
2
|
-
declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
3
|
-
declare const DEFAULT_TIME_FORMAT = "HH:mm";
|
|
2
|
+
export declare const DEFAULT_DATE_FORMAT = "YYYY-MM-DD";
|
|
3
|
+
export declare const DEFAULT_TIME_FORMAT = "HH:mm";
|
|
4
4
|
type ParseResult = {
|
|
5
5
|
isValid: boolean;
|
|
6
6
|
date?: Date;
|
|
@@ -12,11 +12,11 @@ type ParseResult = {
|
|
|
12
12
|
isValid: false;
|
|
13
13
|
error?: string;
|
|
14
14
|
});
|
|
15
|
-
declare function format(input: Date, dateFormat: string, options?: {
|
|
15
|
+
export declare function format(input: Date, dateFormat: string, options?: {
|
|
16
16
|
useUTC?: boolean;
|
|
17
17
|
timeZone?: string;
|
|
18
18
|
}): string;
|
|
19
|
-
declare function parse(dateString: string, dateFormat?: string, timeZone?: string): ParseResult;
|
|
20
|
-
declare function isValidTimeZoneString(timeZone: string): boolean;
|
|
21
|
-
export {
|
|
19
|
+
export declare function parse(dateString: string, dateFormat?: string, timeZone?: string): ParseResult;
|
|
20
|
+
export declare function isValidTimeZoneString(timeZone: string): boolean;
|
|
21
|
+
export { type ParseResult, sanitizeLocale };
|
|
22
22
|
//# sourceMappingURL=legacyDateFormat.d.ts.map
|
package/lib/paths.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Path, PathSegment } from "@sanity/types";
|
|
2
|
-
declare const FOCUS_TERMINATOR = "$";
|
|
3
|
-
declare function get<R>(obj: unknown, path: Path | string): R | undefined;
|
|
4
|
-
declare function get<R>(obj: unknown, path: Path | string, defaultValue: R): R;
|
|
5
|
-
declare function pathFor(path: Path): Path;
|
|
6
|
-
declare function isEqual(path: Path, otherPath: Path): boolean;
|
|
7
|
-
declare function numEqualSegments(path: Path, otherPath: Path): number;
|
|
8
|
-
declare function isSegmentEqual(segmentA: PathSegment, segmentB: PathSegment): boolean;
|
|
9
|
-
declare function hasFocus(focusPath: Path, path: Path): boolean;
|
|
10
|
-
declare function hasItemFocus(focusPath: Path, item: PathSegment): boolean;
|
|
11
|
-
declare function isExpanded(segment: PathSegment, focusPath: Path): boolean;
|
|
12
|
-
declare function startsWith(prefix: Path, path: Path): boolean;
|
|
13
|
-
declare function trimLeft(prefix: Path, path: Path): Path;
|
|
14
|
-
declare function trimRight(suffix: Path, path: Path): Path;
|
|
15
|
-
declare function trimChildPath(path: Path, childPath: Path): Path;
|
|
16
|
-
declare function toString(path: Path): string;
|
|
17
|
-
declare function _resolveKeyedPath(value: unknown, path: Path): Path;
|
|
2
|
+
export declare const FOCUS_TERMINATOR = "$";
|
|
3
|
+
export declare function get<R>(obj: unknown, path: Path | string): R | undefined;
|
|
4
|
+
export declare function get<R>(obj: unknown, path: Path | string, defaultValue: R): R;
|
|
5
|
+
export declare function pathFor(path: Path): Path;
|
|
6
|
+
export declare function isEqual(path: Path, otherPath: Path): boolean;
|
|
7
|
+
export declare function numEqualSegments(path: Path, otherPath: Path): number;
|
|
8
|
+
export declare function isSegmentEqual(segmentA: PathSegment, segmentB: PathSegment): boolean;
|
|
9
|
+
export declare function hasFocus(focusPath: Path, path: Path): boolean;
|
|
10
|
+
export declare function hasItemFocus(focusPath: Path, item: PathSegment): boolean;
|
|
11
|
+
export declare function isExpanded(segment: PathSegment, focusPath: Path): boolean;
|
|
12
|
+
export declare function startsWith(prefix: Path, path: Path): boolean;
|
|
13
|
+
export declare function trimLeft(prefix: Path, path: Path): Path;
|
|
14
|
+
export declare function trimRight(suffix: Path, path: Path): Path;
|
|
15
|
+
export declare function trimChildPath(path: Path, childPath: Path): Path;
|
|
16
|
+
export declare function toString(path: Path): string;
|
|
17
|
+
export declare function _resolveKeyedPath(value: unknown, path: Path): Path;
|
|
18
18
|
/**
|
|
19
19
|
* Takes a value and a path that may include numeric indices and attempts to replace numeric indices with keyed paths
|
|
20
20
|
*
|
|
@@ -27,7 +27,6 @@ declare function _resolveKeyedPath(value: unknown, path: Path): Path;
|
|
|
27
27
|
* - `resolveKeyedPath([0, 'foo', 'bar'], [{_key: 'xyz'}])` will return `[{_key: 'xyz'}, 'foo', 'bar']` since array has no value at index 0
|
|
28
28
|
* Object keys will be preserved as-is, e.g. `resolveKeyedPath(['foo', 'bar'], undefined)` will return `['foo', 'bar']`
|
|
29
29
|
*/
|
|
30
|
-
declare function resolveKeyedPath(value: unknown, path: Path): Path;
|
|
31
|
-
declare function fromString(path: string): Path;
|
|
32
|
-
export { FOCUS_TERMINATOR, _resolveKeyedPath, fromString, get, hasFocus, hasItemFocus, isEqual, isExpanded, isSegmentEqual, numEqualSegments, pathFor, resolveKeyedPath, startsWith, toString, trimChildPath, trimLeft, trimRight };
|
|
30
|
+
export declare function resolveKeyedPath(value: unknown, path: Path): Path;
|
|
31
|
+
export declare function fromString(path: string): Path;
|
|
33
32
|
//# sourceMappingURL=paths.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/util",
|
|
3
|
-
"version": "6.13.
|
|
3
|
+
"version": "6.13.2-next.3",
|
|
4
4
|
"description": "Utilities shared across projects of Sanity",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@date-fns/tz": "^1.5.0",
|
|
68
68
|
"@date-fns/utc": "^2.1.1",
|
|
69
69
|
"@sanity/client": "^8.6.1",
|
|
70
|
-
"@sanity/types": "6.13.
|
|
70
|
+
"@sanity/types": "6.13.2-next.3+54095cc4db",
|
|
71
71
|
"date-fns": "^4.4.0",
|
|
72
72
|
"get-it": "^9.5.4",
|
|
73
73
|
"rxjs": "^7.8.2"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@repo/tsconfig": "6.9.2",
|
|
78
78
|
"@repo/tsdown.config": "6.9.2",
|
|
79
79
|
"@types/node": "^24.13.3",
|
|
80
|
-
"tsdown": "^0.
|
|
80
|
+
"tsdown": "^0.23.0",
|
|
81
81
|
"typescript": "^7.0.2",
|
|
82
82
|
"vite": "^8.2.2",
|
|
83
83
|
"vitest": "^4.1.11"
|