feedcanon 1.5.1 → 1.5.2

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/defaults.cjs CHANGED
@@ -170,8 +170,7 @@ const defaultNormalizeOptions = {
170
170
  stripEmptyQuery: true,
171
171
  lowercaseQuery: false,
172
172
  normalizeEncoding: true,
173
- normalizeUnicode: true,
174
- convertToPunycode: true
173
+ normalizeUnicode: true
175
174
  };
176
175
  const defaultFetch = async (url, options) => {
177
176
  const response = await fetch(url, {
@@ -241,8 +240,7 @@ const defaultTiers = [
241
240
  stripQuery: true,
242
241
  stripEmptyQuery: true,
243
242
  normalizeEncoding: true,
244
- normalizeUnicode: true,
245
- convertToPunycode: true
243
+ normalizeUnicode: true
246
244
  },
247
245
  {
248
246
  stripProtocol: false,
@@ -256,8 +254,7 @@ const defaultTiers = [
256
254
  stripQuery: false,
257
255
  stripEmptyQuery: true,
258
256
  normalizeEncoding: true,
259
- normalizeUnicode: true,
260
- convertToPunycode: true
257
+ normalizeUnicode: true
261
258
  },
262
259
  {
263
260
  stripProtocol: false,
@@ -271,8 +268,7 @@ const defaultTiers = [
271
268
  stripQuery: false,
272
269
  stripEmptyQuery: true,
273
270
  normalizeEncoding: true,
274
- normalizeUnicode: true,
275
- convertToPunycode: true
271
+ normalizeUnicode: true
276
272
  },
277
273
  {
278
274
  stripProtocol: false,
@@ -286,8 +282,7 @@ const defaultTiers = [
286
282
  stripQuery: false,
287
283
  stripEmptyQuery: true,
288
284
  normalizeEncoding: true,
289
- normalizeUnicode: true,
290
- convertToPunycode: true
285
+ normalizeUnicode: true
291
286
  }
292
287
  ];
293
288
  //#endregion
package/dist/defaults.js CHANGED
@@ -169,8 +169,7 @@ const defaultNormalizeOptions = {
169
169
  stripEmptyQuery: true,
170
170
  lowercaseQuery: false,
171
171
  normalizeEncoding: true,
172
- normalizeUnicode: true,
173
- convertToPunycode: true
172
+ normalizeUnicode: true
174
173
  };
175
174
  const defaultFetch = async (url, options) => {
176
175
  const response = await fetch(url, {
@@ -240,8 +239,7 @@ const defaultTiers = [
240
239
  stripQuery: true,
241
240
  stripEmptyQuery: true,
242
241
  normalizeEncoding: true,
243
- normalizeUnicode: true,
244
- convertToPunycode: true
242
+ normalizeUnicode: true
245
243
  },
246
244
  {
247
245
  stripProtocol: false,
@@ -255,8 +253,7 @@ const defaultTiers = [
255
253
  stripQuery: false,
256
254
  stripEmptyQuery: true,
257
255
  normalizeEncoding: true,
258
- normalizeUnicode: true,
259
- convertToPunycode: true
256
+ normalizeUnicode: true
260
257
  },
261
258
  {
262
259
  stripProtocol: false,
@@ -270,8 +267,7 @@ const defaultTiers = [
270
267
  stripQuery: false,
271
268
  stripEmptyQuery: true,
272
269
  normalizeEncoding: true,
273
- normalizeUnicode: true,
274
- convertToPunycode: true
270
+ normalizeUnicode: true
275
271
  },
276
272
  {
277
273
  stripProtocol: false,
@@ -285,8 +281,7 @@ const defaultTiers = [
285
281
  stripQuery: false,
286
282
  stripEmptyQuery: true,
287
283
  normalizeEncoding: true,
288
- normalizeUnicode: true,
289
- convertToPunycode: true
284
+ normalizeUnicode: true
290
285
  }
291
286
  ];
292
287
  //#endregion
package/dist/types.d.cts CHANGED
@@ -31,7 +31,6 @@ type NormalizeOptions = {
31
31
  lowercaseQuery?: boolean;
32
32
  normalizeEncoding?: boolean;
33
33
  normalizeUnicode?: boolean;
34
- convertToPunycode?: boolean;
35
34
  };
36
35
  type Tier = Omit<NormalizeOptions, 'stripQueryParams'>;
37
36
  type OnFetchFn<TResponse extends FetchFnResponse = FetchFnResponse> = (data: {
package/dist/types.d.ts CHANGED
@@ -31,7 +31,6 @@ type NormalizeOptions = {
31
31
  lowercaseQuery?: boolean;
32
32
  normalizeEncoding?: boolean;
33
33
  normalizeUnicode?: boolean;
34
- convertToPunycode?: boolean;
35
34
  };
36
35
  type Tier = Omit<NormalizeOptions, 'stripQueryParams'>;
37
36
  type OnFetchFn<TResponse extends FetchFnResponse = FetchFnResponse> = (data: {
package/dist/utils.cjs CHANGED
@@ -1,5 +1,4 @@
1
1
  const require_defaults = require("./defaults.cjs");
2
- let node_url = require("node:url");
3
2
  let entities = require("entities");
4
3
  //#region src/utils.ts
5
4
  const strippedParamsCache = /* @__PURE__ */ new WeakMap();
@@ -15,7 +14,6 @@ const ipv4Regex = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
15
14
  const ipv6Regex = /^([0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}$/i;
16
15
  const safePathCharsRegex = /[a-zA-Z0-9._~!$&'()*+,;=:@-]/;
17
16
  const httpsLetterRegex = /s/i;
18
- const nonAsciiHostnameRegex = /[^a-z0-9.:-]/;
19
17
  const protocolPrefixRegex = /^https?:\/\//;
20
18
  const wwwPrefixRegex = /^www\./;
21
19
  const validUrlRegex = /^https?:\/\/(?:www\.|[a-vx-z0-9])/i;
@@ -115,10 +113,6 @@ const normalizeUrl = (url, options = require_defaults.defaultNormalizeOptions) =
115
113
  parsed.hostname = parsed.hostname.normalize("NFC");
116
114
  parsed.pathname = parsed.pathname.normalize("NFC");
117
115
  }
118
- if (options.convertToPunycode && nonAsciiHostnameRegex.test(parsed.hostname)) {
119
- const ascii = (0, node_url.domainToASCII)(parsed.hostname);
120
- if (ascii) parsed.hostname = ascii;
121
- }
122
116
  if (options.stripAuthentication) {
123
117
  parsed.username = "";
124
118
  parsed.password = "";
package/dist/utils.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { defaultNormalizeOptions } from "./defaults.js";
2
- import { domainToASCII } from "node:url";
3
2
  import { decodeHTML } from "entities";
4
3
  //#region src/utils.ts
5
4
  const strippedParamsCache = /* @__PURE__ */ new WeakMap();
@@ -15,7 +14,6 @@ const ipv4Regex = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
15
14
  const ipv6Regex = /^([0-9a-f]{0,4}:){2,7}[0-9a-f]{0,4}$/i;
16
15
  const safePathCharsRegex = /[a-zA-Z0-9._~!$&'()*+,;=:@-]/;
17
16
  const httpsLetterRegex = /s/i;
18
- const nonAsciiHostnameRegex = /[^a-z0-9.:-]/;
19
17
  const protocolPrefixRegex = /^https?:\/\//;
20
18
  const wwwPrefixRegex = /^www\./;
21
19
  const validUrlRegex = /^https?:\/\/(?:www\.|[a-vx-z0-9])/i;
@@ -115,10 +113,6 @@ const normalizeUrl = (url, options = defaultNormalizeOptions) => {
115
113
  parsed.hostname = parsed.hostname.normalize("NFC");
116
114
  parsed.pathname = parsed.pathname.normalize("NFC");
117
115
  }
118
- if (options.convertToPunycode && nonAsciiHostnameRegex.test(parsed.hostname)) {
119
- const ascii = domainToASCII(parsed.hostname);
120
- if (ascii) parsed.hostname = ascii;
121
- }
122
116
  if (options.stripAuthentication) {
123
117
  parsed.username = "";
124
118
  parsed.password = "";
package/package.json CHANGED
@@ -64,5 +64,5 @@
64
64
  "tsdown": "^0.21.7",
65
65
  "vitepress": "^2.0.0-alpha.17"
66
66
  },
67
- "version": "1.5.1"
67
+ "version": "1.5.2"
68
68
  }