iconv-tiny 1.0.0 → 1.0.1
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/LICENSE +1 -1
- package/README.md +12 -0
- package/dist/aliases.mjs +1 -1
- package/dist/encodings/ATARIST.d.mts +1 -1
- package/dist/encodings/ATARIST.mjs +1 -1
- package/dist/encodings/CP037.d.mts +1 -1
- package/dist/encodings/CP037.mjs +1 -1
- package/dist/encodings/CP1006.d.mts +1 -1
- package/dist/encodings/CP1006.mjs +1 -1
- package/dist/encodings/CP1026.d.mts +1 -1
- package/dist/encodings/CP1026.mjs +1 -1
- package/dist/encodings/CP1250.d.mts +1 -1
- package/dist/encodings/CP1250.mjs +1 -1
- package/dist/encodings/CP1251.d.mts +1 -1
- package/dist/encodings/CP1251.mjs +1 -1
- package/dist/encodings/CP1252.d.mts +1 -1
- package/dist/encodings/CP1252.mjs +1 -1
- package/dist/encodings/CP1253.d.mts +1 -1
- package/dist/encodings/CP1253.mjs +1 -1
- package/dist/encodings/CP1254.d.mts +1 -1
- package/dist/encodings/CP1254.mjs +1 -1
- package/dist/encodings/CP1255.d.mts +1 -1
- package/dist/encodings/CP1255.mjs +1 -1
- package/dist/encodings/CP1256.d.mts +1 -1
- package/dist/encodings/CP1256.mjs +1 -1
- package/dist/encodings/CP1257.d.mts +1 -1
- package/dist/encodings/CP1257.mjs +1 -1
- package/dist/encodings/CP1258.d.mts +1 -1
- package/dist/encodings/CP1258.mjs +1 -1
- package/dist/encodings/CP424.d.mts +1 -1
- package/dist/encodings/CP424.mjs +1 -1
- package/dist/encodings/CP437.d.mts +1 -1
- package/dist/encodings/CP437.mjs +1 -1
- package/dist/encodings/CP500.d.mts +1 -1
- package/dist/encodings/CP500.mjs +1 -1
- package/dist/encodings/CP737.d.mts +1 -1
- package/dist/encodings/CP737.mjs +1 -1
- package/dist/encodings/CP775.d.mts +1 -1
- package/dist/encodings/CP775.mjs +1 -1
- package/dist/encodings/CP850.d.mts +1 -1
- package/dist/encodings/CP850.mjs +1 -1
- package/dist/encodings/CP852.d.mts +1 -1
- package/dist/encodings/CP852.mjs +1 -1
- package/dist/encodings/CP855.d.mts +1 -1
- package/dist/encodings/CP855.mjs +1 -1
- package/dist/encodings/CP856.d.mts +1 -1
- package/dist/encodings/CP856.mjs +1 -1
- package/dist/encodings/CP857.d.mts +1 -1
- package/dist/encodings/CP857.mjs +1 -1
- package/dist/encodings/CP860.d.mts +1 -1
- package/dist/encodings/CP860.mjs +1 -1
- package/dist/encodings/CP861.d.mts +1 -1
- package/dist/encodings/CP861.mjs +1 -1
- package/dist/encodings/CP862.d.mts +1 -1
- package/dist/encodings/CP862.mjs +1 -1
- package/dist/encodings/CP863.d.mts +1 -1
- package/dist/encodings/CP863.mjs +1 -1
- package/dist/encodings/CP864.d.mts +1 -1
- package/dist/encodings/CP864.mjs +1 -1
- package/dist/encodings/CP865.d.mts +1 -1
- package/dist/encodings/CP865.mjs +1 -1
- package/dist/encodings/CP866.d.mts +1 -1
- package/dist/encodings/CP866.mjs +1 -1
- package/dist/encodings/CP869.d.mts +1 -1
- package/dist/encodings/CP869.mjs +1 -1
- package/dist/encodings/CP874.d.mts +1 -1
- package/dist/encodings/CP874.mjs +1 -1
- package/dist/encodings/CP875.d.mts +1 -1
- package/dist/encodings/CP875.mjs +1 -1
- package/dist/encodings/ISO-8859-1.d.mts +1 -1
- package/dist/encodings/ISO-8859-1.mjs +1 -1
- package/dist/encodings/ISO-8859-10.d.mts +1 -1
- package/dist/encodings/ISO-8859-10.mjs +1 -1
- package/dist/encodings/ISO-8859-11.d.mts +1 -1
- package/dist/encodings/ISO-8859-11.mjs +1 -1
- package/dist/encodings/ISO-8859-13.d.mts +1 -1
- package/dist/encodings/ISO-8859-13.mjs +1 -1
- package/dist/encodings/ISO-8859-14.d.mts +1 -1
- package/dist/encodings/ISO-8859-14.mjs +1 -1
- package/dist/encodings/ISO-8859-15.d.mts +1 -1
- package/dist/encodings/ISO-8859-15.mjs +1 -1
- package/dist/encodings/ISO-8859-16.d.mts +1 -1
- package/dist/encodings/ISO-8859-16.mjs +1 -1
- package/dist/encodings/ISO-8859-2.d.mts +1 -1
- package/dist/encodings/ISO-8859-2.mjs +1 -1
- package/dist/encodings/ISO-8859-3.d.mts +1 -1
- package/dist/encodings/ISO-8859-3.mjs +1 -1
- package/dist/encodings/ISO-8859-4.d.mts +1 -1
- package/dist/encodings/ISO-8859-4.mjs +1 -1
- package/dist/encodings/ISO-8859-5.d.mts +1 -1
- package/dist/encodings/ISO-8859-5.mjs +1 -1
- package/dist/encodings/ISO-8859-6.d.mts +1 -1
- package/dist/encodings/ISO-8859-6.mjs +1 -1
- package/dist/encodings/ISO-8859-7.d.mts +1 -1
- package/dist/encodings/ISO-8859-7.mjs +1 -1
- package/dist/encodings/ISO-8859-8.d.mts +1 -1
- package/dist/encodings/ISO-8859-8.mjs +1 -1
- package/dist/encodings/ISO-8859-9.d.mts +1 -1
- package/dist/encodings/ISO-8859-9.mjs +1 -1
- package/dist/encodings/KOI8-R.d.mts +1 -1
- package/dist/encodings/KOI8-R.mjs +1 -1
- package/dist/encodings/KOI8-U.d.mts +1 -1
- package/dist/encodings/KOI8-U.mjs +1 -1
- package/dist/encodings/KZ1048.d.mts +1 -1
- package/dist/encodings/KZ1048.mjs +1 -1
- package/dist/encodings/MAC-CYRILLIC.d.mts +1 -1
- package/dist/encodings/MAC-CYRILLIC.mjs +1 -1
- package/dist/encodings/MAC-GREEK.d.mts +1 -1
- package/dist/encodings/MAC-GREEK.mjs +1 -1
- package/dist/encodings/MAC-ICELAND.d.mts +1 -1
- package/dist/encodings/MAC-ICELAND.mjs +1 -1
- package/dist/encodings/MAC-LATIN2.d.mts +1 -1
- package/dist/encodings/MAC-LATIN2.mjs +1 -1
- package/dist/encodings/MAC-ROMAN.d.mts +1 -1
- package/dist/encodings/MAC-ROMAN.mjs +1 -1
- package/dist/encodings/MAC-TURKISH.d.mts +1 -1
- package/dist/encodings/MAC-TURKISH.mjs +1 -1
- package/dist/encodings/NEXTSTEP.d.mts +1 -1
- package/dist/encodings/NEXTSTEP.mjs +1 -1
- package/dist/encodings/US-ASCII.d.mts +1 -1
- package/dist/encodings/US-ASCII.mjs +1 -1
- package/dist/encodings/index.d.mts +1 -1
- package/dist/encodings/index.mjs +1 -1
- package/dist/iconv-tiny.bundle.mjs +6 -6
- package/dist/iconv-tiny.mjs +2 -2
- package/dist/sbe.mjs +5 -5
- package/package.json +12 -12
package/dist/encodings/index.mjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file is part of Iconv-Tiny v1.0.
|
|
2
|
+
* This file is part of Iconv-Tiny v1.0.1
|
|
3
3
|
* (c) 2025-present vip.delete
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
// @ts-nocheck
|
|
7
7
|
const sbeNS = {};
|
|
8
8
|
(function(){function q(a){return(new TextDecoder("UTF-16")).decode(a)}function u(a){const b=[];for(let c=0;c<a.length;c+=1024)b.push(String.fromCharCode(...a.subarray(c,c+1024)));return b.join("")}
|
|
9
|
-
function w(a,b){a=new x(a.
|
|
10
|
-
class A{constructor(a,b,c){this.
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function w(a,b){a=new x(a.h);if(b?.graphicMode){var c=b?.graphics?.slice(0,32)??" ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼";for(var d=0;d<c.length;d++)y(a,d,c.charAt(d).charCodeAt(0))}c=b?.overrides??[];for(d=0;d<c.length-1;){let m=c[d++],n=c[d++];m=Number(m)&255;n="number"===typeof n?n:n.charCodeAt(0);y(a,m,n)}c=z(63,b?.defaultCharByte);b=z(65533,b?.defaultCharUnicode);for(d=0;256>d;d++)a.g[d]||(a.h[d]=b);for(b=0;65536>b;b++)a.j[b]||(a.i[b]=c);return a}
|
|
10
|
+
class A{constructor(a,b,c){this.g=a;a=c??"";c=[];let d=0;for(;d<256-b.length;)c[d]=d++;let m=0;for(;256>d;)c[d++]=b.charCodeAt(m++);for(b=0;b<a.length;)c[a.charCodeAt(b)]=a.charCodeAt(b+1),b+=2;this.h=c}create(a){const {i:b,h:c,g:d,j:m}=w(this,a),n=this.g,p=new B;if(!(a?.nativeDecode??!1)||a?.defaultCharUnicode||a?.overrides?.length||a?.graphicMode)var r=0;else try{(new TextDecoder(this.g)).decode(new Uint8Array([0])),r=!0}catch{r=!1}if(r)p.decode=k=>(new TextDecoder(n)).decode(k);else{const k=a?.strictDecode??
|
|
11
|
+
!1?u:q;if("function"===typeof a?.defaultCharUnicode){const f=a.defaultCharUnicode;p.decode=e=>{const g=e.length,h=new Uint16Array(g);for(let l=0;l<g;l++){const t=e[l],v=c[t];h[l]=d[t]?v:f(t,l)??v}return k(h)}}else p.decode=f=>{const e=f.length,g=new Uint16Array(e);for(let h=0;h<e;h++)g[h]=c[f[h]];return k(g)}}if("function"===typeof a?.defaultCharByte){const k=a.defaultCharByte;p.encode=f=>{const e=new Uint8Array(f.length);for(let g=0;g<f.length;g++){const h=f.charCodeAt(g),l=b[h];e[g]=m[h]?l:k(h,
|
|
12
|
+
g)??l}return e}}else p.encode=k=>{const f=new Uint8Array(k.length);for(let e=0;e<k.length;e++)f[e]=b[k.charCodeAt(e)];return f};return p}}class B{decode(){return""}encode(){return new Uint8Array([0])}}function y(a,b,c){65533===c?a.g[b]=0:(a.h[b]=c,a.i[c]=b,a.g[b]=1,a.j[c]=1)}class x{constructor(a){this.h=new Uint16Array(256);this.i=new Uint8Array(65536);this.g=new Uint8Array(256);this.j=new Uint8Array(65536);for(let b=0;256>b;b++)y(this,b,a[b])}}
|
|
13
13
|
function z(a,b){return"string"===typeof b&&0<b.length?b.charCodeAt(0):a};sbeNS.SBEF=A;})();
|
|
14
14
|
export const { SBEF } = sbeNS;
|
|
15
15
|
const iconvTinyNS = {};
|
|
16
16
|
(function(){function f(b,a,c){a=g(a);const e=`${a}-${JSON.stringify(c)}`;var d=b.cache.get(e);if(!d){d=b.g.get(a);if(!d)throw Error(`Encoding "${a}" not supported`);d=d.create(c);b.cache.set(e,d)}return d}
|
|
17
|
-
class k{constructor(b,a){this.g=new Map;a=(a||"").split(",").map(c=>c.split(" ").map(g));for(const c of Object.keys(b)){const e=b[c]
|
|
17
|
+
class k{constructor(b,a){this.g=new Map;a=(a||"").split(",").map(c=>c.split(" ").map(g));for(const c of Object.keys(b)){const e=b[c];if("function"===typeof e.create){const d=g(c);this.g.set(d,e);for(const h of a)if(h.includes(d))for(const l of h)this.g.set(l,e)}}this.cache=new Map}decode(b,a,c){return f(this,a,c).decode(b)}encode(b,a,c){return f(this,a,c).encode(b)}}function g(b){return b.toLowerCase().replace(/[^a-z0-9]/gu,"").replace(/(?<!\d)0+/gu,"")};iconvTinyNS.IconvTiny=k;})();
|
|
18
18
|
export const { IconvTiny } = iconvTinyNS;
|
|
19
19
|
export const US_ASCII = new SBEF("US-ASCII","�".repeat(128));
|
|
20
20
|
export const ISO_8859_1 = new SBEF("ISO-8859-1","");
|
package/dist/iconv-tiny.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file is part of Iconv-Tiny v1.0.
|
|
2
|
+
* This file is part of Iconv-Tiny v1.0.1
|
|
3
3
|
* (c) 2025-present vip.delete
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
const iconvTinyNS = {};
|
|
7
7
|
(function(){function f(b,a,c){a=g(a);const e=`${a}-${JSON.stringify(c)}`;var d=b.cache.get(e);if(!d){d=b.g.get(a);if(!d)throw Error(`Encoding "${a}" not supported`);d=d.create(c);b.cache.set(e,d)}return d}
|
|
8
|
-
class k{constructor(b,a){this.g=new Map;a=(a||"").split(",").map(c=>c.split(" ").map(g));for(const c of Object.keys(b)){const e=b[c]
|
|
8
|
+
class k{constructor(b,a){this.g=new Map;a=(a||"").split(",").map(c=>c.split(" ").map(g));for(const c of Object.keys(b)){const e=b[c];if("function"===typeof e.create){const d=g(c);this.g.set(d,e);for(const h of a)if(h.includes(d))for(const l of h)this.g.set(l,e)}}this.cache=new Map}decode(b,a,c){return f(this,a,c).decode(b)}encode(b,a,c){return f(this,a,c).encode(b)}}function g(b){return b.toLowerCase().replace(/[^a-z0-9]/gu,"").replace(/(?<!\d)0+/gu,"")};iconvTinyNS.IconvTiny=k;})();
|
|
9
9
|
export const { IconvTiny } = iconvTinyNS;
|
|
10
10
|
|
package/dist/sbe.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file is part of Iconv-Tiny v1.0.
|
|
2
|
+
* This file is part of Iconv-Tiny v1.0.1
|
|
3
3
|
* (c) 2025-present vip.delete
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
const sbeNS = {};
|
|
7
7
|
(function(){function q(a){return(new TextDecoder("UTF-16")).decode(a)}function u(a){const b=[];for(let c=0;c<a.length;c+=1024)b.push(String.fromCharCode(...a.subarray(c,c+1024)));return b.join("")}
|
|
8
|
-
function w(a,b){a=new x(a.
|
|
9
|
-
class A{constructor(a,b,c){this.
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
function w(a,b){a=new x(a.h);if(b?.graphicMode){var c=b?.graphics?.slice(0,32)??" ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼";for(var d=0;d<c.length;d++)y(a,d,c.charAt(d).charCodeAt(0))}c=b?.overrides??[];for(d=0;d<c.length-1;){let m=c[d++],n=c[d++];m=Number(m)&255;n="number"===typeof n?n:n.charCodeAt(0);y(a,m,n)}c=z(63,b?.defaultCharByte);b=z(65533,b?.defaultCharUnicode);for(d=0;256>d;d++)a.g[d]||(a.h[d]=b);for(b=0;65536>b;b++)a.j[b]||(a.i[b]=c);return a}
|
|
9
|
+
class A{constructor(a,b,c){this.g=a;a=c??"";c=[];let d=0;for(;d<256-b.length;)c[d]=d++;let m=0;for(;256>d;)c[d++]=b.charCodeAt(m++);for(b=0;b<a.length;)c[a.charCodeAt(b)]=a.charCodeAt(b+1),b+=2;this.h=c}create(a){const {i:b,h:c,g:d,j:m}=w(this,a),n=this.g,p=new B;if(!(a?.nativeDecode??!1)||a?.defaultCharUnicode||a?.overrides?.length||a?.graphicMode)var r=0;else try{(new TextDecoder(this.g)).decode(new Uint8Array([0])),r=!0}catch{r=!1}if(r)p.decode=k=>(new TextDecoder(n)).decode(k);else{const k=a?.strictDecode??
|
|
10
|
+
!1?u:q;if("function"===typeof a?.defaultCharUnicode){const f=a.defaultCharUnicode;p.decode=e=>{const g=e.length,h=new Uint16Array(g);for(let l=0;l<g;l++){const t=e[l],v=c[t];h[l]=d[t]?v:f(t,l)??v}return k(h)}}else p.decode=f=>{const e=f.length,g=new Uint16Array(e);for(let h=0;h<e;h++)g[h]=c[f[h]];return k(g)}}if("function"===typeof a?.defaultCharByte){const k=a.defaultCharByte;p.encode=f=>{const e=new Uint8Array(f.length);for(let g=0;g<f.length;g++){const h=f.charCodeAt(g),l=b[h];e[g]=m[h]?l:k(h,
|
|
11
|
+
g)??l}return e}}else p.encode=k=>{const f=new Uint8Array(k.length);for(let e=0;e<k.length;e++)f[e]=b[k.charCodeAt(e)];return f};return p}}class B{decode(){return""}encode(){return new Uint8Array([0])}}function y(a,b,c){65533===c?a.g[b]=0:(a.h[b]=c,a.i[c]=b,a.g[b]=1,a.j[c]=1)}class x{constructor(a){this.h=new Uint16Array(256);this.i=new Uint8Array(65536);this.g=new Uint8Array(256);this.j=new Uint8Array(65536);for(let b=0;256>b;b++)y(this,b,a[b])}}
|
|
12
12
|
function z(a,b){return"string"===typeof b&&0<b.length?b.charCodeAt(0):a};sbeNS.SBEF=A;})();
|
|
13
13
|
export const { SBEF } = sbeNS;
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "iconv-tiny",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Pure JS ESM Encodings Set for Browser and NodeJS",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"iconv",
|
|
@@ -113,19 +113,19 @@
|
|
|
113
113
|
"dev": "node scripts/server.js"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@stylistic/eslint-plugin": "^
|
|
117
|
-
"@types/express": "^5.
|
|
116
|
+
"@stylistic/eslint-plugin": "^4.x",
|
|
117
|
+
"@types/express": "^5.x",
|
|
118
118
|
"@types/google-closure-compiler": "^20231112.0.0",
|
|
119
|
-
"@types/node": "^
|
|
120
|
-
"@types/serve-static": "^1.
|
|
121
|
-
"@vitest/coverage-istanbul": "^
|
|
122
|
-
"eslint": "^9.
|
|
123
|
-
"eslint-plugin-jsdoc": "^50.
|
|
124
|
-
"express": "^
|
|
119
|
+
"@types/node": "^20.x",
|
|
120
|
+
"@types/serve-static": "^1.x",
|
|
121
|
+
"@vitest/coverage-istanbul": "^3.x",
|
|
122
|
+
"eslint": "^9.x",
|
|
123
|
+
"eslint-plugin-jsdoc": "^50.x",
|
|
124
|
+
"express": "^5.x",
|
|
125
125
|
"google-closure-compiler": "^20240317.0.0",
|
|
126
126
|
"iconv-lite": "^0.6.3",
|
|
127
|
-
"prettier": "^3.
|
|
128
|
-
"serve-static": "^
|
|
129
|
-
"vitest": "^
|
|
127
|
+
"prettier": "^3.x",
|
|
128
|
+
"serve-static": "^2.x",
|
|
129
|
+
"vitest": "^3.x"
|
|
130
130
|
}
|
|
131
131
|
}
|