@xylabs/url 5.0.82 → 5.0.84

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/README.md CHANGED
@@ -41,16 +41,22 @@ Base functionality used throughout XY Labs TypeScript/JavaScript libraries
41
41
  function isLocalhost(hostname): boolean;
42
42
  ```
43
43
 
44
+ Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).
45
+
44
46
  ## Parameters
45
47
 
46
48
  ### hostname
47
49
 
48
50
  `string`
49
51
 
52
+ The hostname to check
53
+
50
54
  ## Returns
51
55
 
52
56
  `boolean`
53
57
 
58
+ `true` if the hostname is a localhost address
59
+
54
60
  ### variables
55
61
 
56
62
  ### <a id="URL"></a>URL
@@ -63,6 +69,8 @@ function isLocalhost(hostname): boolean;
63
69
  const URL: (url, base?) => URL;
64
70
  ```
65
71
 
72
+ Browser-specific URL class, aliased from the global `URL`.
73
+
66
74
  ## Parameters
67
75
 
68
76
  ### url
@@ -91,6 +99,8 @@ const URL: (url, base?) => URL;
91
99
  const URL: (url, base?) => URL;
92
100
  ```
93
101
 
102
+ Platform-neutral URL class, aliased from the global `URL`.
103
+
94
104
  ## Parameters
95
105
 
96
106
  ### url
@@ -119,6 +129,8 @@ const URL: (url, base?) => URL;
119
129
  const URL: (url, base?) => URL;
120
130
  ```
121
131
 
132
+ Node.js-specific URL class, imported from the `node:url` module.
133
+
122
134
  ## Parameters
123
135
 
124
136
  ### url
@@ -1,3 +1,4 @@
1
+ /** Browser-specific URL class, aliased from the global `URL`. */
1
2
  declare const BrowserUrl: {
2
3
  new (url: string | URL, base?: string | URL): URL;
3
4
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/isLocalhost.ts","../../src/index-browser.ts"],"sourcesContent":["export const isLocalhost = (hostname: string): boolean => {\n return (\n hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname === '::1' // IPv6 localhost\n || hostname.endsWith('.localhost')\n )\n}\n","/// <reference lib=\"dom\" />\nconst BrowserUrl = URL\nexport { BrowserUrl as URL }\nexport * from './lib/index.ts'\n"],"mappings":";AAAO,IAAM,cAAc,CAAC,aAA8B;AACxD,SACE,aAAa,eACV,aAAa,eACb,aAAa,SACb,SAAS,SAAS,YAAY;AAErC;;;ACNA,IAAM,aAAa;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/isLocalhost.ts","../../src/index-browser.ts"],"sourcesContent":["/**\n * Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).\n * @param hostname - The hostname to check\n * @returns `true` if the hostname is a localhost address\n */\nexport const isLocalhost = (hostname: string): boolean => {\n return (\n hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname === '::1' // IPv6 localhost\n || hostname.endsWith('.localhost')\n )\n}\n","/// <reference lib=\"dom\" />\n/** Browser-specific URL class, aliased from the global `URL`. */\nconst BrowserUrl = URL\nexport { BrowserUrl as URL }\nexport * from './lib/index.ts'\n"],"mappings":";AAKO,IAAM,cAAc,CAAC,aAA8B;AACxD,SACE,aAAa,eACV,aAAa,eACb,aAAa,SACb,SAAS,SAAS,YAAY;AAErC;;;ACVA,IAAM,aAAa;","names":[]}
@@ -1,3 +1,4 @@
1
+ /** Platform-neutral URL class, aliased from the global `URL`. */
1
2
  declare const NeutralUrl: {
2
3
  new (url: string | URL, base?: string | URL): URL;
3
4
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-neutral.d.ts","sourceRoot":"","sources":["../../src/index-neutral.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-neutral.d.ts","sourceRoot":"","sources":["../../src/index-neutral.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { URL } from 'node:url';
2
+ /** Node.js-specific URL class, imported from the `node:url` module. */
2
3
  declare const NodeUrl: {
3
4
  new (url: string | URL, base?: string | URL): URL;
4
5
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,QAAA,MAAM,OAAO;;;;;;;CAAM,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,uEAAuE;AACvE,QAAA,MAAM,OAAO;;;;;;;CAAM,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).
3
+ * @param hostname - The hostname to check
4
+ * @returns `true` if the hostname is a localhost address
5
+ */
1
6
  export declare const isLocalhost: (hostname: string) => boolean;
2
7
  //# sourceMappingURL=isLocalhost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isLocalhost.d.ts","sourceRoot":"","sources":["../../../src/lib/isLocalhost.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,OAO9C,CAAA"}
1
+ {"version":3,"file":"isLocalhost.d.ts","sourceRoot":"","sources":["../../../src/lib/isLocalhost.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,OAO9C,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** Browser-specific URL class, aliased from the global `URL`. */
1
2
  declare const BrowserUrl: {
2
3
  new (url: string | URL, base?: string | URL): URL;
3
4
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** Platform-neutral URL class, aliased from the global `URL`. */
1
2
  declare const NeutralUrl: {
2
3
  new (url: string | URL, base?: string | URL): URL;
3
4
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-neutral.d.ts","sourceRoot":"","sources":["../../src/index-neutral.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-neutral.d.ts","sourceRoot":"","sources":["../../src/index-neutral.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/isLocalhost.ts","../../src/index-neutral.ts"],"sourcesContent":["export const isLocalhost = (hostname: string): boolean => {\n return (\n hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname === '::1' // IPv6 localhost\n || hostname.endsWith('.localhost')\n )\n}\n","/// <reference lib=\"dom\" />\nconst NeutralUrl = URL\nexport { NeutralUrl as URL }\nexport * from './lib/index.ts'\n"],"mappings":";AAAO,IAAM,cAAc,CAAC,aAA8B;AACxD,SACE,aAAa,eACV,aAAa,eACb,aAAa,SACb,SAAS,SAAS,YAAY;AAErC;;;ACNA,IAAM,aAAa;","names":[]}
1
+ {"version":3,"sources":["../../src/lib/isLocalhost.ts","../../src/index-neutral.ts"],"sourcesContent":["/**\n * Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).\n * @param hostname - The hostname to check\n * @returns `true` if the hostname is a localhost address\n */\nexport const isLocalhost = (hostname: string): boolean => {\n return (\n hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname === '::1' // IPv6 localhost\n || hostname.endsWith('.localhost')\n )\n}\n","/// <reference lib=\"dom\" />\n/** Platform-neutral URL class, aliased from the global `URL`. */\nconst NeutralUrl = URL\nexport { NeutralUrl as URL }\nexport * from './lib/index.ts'\n"],"mappings":";AAKO,IAAM,cAAc,CAAC,aAA8B;AACxD,SACE,aAAa,eACV,aAAa,eACb,aAAa,SACb,SAAS,SAAS,YAAY;AAErC;;;ACVA,IAAM,aAAa;","names":[]}
@@ -1,4 +1,5 @@
1
1
  import { URL } from 'node:url';
2
+ /** Node.js-specific URL class, imported from the `node:url` module. */
2
3
  declare const NodeUrl: {
3
4
  new (url: string | URL, base?: string | URL): URL;
4
5
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,QAAA,MAAM,OAAO;;;;;;;CAAM,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,uEAAuE;AACvE,QAAA,MAAM,OAAO;;;;;;;CAAM,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).
3
+ * @param hostname - The hostname to check
4
+ * @returns `true` if the hostname is a localhost address
5
+ */
1
6
  export declare const isLocalhost: (hostname: string) => boolean;
2
7
  //# sourceMappingURL=isLocalhost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isLocalhost.d.ts","sourceRoot":"","sources":["../../../src/lib/isLocalhost.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,OAO9C,CAAA"}
1
+ {"version":3,"file":"isLocalhost.d.ts","sourceRoot":"","sources":["../../../src/lib/isLocalhost.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,OAO9C,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** Browser-specific URL class, aliased from the global `URL`. */
1
2
  declare const BrowserUrl: {
2
3
  new (url: string | URL, base?: string | URL): URL;
3
4
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-browser.d.ts","sourceRoot":"","sources":["../../src/index-browser.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -1,3 +1,4 @@
1
+ /** Platform-neutral URL class, aliased from the global `URL`. */
1
2
  declare const NeutralUrl: {
2
3
  new (url: string | URL, base?: string | URL): URL;
3
4
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-neutral.d.ts","sourceRoot":"","sources":["../../src/index-neutral.ts"],"names":[],"mappings":"AACA,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-neutral.d.ts","sourceRoot":"","sources":["../../src/index-neutral.ts"],"names":[],"mappings":"AACA,iEAAiE;AACjE,QAAA,MAAM,UAAU;;;;;;;CAAM,CAAA;AACtB,OAAO,EAAE,UAAU,IAAI,GAAG,EAAE,CAAA;AAC5B,cAAc,gBAAgB,CAAA"}
@@ -1,4 +1,5 @@
1
1
  import { URL } from 'node:url';
2
+ /** Node.js-specific URL class, imported from the `node:url` module. */
2
3
  declare const NodeUrl: {
3
4
  new (url: string | URL, base?: string | URL): URL;
4
5
  prototype: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,QAAA,MAAM,OAAO;;;;;;;CAAM,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../../src/index-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAE9B,uEAAuE;AACvE,QAAA,MAAM,OAAO;;;;;;;CAAM,CAAA;AACnB,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index-node.ts","../../src/lib/isLocalhost.ts"],"sourcesContent":["import { URL } from 'node:url'\n\nconst NodeUrl = URL\nexport { NodeUrl as URL }\nexport * from './lib/index.ts'\n","export const isLocalhost = (hostname: string): boolean => {\n return (\n hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname === '::1' // IPv6 localhost\n || hostname.endsWith('.localhost')\n )\n}\n"],"mappings":";AAAA,SAAS,WAAW;;;ACAb,IAAM,cAAc,CAAC,aAA8B;AACxD,SACE,aAAa,eACV,aAAa,eACb,aAAa,SACb,SAAS,SAAS,YAAY;AAErC;;;ADLA,IAAM,UAAU;","names":[]}
1
+ {"version":3,"sources":["../../src/index-node.ts","../../src/lib/isLocalhost.ts"],"sourcesContent":["import { URL } from 'node:url'\n\n/** Node.js-specific URL class, imported from the `node:url` module. */\nconst NodeUrl = URL\nexport { NodeUrl as URL }\nexport * from './lib/index.ts'\n","/**\n * Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).\n * @param hostname - The hostname to check\n * @returns `true` if the hostname is a localhost address\n */\nexport const isLocalhost = (hostname: string): boolean => {\n return (\n hostname === 'localhost'\n || hostname === '127.0.0.1'\n || hostname === '::1' // IPv6 localhost\n || hostname.endsWith('.localhost')\n )\n}\n"],"mappings":";AAAA,SAAS,WAAW;;;ACKb,IAAM,cAAc,CAAC,aAA8B;AACxD,SACE,aAAa,eACV,aAAa,eACb,aAAa,SACb,SAAS,SAAS,YAAY;AAErC;;;ADTA,IAAM,UAAU;","names":[]}
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Checks whether a hostname refers to the local machine (localhost, 127.0.0.1, ::1, or *.localhost).
3
+ * @param hostname - The hostname to check
4
+ * @returns `true` if the hostname is a localhost address
5
+ */
1
6
  export declare const isLocalhost: (hostname: string) => boolean;
2
7
  //# sourceMappingURL=isLocalhost.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"isLocalhost.d.ts","sourceRoot":"","sources":["../../../src/lib/isLocalhost.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,OAO9C,CAAA"}
1
+ {"version":3,"file":"isLocalhost.d.ts","sourceRoot":"","sources":["../../../src/lib/isLocalhost.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,UAAU,MAAM,KAAG,OAO9C,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/url",
3
- "version": "5.0.82",
3
+ "version": "5.0.84",
4
4
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
5
5
  "keywords": [
6
6
  "url",
@@ -53,8 +53,8 @@
53
53
  ],
54
54
  "devDependencies": {
55
55
  "@types/node": "~25.4.0",
56
- "@xylabs/ts-scripts-yarn3": "~7.4.11",
57
- "@xylabs/tsconfig": "~7.4.11",
56
+ "@xylabs/ts-scripts-yarn3": "~7.4.13",
57
+ "@xylabs/tsconfig": "~7.4.13",
58
58
  "typescript": "~5.9.3",
59
59
  "vitest": "~4.0.18"
60
60
  },