@leancodepl/api-binary-blob 9.7.4 → 10.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/CHANGELOG.md +24 -0
- package/dist/index.js +24 -30
- package/dist/index.umd.cjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.0.1](https://github.com/leancodepl/js_corelibrary/compare/v10.0.0...v10.0.1) (2026-02-13)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- move publish targets to nx plugin
|
|
11
|
+
([aa68e33](https://github.com/leancodepl/js_corelibrary/commit/aa68e33991cd9ce7af3dab3f10f1d0a8030b4d28))
|
|
12
|
+
|
|
13
|
+
# Change Log
|
|
14
|
+
|
|
15
|
+
All notable changes to this project will be documented in this file. See
|
|
16
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
17
|
+
|
|
18
|
+
# [10.0.0](https://github.com/leancodepl/js_corelibrary/compare/v9.7.4...v10.0.0) (2026-02-11)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- exclude external packages from build output
|
|
23
|
+
([4c2be7a](https://github.com/leancodepl/js_corelibrary/commit/4c2be7ac64eb6ed5603ba61b9aeef75a454dffb3))
|
|
24
|
+
|
|
25
|
+
# Change Log
|
|
26
|
+
|
|
27
|
+
All notable changes to this project will be documented in this file. See
|
|
28
|
+
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
29
|
+
|
|
6
30
|
## [9.7.4](https://github.com/leancodepl/js_corelibrary/compare/v9.7.3...v9.7.4) (2026-02-10)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @leancodepl/api-binary-blob
|
package/dist/index.js
CHANGED
|
@@ -1,43 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return r;
|
|
6
|
-
}
|
|
7
|
-
function d(r) {
|
|
8
|
-
return r ? new Promise((n, o) => {
|
|
1
|
+
import { fromRaw as a, toRaw as c } from "@leancodepl/api-binary";
|
|
2
|
+
export * from "@leancodepl/api-binary";
|
|
3
|
+
function w(e) {
|
|
4
|
+
return e ? new Promise((t, n) => {
|
|
9
5
|
try {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
if (typeof
|
|
14
|
-
|
|
6
|
+
const r = new FileReader();
|
|
7
|
+
r.onloadend = () => {
|
|
8
|
+
const o = r.result;
|
|
9
|
+
if (typeof o == "string") {
|
|
10
|
+
t(a(o.slice(Math.max(0, 1 + o.indexOf(",", o.indexOf(";"))))));
|
|
15
11
|
return;
|
|
16
12
|
}
|
|
17
13
|
throw new Error("Unknown blob result received for ApiBinary creation");
|
|
18
|
-
},
|
|
19
|
-
} catch (
|
|
20
|
-
|
|
14
|
+
}, r.onerror = n, r.readAsDataURL(e);
|
|
15
|
+
} catch (r) {
|
|
16
|
+
n(r);
|
|
21
17
|
}
|
|
22
18
|
}) : Promise.resolve(void 0);
|
|
23
19
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
for (let s = 0; s <
|
|
27
|
-
const f =
|
|
20
|
+
function u(e, t, n = 512) {
|
|
21
|
+
const r = atob(e), o = [];
|
|
22
|
+
for (let s = 0; s < r.length; s += n) {
|
|
23
|
+
const f = r.slice(s, s + n), i = new Array(f.length);
|
|
28
24
|
for (let l = 0; l < f.length; l++)
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
i[l] = f.charCodeAt(l);
|
|
26
|
+
o.push(new Uint8Array(i).buffer);
|
|
31
27
|
}
|
|
32
|
-
return new Blob(
|
|
28
|
+
return new Blob(o, { type: t });
|
|
33
29
|
}
|
|
34
|
-
function
|
|
35
|
-
if (
|
|
36
|
-
return
|
|
30
|
+
function h(e, t) {
|
|
31
|
+
if (e != null)
|
|
32
|
+
return u(c(e), t);
|
|
37
33
|
}
|
|
38
34
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
w as toBlob,
|
|
42
|
-
i as toRaw
|
|
35
|
+
w as fromBlob,
|
|
36
|
+
h as toBlob
|
|
43
37
|
};
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(t,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@leancodepl/api-binary")):typeof define=="function"&&define.amd?define(["exports","@leancodepl/api-binary"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t["@leancodepl/api-binary-blob"]={},t.apiBinary))})(this,(function(t,r){"use strict";function b(e){return e?new Promise((l,i)=>{try{const o=new FileReader;o.onloadend=()=>{const n=o.result;if(typeof n=="string"){l(r.fromRaw(n.slice(Math.max(0,1+n.indexOf(",",n.indexOf(";"))))));return}throw new Error("Unknown blob result received for ApiBinary creation")},o.onerror=i,o.readAsDataURL(e)}catch(o){i(o)}}):Promise.resolve(void 0)}function a(e,l,i=512){const o=atob(e),n=[];for(let f=0;f<o.length;f+=i){const c=o.slice(f,f+i),u=new Array(c.length);for(let s=0;s<c.length;s++)u[s]=c.charCodeAt(s);n.push(new Uint8Array(u).buffer)}return new Blob(n,{type:l})}function d(e,l){if(e!=null)return a(r.toRaw(e),l)}t.fromBlob=b,t.toBlob=d,Object.keys(r).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:()=>r[e]})}),Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leancodepl/api-binary-blob",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@leancodepl/api-binary": "
|
|
18
|
+
"@leancodepl/api-binary": "10.0.1"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"blob-polyfill": "^9.0.0"
|