js-base64 3.7.8 → 3.8.0
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 +4 -4
- package/base64.d.mts +2 -2
- package/base64.d.ts +2 -2
- package/base64.js +2 -2
- package/base64.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ Locally…
|
|
|
25
25
|
… or Directly from CDN. In which case you don't even need to install.
|
|
26
26
|
|
|
27
27
|
```html
|
|
28
|
-
<script src="https://cdn.jsdelivr.net/npm/js-base64@3.
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/npm/js-base64@3.8.0/base64.min.js"></script>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This good old way loads `Base64` in the global context (`window`). Though `Base64.noConflict()` is made available, you should consider using ES6 Module to avoid tainting `window`.
|
|
@@ -48,14 +48,14 @@ or even remotely.
|
|
|
48
48
|
```html
|
|
49
49
|
<script type="module">
|
|
50
50
|
// note jsdelivr.net does not automatically minify .mjs
|
|
51
|
-
import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.
|
|
51
|
+
import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.8.0/base64.mjs';
|
|
52
52
|
</script>
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
```html
|
|
56
56
|
<script type="module">
|
|
57
57
|
// or if you prefer no Base64 namespace
|
|
58
|
-
import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.
|
|
58
|
+
import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.8.0/base64.mjs';
|
|
59
59
|
</script>
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -127,7 +127,7 @@ Base64.extendString();
|
|
|
127
127
|
'dankogai'.toBase64(); // ZGFua29nYWk=
|
|
128
128
|
'小飼弾'.toBase64(); // 5bCP6aO85by+
|
|
129
129
|
'小飼弾'.toBase64(true); // 5bCP6aO85by-
|
|
130
|
-
'小飼弾'.toBase64URI(); // 5bCP6aO85by-
|
|
130
|
+
'小飼弾'.toBase64URI(); // 5bCP6aO85by- an alias of .toBase64(true)
|
|
131
131
|
'小飼弾'.toBase64URL(); // 5bCP6aO85by- an alias of .toBase64URI()
|
|
132
132
|
'ZGFua29nYWk='.fromBase64(); // dankogai
|
|
133
133
|
'5bCP6aO85by+'.fromBase64(); // 小飼弾
|
package/base64.d.mts
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @author Dan Kogai (https://github.com/dankogai)
|
|
11
11
|
*/
|
|
12
|
-
declare const version = "3.
|
|
12
|
+
declare const version = "3.8.0";
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated use lowercase `version`.
|
|
15
15
|
*/
|
|
16
|
-
declare const VERSION = "3.
|
|
16
|
+
declare const VERSION = "3.8.0";
|
|
17
17
|
/**
|
|
18
18
|
* polyfill version of `btoa`
|
|
19
19
|
*/
|
package/base64.d.ts
CHANGED
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @author Dan Kogai (https://github.com/dankogai)
|
|
11
11
|
*/
|
|
12
|
-
declare const version = "3.
|
|
12
|
+
declare const version = "3.8.0";
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated use lowercase `version`.
|
|
15
15
|
*/
|
|
16
|
-
declare const VERSION = "3.
|
|
16
|
+
declare const VERSION = "3.8.0";
|
|
17
17
|
/**
|
|
18
18
|
* polyfill version of `btoa`
|
|
19
19
|
*/
|
package/base64.js
CHANGED
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
*
|
|
38
38
|
* @author Dan Kogai (https://github.com/dankogai)
|
|
39
39
|
*/
|
|
40
|
-
var version = '3.
|
|
40
|
+
var version = '3.8.0';
|
|
41
41
|
/**
|
|
42
42
|
* @deprecated use lowercase `version`.
|
|
43
43
|
*/
|
|
44
44
|
var VERSION = version;
|
|
45
45
|
var _hasBuffer = typeof Buffer === 'function';
|
|
46
|
-
var _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
46
|
+
var _TD = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { ignoreBOM: true }) : undefined;
|
|
47
47
|
var _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
48
48
|
var b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
49
49
|
var b64chs = Array.prototype.slice.call(b64ch);
|
package/base64.mjs
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @author Dan Kogai (https://github.com/dankogai)
|
|
11
11
|
*/
|
|
12
|
-
const version = '3.
|
|
12
|
+
const version = '3.8.0';
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated use lowercase `version`.
|
|
15
15
|
*/
|
|
16
16
|
const VERSION = version;
|
|
17
17
|
const _hasBuffer = typeof Buffer === 'function';
|
|
18
|
-
const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
18
|
+
const _TD = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { ignoreBOM: true }) : undefined;
|
|
19
19
|
const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
20
20
|
const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
21
21
|
const b64chs = Array.prototype.slice.call(b64ch);
|