quasiurl 1.1.2 → 1.1.4

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.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Unlike URL, QuasiURL:
3
+ * - can have an empty `origin`, `pathname`, `hostname`, `protocol`;
4
+ * - preserves templating characters without URL-encoding them.
5
+ */
6
+ export declare class QuasiURL {
7
+ _protocol: string;
8
+ _hostname: string;
9
+ _port: string;
10
+ _pathname: string;
11
+ _search: string;
12
+ _hash: string;
13
+ constructor(url: string);
14
+ get href(): string;
15
+ set href(value: string);
16
+ get protocol(): string;
17
+ set protocol(value: string);
18
+ get hostname(): string;
19
+ set hostname(value: string);
20
+ get port(): string;
21
+ set port(value: string | number);
22
+ get host(): string;
23
+ set host(value: string);
24
+ get origin(): string;
25
+ set origin(value: string);
26
+ get pathname(): string;
27
+ set pathname(value: string);
28
+ get search(): string;
29
+ set search(value: string | URLSearchParams);
30
+ get hash(): string;
31
+ set hash(value: string);
32
+ toString(): string;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "quasiurl",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "URL for templating",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
7
8
  "scripts": {
8
- "build": "npx npm-run-all clean -p compile compile-tests",
9
+ "build": "npx npm-run-all clean -p compile compile-tests -s types",
9
10
  "clean": "node -e \"require('node:fs').rmSync('dist', { force: true, recursive: true });\"",
10
11
  "compile": "npx esbuild index.ts --bundle --outdir=dist --platform=neutral",
11
12
  "compile-tests": "npx esbuild tests.ts --bundle --outdir=dist --platform=neutral",
@@ -13,7 +14,8 @@
13
14
  "preversion": "npx npm-run-all typecheck shape build test",
14
15
  "shape": "npx codeshape",
15
16
  "test": "node dist/tests.js",
16
- "typecheck": "tsc --noEmit"
17
+ "typecheck": "tsc --noEmit",
18
+ "types": "tsc --emitDeclarationOnly"
17
19
  },
18
20
  "author": "axtk",
19
21
  "license": "MIT",
package/tsconfig.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
- "include": ["index.ts", "tests.ts"],
2
+ "include": ["./index.ts", "./tests.ts"],
3
3
  "compilerOptions": {
4
+ "declaration": true,
5
+ "emitDeclarationOnly": true,
4
6
  "lib": ["ESNext", "DOM"],
5
- "target": "ESNext",
7
+ "target": "esnext",
6
8
  "outDir": "dist",
7
- "moduleResolution": "node",
9
+ "module": "nodenext",
10
+ "moduleResolution": "nodenext",
11
+ "allowImportingTsExtensions": true,
8
12
  "strict": true,
9
13
  "noUnusedLocals": true,
10
14
  "noUnusedParameters": true