js-base64 3.7.1 → 3.7.2

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.1/base64.min.js"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/js-base64@3.7.2/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.1/base64.mjs';
51
+ import { Base64 } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.2/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.1/base64.mjs';
58
+ import { encode, decode } from 'https://cdn.jsdelivr.net/npm/js-base64@3.7.2/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.1";
12
+ declare const version = "3.7.2";
13
13
  /**
14
14
  * @deprecated use lowercase `version`.
15
15
  */
16
- declare const VERSION = "3.7.1";
16
+ declare const VERSION = "3.7.2";
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.1';
40
+ var version = '3.7.2';
41
41
  /**
42
42
  * @deprecated use lowercase `version`.
43
43
  */
@@ -63,8 +63,7 @@
63
63
  return new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
64
64
  };
65
65
  var _mkUriSafe = function (src) { return src
66
- .replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; })
67
- .replace(/=+$/m, ''); };
66
+ .replace(/=/g, '').replace(/[+\/]/g, function (m0) { return m0 == '+' ? '-' : '_'; }); };
68
67
  var _tidyB64 = function (s) { return s.replace(/[^A-Za-z0-9\+\/]/g, ''); };
69
68
  /**
70
69
  * polyfill version of `btoa`
@@ -251,7 +250,7 @@
251
250
  var isValid = function (src) {
252
251
  if (typeof src !== 'string')
253
252
  return false;
254
- var s = src.replace(/\s+/g, '').replace(/=+$/, '');
253
+ var s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
255
254
  return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
256
255
  };
257
256
  //
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.1';
12
+ const version = '3.7.2';
13
13
  /**
14
14
  * @deprecated use lowercase `version`.
15
15
  */
@@ -32,8 +32,7 @@ const _U8Afrom = typeof Uint8Array.from === 'function'
32
32
  ? Uint8Array.from.bind(Uint8Array)
33
33
  : (it, fn = (x) => x) => new Uint8Array(Array.prototype.slice.call(it, 0).map(fn));
34
34
  const _mkUriSafe = (src) => src
35
- .replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_')
36
- .replace(/=+$/m, '');
35
+ .replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
37
36
  const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
38
37
  /**
39
38
  * polyfill version of `btoa`
@@ -214,7 +213,7 @@ const decode = (src) => _decode(_unURI(src));
214
213
  const isValid = (src) => {
215
214
  if (typeof src !== 'string')
216
215
  return false;
217
- const s = src.replace(/\s+/g, '').replace(/=+$/, '');
216
+ const s = src.replace(/\s+/g, '').replace(/={0,2}$/, '');
218
217
  return !/[^\s0-9a-zA-Z\+/]/.test(s) || !/[^\s0-9a-zA-Z\-_]/.test(s);
219
218
  };
220
219
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js-base64",
3
- "version": "3.7.1",
3
+ "version": "3.7.2",
4
4
  "description": "Yet another Base64 transcoder in pure-JS",
5
5
  "main": "base64.js",
6
6
  "module": "base64.mjs",