trousse 3.5.0 → 3.6.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/objects.js CHANGED
@@ -14,7 +14,7 @@ const setKey = (object, key, value) => {
14
14
  };
15
15
  const pick = (object, keys) => {
16
16
  const result = {};
17
- for (const key of keys) if (key in object) setKey(result, key, object[key]);
17
+ for (const key of keys) if (Object.hasOwn(object, key)) setKey(result, key, object[key]);
18
18
  return result;
19
19
  };
20
20
  const omit = (object, keys) => {
package/dist/urls.d.ts CHANGED
@@ -18,8 +18,9 @@ export declare const hasFragmentParam: (source: ParamSource | undefined, name: s
18
18
  export declare const getFragmentParamValues: (source: ParamSource | undefined, name: string, options?: ParamOptions) => Array<string>;
19
19
  export declare const getFragmentParam: (source: ParamSource | undefined, name: string, options?: ParamOptions) => string | undefined;
20
20
  export declare const getFragmentParams: (source: ParamSource | undefined, names: ReadonlyArray<string>, options?: ParamOptions) => Record<string, string>;
21
- export declare const composeQuery: (params?: Record<string, string | number>) => string;
22
- export declare const composeFragment: (params?: Record<string, string | number>) => string;
21
+ type QueryValue = string | number | true;
22
+ export declare const composeQuery: (params?: Record<string, QueryValue>) => string;
23
+ export declare const composeFragment: (params?: Record<string, QueryValue>) => string;
23
24
  export declare const fixMalformedScheme: (url: string) => string;
24
25
  export declare const fixMalformedQuery: (url: string) => string;
25
26
  export declare const trimUrlValues: (url: string) => string;
@@ -40,4 +41,5 @@ export declare const resolveFeedProtocol: typeof resolveFeedScheme;
40
41
  /** @deprecated Use `addMissingScheme` instead. */
41
42
  export declare const addMissingProtocol: typeof addMissingScheme;
42
43
  /** @deprecated Use `upgradeScheme` instead. */
43
- export declare const upgradeProtocol: typeof upgradeScheme;
44
+ export declare const upgradeProtocol: typeof upgradeScheme;
45
+ export {};
package/dist/urls.js CHANGED
@@ -183,6 +183,10 @@ const composePairs = (params) => {
183
183
  };
184
184
  const pairs = [];
185
185
  for (const [name, value] of Object.entries(params ?? {})) {
186
+ if (value === true) {
187
+ pairs.push(escapePart(name));
188
+ continue;
189
+ }
186
190
  const text = String(value);
187
191
  if (!text) continue;
188
192
  pairs.push(`${escapePart(name)}=${escapePart(text)}`);
package/package.json CHANGED
@@ -40,11 +40,11 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/bun": "^1.4.2",
43
- "kvalita": "^1.30.0",
43
+ "kvalita": "^1.31.0",
44
44
  "tsdown": "0.23.1"
45
45
  },
46
46
  "dependencies": {
47
47
  "entities": "^8.1.0"
48
48
  },
49
- "version": "3.5.0"
49
+ "version": "3.6.0"
50
50
  }