@expofp/config 3.43.1 → 3.44.1
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.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/url-intents.d.ts +10 -0
- package/dist/lib/url-intents.js +14 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { type StorageLike } from './lib/local-storage-codec.js';
|
|
|
8
8
|
export { type ConfigResourceStore, serializationFormat, serializeConfigResources, SERIALIZER_VERSION, } from './lib/serialize-config-resources.js';
|
|
9
9
|
export { compactUrl, resolveUrl } from './lib/store-ref.js';
|
|
10
10
|
export { parseFromUrlTolerant } from './lib/url-codec.js';
|
|
11
|
-
export { parseIntentsFromUrl } from './lib/url-intents.js';
|
|
11
|
+
export { parseIntentsFromUrl, serializeIntentToUrl } from './lib/url-intents.js';
|
|
12
12
|
export { type Config, type Consent, type Manifest, type Options } from '@expofp/schema';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -9,4 +9,4 @@ export { loadConfig } from './lib/load-config.js';
|
|
|
9
9
|
export { serializationFormat, serializeConfigResources, SERIALIZER_VERSION, } from './lib/serialize-config-resources.js';
|
|
10
10
|
export { compactUrl, resolveUrl } from './lib/store-ref.js';
|
|
11
11
|
export { parseFromUrlTolerant } from './lib/url-codec.js';
|
|
12
|
-
export { parseIntentsFromUrl } from './lib/url-intents.js';
|
|
12
|
+
export { parseIntentsFromUrl, serializeIntentToUrl } from './lib/url-intents.js';
|
|
@@ -27,4 +27,14 @@ export declare function parseIntentsFromUrl(input: string | URL): {
|
|
|
27
27
|
intents: Intent[];
|
|
28
28
|
invalidKeys: string[];
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* The shortcut form of one intent, without the leading `?`: the name is the
|
|
32
|
+
* key, and a 1-tuple's sole argument (else the whole args tuple) is the value;
|
|
33
|
+
* empty args give the bare key. {@link parseIntentsFromUrl} reads back what
|
|
34
|
+
* the floor plan writes (`showSessions` with a filter on), but this is not a
|
|
35
|
+
* general inverse — the query carries no types, so an empty object or string
|
|
36
|
+
* argument, or a number in a string-or-number field, can come back changed or
|
|
37
|
+
* be dropped.
|
|
38
|
+
*/
|
|
39
|
+
export declare function serializeIntentToUrl(intent: Intent): string;
|
|
30
40
|
//# sourceMappingURL=url-intents.d.ts.map
|
package/dist/lib/url-intents.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { IntentsSchema } from '@expofp/schema';
|
|
19
19
|
import { coerceValue, toJsonSchema } from './json-schema.js';
|
|
20
|
-
import { deflattenQuery } from './url-codec.js';
|
|
20
|
+
import { deflattenQuery, toQueryString } from './url-codec.js';
|
|
21
21
|
const intentNames = new Set(IntentsSchema.options.map((arm) => arm.shape.name.value));
|
|
22
22
|
/**
|
|
23
23
|
* Extract shortcut intents from a page URL, in first-occurrence param order.
|
|
@@ -56,3 +56,16 @@ export function parseIntentsFromUrl(input) {
|
|
|
56
56
|
}
|
|
57
57
|
return { intents, invalidKeys };
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* The shortcut form of one intent, without the leading `?`: the name is the
|
|
61
|
+
* key, and a 1-tuple's sole argument (else the whole args tuple) is the value;
|
|
62
|
+
* empty args give the bare key. {@link parseIntentsFromUrl} reads back what
|
|
63
|
+
* the floor plan writes (`showSessions` with a filter on), but this is not a
|
|
64
|
+
* general inverse — the query carries no types, so an empty object or string
|
|
65
|
+
* argument, or a number in a string-or-number field, can come back changed or
|
|
66
|
+
* be dropped.
|
|
67
|
+
*/
|
|
68
|
+
export function serializeIntentToUrl(intent) {
|
|
69
|
+
const value = intent.args.length === 1 ? intent.args[0] : intent.args;
|
|
70
|
+
return toQueryString({ [intent.name]: value }) || intent.name;
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expofp/config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.44.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "ExpoFP SDK internal: config layer and schemas",
|
|
6
6
|
"homepage": "https://developer.expofp.com/",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"debug": "^4.4.3",
|
|
30
30
|
"tslib": "^2.3.0",
|
|
31
31
|
"zod": "4.4.3",
|
|
32
|
-
"@expofp/resolve": "3.
|
|
33
|
-
"@expofp/schema": "3.
|
|
34
|
-
"@expofp/utils": "3.
|
|
32
|
+
"@expofp/resolve": "3.44.1",
|
|
33
|
+
"@expofp/schema": "3.44.1",
|
|
34
|
+
"@expofp/utils": "3.44.1"
|
|
35
35
|
}
|
|
36
36
|
}
|