@augment-vir/common 17.0.0 → 18.0.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.urlToSearchParamsObject = exports.objectToSearchParamsString = void 0;
|
|
4
4
|
const boolean_1 = require("../boolean");
|
|
5
5
|
const matches_object_shape_1 = require("../object/matches-object-shape");
|
|
6
6
|
const runtime_type_of_1 = require("../runtime-type-of");
|
|
@@ -21,7 +21,7 @@ function objectToSearchParamsString(inputObject) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.objectToSearchParamsString = objectToSearchParamsString;
|
|
24
|
-
function
|
|
24
|
+
function urlToSearchParamsObject(inputUrl, verifyShape) {
|
|
25
25
|
const urlForSearchParams = (0, runtime_type_of_1.isRuntimeTypeOf)(inputUrl, 'string') ? new URL(inputUrl) : inputUrl;
|
|
26
26
|
const searchEntries = Array.from(urlForSearchParams.searchParams.entries());
|
|
27
27
|
const paramsObject = Object.fromEntries(searchEntries);
|
|
@@ -30,4 +30,4 @@ function searchParamStringToObject(inputUrl, verifyShape) {
|
|
|
30
30
|
}
|
|
31
31
|
return paramsObject;
|
|
32
32
|
}
|
|
33
|
-
exports.
|
|
33
|
+
exports.urlToSearchParamsObject = urlToSearchParamsObject;
|
|
@@ -17,7 +17,7 @@ export function objectToSearchParamsString(inputObject) {
|
|
|
17
17
|
return '';
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
export function
|
|
20
|
+
export function urlToSearchParamsObject(inputUrl, verifyShape) {
|
|
21
21
|
const urlForSearchParams = isRuntimeTypeOf(inputUrl, 'string') ? new URL(inputUrl) : inputUrl;
|
|
22
22
|
const searchEntries = Array.from(urlForSearchParams.searchParams.entries());
|
|
23
23
|
const paramsObject = Object.fromEntries(searchEntries);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Primitive } from 'type-fest';
|
|
2
2
|
export type SearchParamObjectBase = Record<string, Exclude<Primitive, symbol>>;
|
|
3
3
|
export declare function objectToSearchParamsString(inputObject: SearchParamObjectBase): string;
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function urlToSearchParamsObject<VerifyShapeGeneric extends SearchParamObjectBase>(inputUrl: string | Pick<URL, 'searchParams'>, verifyShape: VerifyShapeGeneric): VerifyShapeGeneric;
|
|
5
|
+
export declare function urlToSearchParamsObject<VerifyShapeGeneric extends SearchParamObjectBase>(inputUrl: string | Pick<URL, 'searchParams'>, verifyShape?: VerifyShapeGeneric | undefined): Record<string, string>;
|