js-base64 3.7.4 → 3.7.5

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
@@ -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.7.4/base64.min.js"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.5/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.7.4/base64.mjs';
51
+ import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.5/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.7.4/base64.mjs';
58
+ import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.5/base64.mjs';
59
59
  </script>
60
60
  ```
61
61
 
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.7.4";
12
+ declare const version = "3.7.5";
13
13
  /**
14
14
  * @deprecated use lowercase `version`.
15
15
  */
16
- declare const VERSION = "3.7.4";
16
+ declare const VERSION = "3.7.5";
17
17
  /**
18
18
  * polyfill version of `btoa`
19
19
  */
package/base64.js CHANGED
@@ -37,7 +37,7 @@
37
37
  *
38
38
  * @author Dan Kogai (https://github.com/dankogai)
39
39
  */
40
- var version = '3.7.4';
40
+ var version = '3.7.5';
41
41
  /**
42
42
  * @deprecated use lowercase `version`.
43
43
  */
@@ -58,10 +58,7 @@
58
58
  var _fromCC = String.fromCharCode.bind(String);
59
59
  var _U8Afrom = typeof Uint8Array.from === 'function'
60
60
  ? Uint8Array.from.bind(Uint8Array)
61
- : function (it, fn) {
62
- if (fn === void 0) { fn = function (x) { return x; }; }
63
- return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
64
- };
61
+ : function (it) { return new Uint8Array(Array.prototype.slice.call(it, 0)); };
65
62
  var _mkUriSafe = function (src) { return src
66
63
  .replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
67
64
  var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
@@ -225,7 +222,7 @@
225
222
  //
226
223
  var _toUint8Array = _hasBuffer
227
224
  ? function (a) { return _U8Afrom(Buffer.from(a, 'base64')); }
228
- : function (a) { return _U8Afrom(_atob(a), function (c) { return c.charCodeAt(0); }); };
225
+ : function (a) { return _U8Afrom(_atob(a).split('').map(function (c) { return c.charCodeAt(0); })); };
229
226
  /**
230
227
  * converts a Base64 string to a Uint8Array.
231
228
  */
package/base64.mjs CHANGED
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @author Dan Kogai (https://github.com/dankogai)
11
11
  */
12
- const version = '3.7.4';
12
+ const version = '3.7.5';
13
13
  /**
14
14
  * @deprecated use lowercase `version`.
15
15
  */
@@ -30,7 +30,7 @@ const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3
30
30
  const _fromCC = String.fromCharCode.bind(String);
31
31
  const _U8Afrom = typeof Uint8Array.from === 'function'
32
32
  ? Uint8Array.from.bind(Uint8Array)
33
- : (it, fn = (x) => x) => new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
33
+ : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
34
34
  const _mkUriSafe = (src) => src
35
35
  .replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
36
36
  const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
@@ -188,7 +188,7 @@ const _atob = _hasatob ? (asc) => atob(_tidyB64(asc))
188
188
  //
189
189
  const _toUint8Array = _hasBuffer
190
190
  ? (a) => _U8Afrom(Buffer.from(a, 'base64'))
191
- : (a) => _U8Afrom(_atob(a), c => c.charCodeAt(0));
191
+ : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
192
192
  /**
193
193
  * converts a Base64 string to a Uint8Array.
194
194
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-base64",
3
- "version": "3.7.4",
3
+ "version": "3.7.5",
4
4
  "description": "Yet another Base64 transcoder in pure-JS",
5
5
  "main": "base64.js",
6
6
  "module": "base64.mjs",