@pezkuwi/x-textdecoder 14.0.6 → 14.0.7

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.
Files changed (77) hide show
  1. package/package.json +185 -4
  2. package/build/README.md +0 -12
  3. package/build/browser.js +0 -4
  4. package/build/cjs/browser.d.ts +0 -5
  5. package/build/cjs/browser.js +0 -8
  6. package/build/cjs/fallback.js +0 -17
  7. package/build/cjs/node.js +0 -9
  8. package/build/cjs/packageInfo.js +0 -4
  9. package/build/cjs/react-native.js +0 -4
  10. package/build/cjs/shim.js +0 -5
  11. package/build/cjs/typeCheck.js +0 -6
  12. package/build/fallback.d.ts +0 -5
  13. package/build/fallback.js +0 -13
  14. package/build/node.d.ts +0 -5
  15. package/build/node.js +0 -4
  16. package/build/package.json +0 -207
  17. package/build/packageInfo.d.ts +0 -6
  18. package/build/packageInfo.js +0 -1
  19. package/build/react-native.d.ts +0 -1
  20. package/build/react-native.js +0 -1
  21. package/build/shim.d.ts +0 -1
  22. package/build/shim.js +0 -3
  23. package/build/typeCheck.d.ts +0 -1
  24. package/build/typeCheck.js +0 -4
  25. package/build-deno/README.md +0 -12
  26. package/build-deno/browser.ts +0 -8
  27. package/build-deno/fallback.ts +0 -18
  28. package/build-deno/mod.ts +0 -2
  29. package/build-deno/node.ts +0 -8
  30. package/build-deno/packageInfo.ts +0 -3
  31. package/build-deno/react-native.ts +0 -2
  32. package/build-deno/shim.ts +0 -5
  33. package/build-deno/typeCheck.ts +0 -6
  34. package/src/browser.ts +0 -10
  35. package/src/fallback.spec.ts +0 -20
  36. package/src/fallback.ts +0 -21
  37. package/src/mod.ts +0 -4
  38. package/src/node.spec.ts +0 -25
  39. package/src/node.ts +0 -10
  40. package/src/packageInfo.ts +0 -6
  41. package/src/react-native.ts +0 -4
  42. package/src/shim.ts +0 -7
  43. package/src/typeCheck.ts +0 -8
  44. package/tsconfig.build.json +0 -15
  45. package/tsconfig.build.tsbuildinfo +0 -1
  46. package/tsconfig.spec.json +0 -17
  47. package/tsconfig.spec.tsbuildinfo +0 -1
  48. /package/{build/LICENSE → LICENSE} +0 -0
  49. /package/{build-tsc/browser.d.ts → browser.d.ts} +0 -0
  50. /package/{build-tsc-esm/browser.js → browser.js} +0 -0
  51. /package/{build → cjs}/browser.d.ts +0 -0
  52. /package/{build-tsc-cjs → cjs}/browser.js +0 -0
  53. /package/{build-tsc → cjs}/fallback.d.ts +0 -0
  54. /package/{build-tsc-cjs → cjs}/fallback.js +0 -0
  55. /package/{build-tsc → cjs}/node.d.ts +0 -0
  56. /package/{build-tsc-cjs → cjs}/node.js +0 -0
  57. /package/{build/cjs → cjs}/package.json +0 -0
  58. /package/{build-tsc → cjs}/packageInfo.d.ts +0 -0
  59. /package/{build-tsc-cjs → cjs}/packageInfo.js +0 -0
  60. /package/{build-tsc → cjs}/react-native.d.ts +0 -0
  61. /package/{build-tsc-cjs → cjs}/react-native.js +0 -0
  62. /package/{build-tsc → cjs}/shim.d.ts +0 -0
  63. /package/{build-tsc-cjs → cjs}/shim.js +0 -0
  64. /package/{build-tsc → cjs}/typeCheck.d.ts +0 -0
  65. /package/{build-tsc-cjs → cjs}/typeCheck.js +0 -0
  66. /package/{build/cjs/fallback.d.ts → fallback.d.ts} +0 -0
  67. /package/{build-tsc-esm/fallback.js → fallback.js} +0 -0
  68. /package/{build/cjs/node.d.ts → node.d.ts} +0 -0
  69. /package/{build-tsc-esm/node.js → node.js} +0 -0
  70. /package/{build/cjs/packageInfo.d.ts → packageInfo.d.ts} +0 -0
  71. /package/{build-tsc-esm/packageInfo.js → packageInfo.js} +0 -0
  72. /package/{build/cjs/react-native.d.ts → react-native.d.ts} +0 -0
  73. /package/{build-tsc-esm/react-native.js → react-native.js} +0 -0
  74. /package/{build/cjs/shim.d.ts → shim.d.ts} +0 -0
  75. /package/{build-tsc-esm/shim.js → shim.js} +0 -0
  76. /package/{build/cjs/typeCheck.d.ts → typeCheck.d.ts} +0 -0
  77. /package/{build-tsc-esm/typeCheck.js → typeCheck.js} +0 -0
package/package.json CHANGED
@@ -15,10 +15,191 @@
15
15
  },
16
16
  "sideEffects": false,
17
17
  "type": "module",
18
- "version": "14.0.6",
19
- "browser": "browser.js",
20
- "main": "node.js",
21
- "react-native": "react-native.js",
18
+ "version": "14.0.7",
19
+ "main": "./cjs/node.js",
20
+ "module": "./node.js",
21
+ "browser": "./cjs/browser.js",
22
+ "react-native": "./cjs/react-native.js",
23
+ "types": "./node.d.ts",
24
+ "exports": {
25
+ "./cjs/package.json": "./cjs/package.json",
26
+ "./cjs/*": "./cjs/*.js",
27
+ ".": {
28
+ "types": "./node.d.ts",
29
+ "react-native": {
30
+ "module": {
31
+ "types": "./react-native.d.ts",
32
+ "default": "./react-native.js"
33
+ },
34
+ "require": {
35
+ "types": "./cjs/react-native.d.ts",
36
+ "default": "./cjs/react-native.js"
37
+ },
38
+ "default": {
39
+ "types": "./react-native.d.ts",
40
+ "default": "./react-native.js"
41
+ }
42
+ },
43
+ "browser": {
44
+ "module": {
45
+ "types": "./browser.d.ts",
46
+ "default": "./browser.js"
47
+ },
48
+ "require": {
49
+ "types": "./cjs/browser.d.ts",
50
+ "default": "./cjs/browser.js"
51
+ },
52
+ "default": {
53
+ "types": "./browser.d.ts",
54
+ "default": "./browser.js"
55
+ }
56
+ },
57
+ "node": {
58
+ "module": {
59
+ "types": "./node.d.ts",
60
+ "default": "./node.js"
61
+ },
62
+ "require": {
63
+ "types": "./cjs/node.d.ts",
64
+ "default": "./cjs/node.js"
65
+ },
66
+ "default": {
67
+ "types": "./node.d.ts",
68
+ "default": "./node.js"
69
+ }
70
+ }
71
+ },
72
+ "./browser": {
73
+ "module": {
74
+ "types": "./browser.d.ts",
75
+ "default": "./browser.js"
76
+ },
77
+ "require": {
78
+ "types": "./cjs/browser.d.ts",
79
+ "default": "./cjs/browser.js"
80
+ },
81
+ "default": {
82
+ "types": "./browser.d.ts",
83
+ "default": "./browser.js"
84
+ }
85
+ },
86
+ "./fallback": {
87
+ "module": {
88
+ "types": "./fallback.d.ts",
89
+ "default": "./fallback.js"
90
+ },
91
+ "require": {
92
+ "types": "./cjs/fallback.d.ts",
93
+ "default": "./cjs/fallback.js"
94
+ },
95
+ "default": {
96
+ "types": "./fallback.d.ts",
97
+ "default": "./fallback.js"
98
+ }
99
+ },
100
+ "./node": {
101
+ "module": {
102
+ "types": "./node.d.ts",
103
+ "default": "./node.js"
104
+ },
105
+ "require": {
106
+ "types": "./cjs/node.d.ts",
107
+ "default": "./cjs/node.js"
108
+ },
109
+ "default": {
110
+ "types": "./node.d.ts",
111
+ "default": "./node.js"
112
+ }
113
+ },
114
+ "./package.json": {
115
+ "require": "./cjs/package.json",
116
+ "default": "./package.json"
117
+ },
118
+ "./packageInfo.js": {
119
+ "module": {
120
+ "types": "./packageInfo.d.ts",
121
+ "default": "./packageInfo.js"
122
+ },
123
+ "require": {
124
+ "types": "./cjs/packageInfo.d.ts",
125
+ "default": "./cjs/packageInfo.js"
126
+ },
127
+ "default": {
128
+ "types": "./packageInfo.d.ts",
129
+ "default": "./packageInfo.js"
130
+ }
131
+ },
132
+ "./packageInfo": {
133
+ "module": {
134
+ "types": "./packageInfo.d.ts",
135
+ "default": "./packageInfo.js"
136
+ },
137
+ "require": {
138
+ "types": "./cjs/packageInfo.d.ts",
139
+ "default": "./cjs/packageInfo.js"
140
+ },
141
+ "default": {
142
+ "types": "./packageInfo.d.ts",
143
+ "default": "./packageInfo.js"
144
+ }
145
+ },
146
+ "./react-native": {
147
+ "module": {
148
+ "types": "./react-native.d.ts",
149
+ "default": "./react-native.js"
150
+ },
151
+ "require": {
152
+ "types": "./cjs/react-native.d.ts",
153
+ "default": "./cjs/react-native.js"
154
+ },
155
+ "default": {
156
+ "types": "./react-native.d.ts",
157
+ "default": "./react-native.js"
158
+ }
159
+ },
160
+ "./shim.js": {
161
+ "module": {
162
+ "types": "./shim.d.ts",
163
+ "default": "./shim.js"
164
+ },
165
+ "require": {
166
+ "types": "./cjs/shim.d.ts",
167
+ "default": "./cjs/shim.js"
168
+ },
169
+ "default": {
170
+ "types": "./shim.d.ts",
171
+ "default": "./shim.js"
172
+ }
173
+ },
174
+ "./shim": {
175
+ "module": {
176
+ "types": "./shim.d.ts",
177
+ "default": "./shim.js"
178
+ },
179
+ "require": {
180
+ "types": "./cjs/shim.d.ts",
181
+ "default": "./cjs/shim.js"
182
+ },
183
+ "default": {
184
+ "types": "./shim.d.ts",
185
+ "default": "./shim.js"
186
+ }
187
+ },
188
+ "./typeCheck": {
189
+ "module": {
190
+ "types": "./typeCheck.d.ts",
191
+ "default": "./typeCheck.js"
192
+ },
193
+ "require": {
194
+ "types": "./cjs/typeCheck.d.ts",
195
+ "default": "./cjs/typeCheck.js"
196
+ },
197
+ "default": {
198
+ "types": "./typeCheck.d.ts",
199
+ "default": "./typeCheck.js"
200
+ }
201
+ }
202
+ },
22
203
  "dependencies": {
23
204
  "@pezkuwi/x-global": "14.0.1",
24
205
  "tslib": "^2.8.0"
package/build/README.md DELETED
@@ -1,12 +0,0 @@
1
- # @pezkuwi/x-textdecoder
2
-
3
- A cross-environment TextDecoder.
4
-
5
- Install it via `yarn add @pezkuwi/x-textdecoder`
6
-
7
- ```js
8
- import { TextDecoder } from '@pezkuwi/x-textdecoder';
9
-
10
- ...
11
- const decoder = new TextDecoder('utf-8');
12
- ```
package/build/browser.js DELETED
@@ -1,4 +0,0 @@
1
- import { extractGlobal } from '@pezkuwi/x-global';
2
- import { TextDecoder as Fallback } from './fallback.js';
3
- export { packageInfo } from './packageInfo.js';
4
- export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', Fallback);
@@ -1,5 +0,0 @@
1
- export { packageInfo } from './packageInfo.js';
2
- export declare const TextDecoder: {
3
- new (label?: string, options?: TextDecoderOptions): TextDecoder;
4
- prototype: TextDecoder;
5
- };
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextDecoder = exports.packageInfo = void 0;
4
- const x_global_1 = require("@pezkuwi/x-global");
5
- const fallback_js_1 = require("./fallback.js");
6
- var packageInfo_js_1 = require("./packageInfo.js");
7
- Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
8
- exports.TextDecoder = (0, x_global_1.extractGlobal)('TextDecoder', fallback_js_1.TextDecoder);
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextDecoder = void 0;
4
- class TextDecoder {
5
- __encoding;
6
- constructor(encoding) {
7
- this.__encoding = encoding;
8
- }
9
- decode(value) {
10
- let result = '';
11
- for (let i = 0, count = value.length; i < count; i++) {
12
- result += String.fromCharCode(value[i]);
13
- }
14
- return result;
15
- }
16
- }
17
- exports.TextDecoder = TextDecoder;
package/build/cjs/node.js DELETED
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextDecoder = exports.packageInfo = void 0;
4
- const tslib_1 = require("tslib");
5
- const node_util_1 = tslib_1.__importDefault(require("node:util"));
6
- const x_global_1 = require("@pezkuwi/x-global");
7
- var packageInfo_js_1 = require("./packageInfo.js");
8
- Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
9
- exports.TextDecoder = (0, x_global_1.extractGlobal)('TextDecoder', node_util_1.default.TextDecoder);
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.packageInfo = void 0;
4
- exports.packageInfo = { name: '@pezkuwi/x-textdecoder', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '14.0.6' };
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./browser.js"), exports);
package/build/cjs/shim.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const x_global_1 = require("@pezkuwi/x-global");
4
- const x_textdecoder_1 = require("@pezkuwi/x-textdecoder");
5
- (0, x_global_1.exposeGlobal)('TextDecoder', x_textdecoder_1.TextDecoder);
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const browser_js_1 = require("./browser.js");
4
- const node_js_1 = require("./node.js");
5
- console.log(new browser_js_1.TextDecoder('utf-8').decode(new Uint8Array([1, 2, 3])));
6
- console.log(new node_js_1.TextDecoder('utf-8').decode(new Uint8Array([1, 2, 3])));
@@ -1,5 +0,0 @@
1
- export declare class TextDecoder {
2
- __encoding?: string;
3
- constructor(encoding?: 'utf-8' | 'utf8');
4
- decode(value: Uint8Array): string;
5
- }
package/build/fallback.js DELETED
@@ -1,13 +0,0 @@
1
- export class TextDecoder {
2
- __encoding;
3
- constructor(encoding) {
4
- this.__encoding = encoding;
5
- }
6
- decode(value) {
7
- let result = '';
8
- for (let i = 0, count = value.length; i < count; i++) {
9
- result += String.fromCharCode(value[i]);
10
- }
11
- return result;
12
- }
13
- }
package/build/node.d.ts DELETED
@@ -1,5 +0,0 @@
1
- export { packageInfo } from './packageInfo.js';
2
- export declare const TextDecoder: {
3
- new (label?: string, options?: TextDecoderOptions): TextDecoder;
4
- prototype: TextDecoder;
5
- };
package/build/node.js DELETED
@@ -1,4 +0,0 @@
1
- import util from 'node:util';
2
- import { extractGlobal } from '@pezkuwi/x-global';
3
- export { packageInfo } from './packageInfo.js';
4
- export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', util.TextDecoder);
@@ -1,207 +0,0 @@
1
- {
2
- "author": "Jaco Greeff <jacogr@gmail.com>",
3
- "bugs": "https://github.com/pezkuwichain/pezkuwi-common/issues",
4
- "description": "A TextDecoder replacement",
5
- "engines": {
6
- "node": ">=18"
7
- },
8
- "homepage": "https://github.com/pezkuwichain/pezkuwi-common/tree/master/packages/x-textdecoder#readme",
9
- "license": "Apache-2.0",
10
- "name": "@pezkuwi/x-textdecoder",
11
- "repository": {
12
- "directory": "packages/x-textdecoder",
13
- "type": "git",
14
- "url": "https://github.com/pezkuwichain/pezkuwi-common.git"
15
- },
16
- "sideEffects": false,
17
- "type": "module",
18
- "version": "14.0.6",
19
- "main": "./cjs/node.js",
20
- "module": "./node.js",
21
- "browser": "./cjs/browser.js",
22
- "react-native": "./cjs/react-native.js",
23
- "types": "./node.d.ts",
24
- "exports": {
25
- "./cjs/package.json": "./cjs/package.json",
26
- "./cjs/*": "./cjs/*.js",
27
- ".": {
28
- "types": "./node.d.ts",
29
- "react-native": {
30
- "module": {
31
- "types": "./react-native.d.ts",
32
- "default": "./react-native.js"
33
- },
34
- "require": {
35
- "types": "./cjs/react-native.d.ts",
36
- "default": "./cjs/react-native.js"
37
- },
38
- "default": {
39
- "types": "./react-native.d.ts",
40
- "default": "./react-native.js"
41
- }
42
- },
43
- "browser": {
44
- "module": {
45
- "types": "./browser.d.ts",
46
- "default": "./browser.js"
47
- },
48
- "require": {
49
- "types": "./cjs/browser.d.ts",
50
- "default": "./cjs/browser.js"
51
- },
52
- "default": {
53
- "types": "./browser.d.ts",
54
- "default": "./browser.js"
55
- }
56
- },
57
- "node": {
58
- "module": {
59
- "types": "./node.d.ts",
60
- "default": "./node.js"
61
- },
62
- "require": {
63
- "types": "./cjs/node.d.ts",
64
- "default": "./cjs/node.js"
65
- },
66
- "default": {
67
- "types": "./node.d.ts",
68
- "default": "./node.js"
69
- }
70
- }
71
- },
72
- "./browser": {
73
- "module": {
74
- "types": "./browser.d.ts",
75
- "default": "./browser.js"
76
- },
77
- "require": {
78
- "types": "./cjs/browser.d.ts",
79
- "default": "./cjs/browser.js"
80
- },
81
- "default": {
82
- "types": "./browser.d.ts",
83
- "default": "./browser.js"
84
- }
85
- },
86
- "./fallback": {
87
- "module": {
88
- "types": "./fallback.d.ts",
89
- "default": "./fallback.js"
90
- },
91
- "require": {
92
- "types": "./cjs/fallback.d.ts",
93
- "default": "./cjs/fallback.js"
94
- },
95
- "default": {
96
- "types": "./fallback.d.ts",
97
- "default": "./fallback.js"
98
- }
99
- },
100
- "./node": {
101
- "module": {
102
- "types": "./node.d.ts",
103
- "default": "./node.js"
104
- },
105
- "require": {
106
- "types": "./cjs/node.d.ts",
107
- "default": "./cjs/node.js"
108
- },
109
- "default": {
110
- "types": "./node.d.ts",
111
- "default": "./node.js"
112
- }
113
- },
114
- "./package.json": {
115
- "require": "./cjs/package.json",
116
- "default": "./package.json"
117
- },
118
- "./packageInfo.js": {
119
- "module": {
120
- "types": "./packageInfo.d.ts",
121
- "default": "./packageInfo.js"
122
- },
123
- "require": {
124
- "types": "./cjs/packageInfo.d.ts",
125
- "default": "./cjs/packageInfo.js"
126
- },
127
- "default": {
128
- "types": "./packageInfo.d.ts",
129
- "default": "./packageInfo.js"
130
- }
131
- },
132
- "./packageInfo": {
133
- "module": {
134
- "types": "./packageInfo.d.ts",
135
- "default": "./packageInfo.js"
136
- },
137
- "require": {
138
- "types": "./cjs/packageInfo.d.ts",
139
- "default": "./cjs/packageInfo.js"
140
- },
141
- "default": {
142
- "types": "./packageInfo.d.ts",
143
- "default": "./packageInfo.js"
144
- }
145
- },
146
- "./react-native": {
147
- "module": {
148
- "types": "./react-native.d.ts",
149
- "default": "./react-native.js"
150
- },
151
- "require": {
152
- "types": "./cjs/react-native.d.ts",
153
- "default": "./cjs/react-native.js"
154
- },
155
- "default": {
156
- "types": "./react-native.d.ts",
157
- "default": "./react-native.js"
158
- }
159
- },
160
- "./shim.js": {
161
- "module": {
162
- "types": "./shim.d.ts",
163
- "default": "./shim.js"
164
- },
165
- "require": {
166
- "types": "./cjs/shim.d.ts",
167
- "default": "./cjs/shim.js"
168
- },
169
- "default": {
170
- "types": "./shim.d.ts",
171
- "default": "./shim.js"
172
- }
173
- },
174
- "./shim": {
175
- "module": {
176
- "types": "./shim.d.ts",
177
- "default": "./shim.js"
178
- },
179
- "require": {
180
- "types": "./cjs/shim.d.ts",
181
- "default": "./cjs/shim.js"
182
- },
183
- "default": {
184
- "types": "./shim.d.ts",
185
- "default": "./shim.js"
186
- }
187
- },
188
- "./typeCheck": {
189
- "module": {
190
- "types": "./typeCheck.d.ts",
191
- "default": "./typeCheck.js"
192
- },
193
- "require": {
194
- "types": "./cjs/typeCheck.d.ts",
195
- "default": "./cjs/typeCheck.js"
196
- },
197
- "default": {
198
- "types": "./typeCheck.d.ts",
199
- "default": "./typeCheck.js"
200
- }
201
- }
202
- },
203
- "dependencies": {
204
- "@pezkuwi/x-global": "14.0.1",
205
- "tslib": "^2.8.0"
206
- }
207
- }
@@ -1,6 +0,0 @@
1
- export declare const packageInfo: {
2
- name: string;
3
- path: string;
4
- type: string;
5
- version: string;
6
- };
@@ -1 +0,0 @@
1
- export const packageInfo = { name: '@pezkuwi/x-textdecoder', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '14.0.6' };
@@ -1 +0,0 @@
1
- export * from './browser.js';
@@ -1 +0,0 @@
1
- export * from './browser.js';
package/build/shim.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/build/shim.js DELETED
@@ -1,3 +0,0 @@
1
- import { exposeGlobal } from '@pezkuwi/x-global';
2
- import { TextDecoder } from '@pezkuwi/x-textdecoder';
3
- exposeGlobal('TextDecoder', TextDecoder);
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { TextDecoder as BrowserTD } from './browser.js';
2
- import { TextDecoder as NodeTD } from './node.js';
3
- console.log(new BrowserTD('utf-8').decode(new Uint8Array([1, 2, 3])));
4
- console.log(new NodeTD('utf-8').decode(new Uint8Array([1, 2, 3])));
@@ -1,12 +0,0 @@
1
- # @pezkuwi/x-textdecoder
2
-
3
- A cross-environment TextDecoder.
4
-
5
- Install it via `yarn add @pezkuwi/x-textdecoder`
6
-
7
- ```js
8
- import { TextDecoder } from 'https://deno.land/x/pezkuwi/x-textdecoder/mod.ts';
9
-
10
- ...
11
- const decoder = new TextDecoder('utf-8');
12
- ```
@@ -1,8 +0,0 @@
1
-
2
- import { extractGlobal } from 'https://deno.land/x/pezkuwi/x-global/mod.ts';
3
-
4
- import { TextDecoder as Fallback } from './fallback.ts';
5
-
6
- export { packageInfo } from './packageInfo.ts';
7
-
8
- export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', Fallback);
@@ -1,18 +0,0 @@
1
-
2
- export class TextDecoder {
3
- __encoding?: string;
4
-
5
- constructor (encoding?: 'utf-8' | 'utf8') {
6
- this.__encoding = encoding;
7
- }
8
-
9
- decode (value: Uint8Array): string {
10
- let result = '';
11
-
12
- for (let i = 0, count = value.length; i < count; i++) {
13
- result += String.fromCharCode(value[i]);
14
- }
15
-
16
- return result;
17
- }
18
- }
package/build-deno/mod.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export * from './browser.ts';
@@ -1,8 +0,0 @@
1
-
2
- import util from 'node:util';
3
-
4
- import { extractGlobal } from 'https://deno.land/x/pezkuwi/x-global/mod.ts';
5
-
6
- export { packageInfo } from './packageInfo.ts';
7
-
8
- export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', util.TextDecoder);
@@ -1,3 +0,0 @@
1
-
2
-
3
- export const packageInfo = { name: '@pezkuwi/x-textdecoder', path: new URL(import.meta.url).pathname, type: 'deno', version: '14.0.6' };
@@ -1,2 +0,0 @@
1
-
2
- export * from './browser.ts';
@@ -1,5 +0,0 @@
1
-
2
- import { exposeGlobal } from 'https://deno.land/x/pezkuwi/x-global/mod.ts';
3
- import { TextDecoder } from 'https://deno.land/x/pezkuwi/x-textdecoder/mod.ts';
4
-
5
- exposeGlobal('TextDecoder', TextDecoder);
@@ -1,6 +0,0 @@
1
-
2
- import { TextDecoder as BrowserTD } from './browser.ts';
3
- import { TextDecoder as NodeTD } from './node.ts';
4
-
5
- console.log(new BrowserTD('utf-8').decode(new Uint8Array([1, 2, 3])));
6
- console.log(new NodeTD('utf-8').decode(new Uint8Array([1, 2, 3])));
package/src/browser.ts DELETED
@@ -1,10 +0,0 @@
1
- // Copyright 2017-2025 @pezkuwi/x-textencoder authors & contributors
2
- // SPDX-License-Identifier: Apache-2.0
3
-
4
- import { extractGlobal } from '@pezkuwi/x-global';
5
-
6
- import { TextDecoder as Fallback } from './fallback.js';
7
-
8
- export { packageInfo } from './packageInfo.js';
9
-
10
- export const TextDecoder = /*#__PURE__*/ extractGlobal('TextDecoder', Fallback);