@wordpress/blob 4.0.1 → 4.1.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/CHANGELOG.md +6 -0
- package/README.md +3 -3
- package/build/index.js +12 -15
- package/build/index.js.map +1 -1
- package/build-module/index.js +12 -15
- package/build-module/index.js.map +1 -1
- package/build-types/index.d.ts +18 -18
- package/build-types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/{index.js → index.ts} +23 -22
- package/src/test/{index.js → index.ts} +15 -5
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -61,7 +61,7 @@ _Parameters_
|
|
|
61
61
|
|
|
62
62
|
_Returns_
|
|
63
63
|
|
|
64
|
-
- `File|undefined`: The file for the blob URL.
|
|
64
|
+
- `File | undefined`: The file for the blob URL.
|
|
65
65
|
|
|
66
66
|
### getBlobTypeByURL
|
|
67
67
|
|
|
@@ -73,7 +73,7 @@ _Parameters_
|
|
|
73
73
|
|
|
74
74
|
_Returns_
|
|
75
75
|
|
|
76
|
-
- `string|undefined`: The blob type.
|
|
76
|
+
- `string | undefined`: The blob type.
|
|
77
77
|
|
|
78
78
|
### isBlobURL
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ Check whether a url is a blob url.
|
|
|
81
81
|
|
|
82
82
|
_Parameters_
|
|
83
83
|
|
|
84
|
-
- _url_ `string|undefined`: The URL.
|
|
84
|
+
- _url_ `string | undefined`: The URL.
|
|
85
85
|
|
|
86
86
|
_Returns_
|
|
87
87
|
|
package/build/index.js
CHANGED
|
@@ -9,17 +9,14 @@ exports.getBlobByURL = getBlobByURL;
|
|
|
9
9
|
exports.getBlobTypeByURL = getBlobTypeByURL;
|
|
10
10
|
exports.isBlobURL = isBlobURL;
|
|
11
11
|
exports.revokeBlobURL = revokeBlobURL;
|
|
12
|
-
/**
|
|
13
|
-
* @type {Record<string, File|undefined>}
|
|
14
|
-
*/
|
|
15
12
|
const cache = {};
|
|
16
13
|
|
|
17
14
|
/**
|
|
18
15
|
* Create a blob URL from a file.
|
|
19
16
|
*
|
|
20
|
-
* @param
|
|
17
|
+
* @param file The file to create a blob URL for.
|
|
21
18
|
*
|
|
22
|
-
* @return
|
|
19
|
+
* @return The blob URL.
|
|
23
20
|
*/
|
|
24
21
|
function createBlobURL(file) {
|
|
25
22
|
const url = window.URL.createObjectURL(file);
|
|
@@ -32,9 +29,9 @@ function createBlobURL(file) {
|
|
|
32
29
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
33
30
|
* `undefined`.
|
|
34
31
|
*
|
|
35
|
-
* @param
|
|
32
|
+
* @param url The blob URL.
|
|
36
33
|
*
|
|
37
|
-
* @return
|
|
34
|
+
* @return The file for the blob URL.
|
|
38
35
|
*/
|
|
39
36
|
function getBlobByURL(url) {
|
|
40
37
|
return cache[url];
|
|
@@ -45,9 +42,9 @@ function getBlobByURL(url) {
|
|
|
45
42
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
46
43
|
* `undefined`.
|
|
47
44
|
*
|
|
48
|
-
* @param
|
|
45
|
+
* @param url The blob URL.
|
|
49
46
|
*
|
|
50
|
-
* @return
|
|
47
|
+
* @return The blob type.
|
|
51
48
|
*/
|
|
52
49
|
function getBlobTypeByURL(url) {
|
|
53
50
|
return getBlobByURL(url)?.type.split('/')[0]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).
|
|
@@ -56,7 +53,7 @@ function getBlobTypeByURL(url) {
|
|
|
56
53
|
/**
|
|
57
54
|
* Remove the resource and file cache from memory.
|
|
58
55
|
*
|
|
59
|
-
* @param
|
|
56
|
+
* @param url The blob URL.
|
|
60
57
|
*/
|
|
61
58
|
function revokeBlobURL(url) {
|
|
62
59
|
if (cache[url]) {
|
|
@@ -68,9 +65,9 @@ function revokeBlobURL(url) {
|
|
|
68
65
|
/**
|
|
69
66
|
* Check whether a url is a blob url.
|
|
70
67
|
*
|
|
71
|
-
* @param
|
|
68
|
+
* @param url The URL.
|
|
72
69
|
*
|
|
73
|
-
* @return
|
|
70
|
+
* @return Is the url a blob url?
|
|
74
71
|
*/
|
|
75
72
|
function isBlobURL(url) {
|
|
76
73
|
if (!url || !url.indexOf) {
|
|
@@ -98,9 +95,9 @@ function isBlobURL(url) {
|
|
|
98
95
|
* downloadBlob( filename, fileContent, 'application/json' );
|
|
99
96
|
* ```
|
|
100
97
|
*
|
|
101
|
-
* @param
|
|
102
|
-
* @param
|
|
103
|
-
* @param
|
|
98
|
+
* @param filename File name.
|
|
99
|
+
* @param content File content (BufferSource | Blob | string).
|
|
100
|
+
* @param contentType (Optional) File mime type. Default is `''`.
|
|
104
101
|
*/
|
|
105
102
|
function downloadBlob(filename, content, contentType = '') {
|
|
106
103
|
if (!filename || !content) {
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cache","createBlobURL","file","url","window","URL","createObjectURL","getBlobByURL","getBlobTypeByURL","type","split","revokeBlobURL","revokeObjectURL","isBlobURL","indexOf","downloadBlob","filename","content","contentType","Blob","anchorElement","document","createElement","href","download","style","display","body","appendChild","click","removeChild"],"sources":["@wordpress/blob/src/index.
|
|
1
|
+
{"version":3,"names":["cache","createBlobURL","file","url","window","URL","createObjectURL","getBlobByURL","getBlobTypeByURL","type","split","revokeBlobURL","revokeObjectURL","isBlobURL","indexOf","downloadBlob","filename","content","contentType","Blob","anchorElement","document","createElement","href","download","style","display","body","appendChild","click","removeChild"],"sources":["@wordpress/blob/src/index.ts"],"sourcesContent":["const cache: Record< string, File > = {};\n\n/**\n * Create a blob URL from a file.\n *\n * @param file The file to create a blob URL for.\n *\n * @return The blob URL.\n */\nexport function createBlobURL( file: File ): string {\n\tconst url = window.URL.createObjectURL( file );\n\n\tcache[ url ] = file;\n\n\treturn url;\n}\n\n/**\n * Retrieve a file based on a blob URL. The file must have been created by\n * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return\n * `undefined`.\n *\n * @param url The blob URL.\n *\n * @return The file for the blob URL.\n */\nexport function getBlobByURL( url: string ): File | undefined {\n\treturn cache[ url ];\n}\n\n/**\n * Retrieve a blob type based on URL. The file must have been created by\n * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return\n * `undefined`.\n *\n * @param url The blob URL.\n *\n * @return The blob type.\n */\nexport function getBlobTypeByURL( url: string ): string | undefined {\n\treturn getBlobByURL( url )?.type.split( '/' )[ 0 ]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).\n}\n\n/**\n * Remove the resource and file cache from memory.\n *\n * @param url The blob URL.\n */\nexport function revokeBlobURL( url: string ): void {\n\tif ( cache[ url ] ) {\n\t\twindow.URL.revokeObjectURL( url );\n\t}\n\n\tdelete cache[ url ];\n}\n\n/**\n * Check whether a url is a blob url.\n *\n * @param url The URL.\n *\n * @return Is the url a blob url?\n */\nexport function isBlobURL( url: string | undefined ): boolean {\n\tif ( ! url || ! url.indexOf ) {\n\t\treturn false;\n\t}\n\treturn url.indexOf( 'blob:' ) === 0;\n}\n\n/**\n * Downloads a file, e.g., a text or readable stream, in the browser.\n * Appropriate for downloading smaller file sizes, e.g., < 5 MB.\n *\n * Example usage:\n *\n * ```js\n * \tconst fileContent = JSON.stringify(\n * \t\t{\n * \t\t\t\"title\": \"My Post\",\n * \t\t},\n * \t\tnull,\n * \t\t2\n * \t);\n * \tconst filename = 'file.json';\n *\n * \tdownloadBlob( filename, fileContent, 'application/json' );\n * ```\n *\n * @param filename File name.\n * @param content File content (BufferSource | Blob | string).\n * @param contentType (Optional) File mime type. Default is `''`.\n */\nexport function downloadBlob(\n\tfilename: string,\n\tcontent: BlobPart,\n\tcontentType: string = ''\n): void {\n\tif ( ! filename || ! content ) {\n\t\treturn;\n\t}\n\n\tconst file = new window.Blob( [ content ], { type: contentType } );\n\tconst url = window.URL.createObjectURL( file );\n\tconst anchorElement = document.createElement( 'a' );\n\tanchorElement.href = url;\n\tanchorElement.download = filename;\n\tanchorElement.style.display = 'none';\n\tdocument.body.appendChild( anchorElement );\n\tanchorElement.click();\n\tdocument.body.removeChild( anchorElement );\n\twindow.URL.revokeObjectURL( url );\n}\n"],"mappings":";;;;;;;;;;;AAAA,MAAMA,KAA6B,GAAG,CAAC,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAEC,IAAU,EAAW;EACnD,MAAMC,GAAG,GAAGC,MAAM,CAACC,GAAG,CAACC,eAAe,CAAEJ,IAAK,CAAC;EAE9CF,KAAK,CAAEG,GAAG,CAAE,GAAGD,IAAI;EAEnB,OAAOC,GAAG;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,YAAYA,CAAEJ,GAAW,EAAqB;EAC7D,OAAOH,KAAK,CAAEG,GAAG,CAAE;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,gBAAgBA,CAAEL,GAAW,EAAuB;EACnE,OAAOI,YAAY,CAAEJ,GAAI,CAAC,EAAEM,IAAI,CAACC,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE,CAAC,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,aAAaA,CAAER,GAAW,EAAS;EAClD,IAAKH,KAAK,CAAEG,GAAG,CAAE,EAAG;IACnBC,MAAM,CAACC,GAAG,CAACO,eAAe,CAAET,GAAI,CAAC;EAClC;EAEA,OAAOH,KAAK,CAAEG,GAAG,CAAE;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASU,SAASA,CAAEV,GAAuB,EAAY;EAC7D,IAAK,CAAEA,GAAG,IAAI,CAAEA,GAAG,CAACW,OAAO,EAAG;IAC7B,OAAO,KAAK;EACb;EACA,OAAOX,GAAG,CAACW,OAAO,CAAE,OAAQ,CAAC,KAAK,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,YAAYA,CAC3BC,QAAgB,EAChBC,OAAiB,EACjBC,WAAmB,GAAG,EAAE,EACjB;EACP,IAAK,CAAEF,QAAQ,IAAI,CAAEC,OAAO,EAAG;IAC9B;EACD;EAEA,MAAMf,IAAI,GAAG,IAAIE,MAAM,CAACe,IAAI,CAAE,CAAEF,OAAO,CAAE,EAAE;IAAER,IAAI,EAAES;EAAY,CAAE,CAAC;EAClE,MAAMf,GAAG,GAAGC,MAAM,CAACC,GAAG,CAACC,eAAe,CAAEJ,IAAK,CAAC;EAC9C,MAAMkB,aAAa,GAAGC,QAAQ,CAACC,aAAa,CAAE,GAAI,CAAC;EACnDF,aAAa,CAACG,IAAI,GAAGpB,GAAG;EACxBiB,aAAa,CAACI,QAAQ,GAAGR,QAAQ;EACjCI,aAAa,CAACK,KAAK,CAACC,OAAO,GAAG,MAAM;EACpCL,QAAQ,CAACM,IAAI,CAACC,WAAW,CAAER,aAAc,CAAC;EAC1CA,aAAa,CAACS,KAAK,CAAC,CAAC;EACrBR,QAAQ,CAACM,IAAI,CAACG,WAAW,CAAEV,aAAc,CAAC;EAC1ChB,MAAM,CAACC,GAAG,CAACO,eAAe,CAAET,GAAI,CAAC;AAClC","ignoreList":[]}
|
package/build-module/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @type {Record<string, File|undefined>}
|
|
3
|
-
*/
|
|
4
1
|
const cache = {};
|
|
5
2
|
|
|
6
3
|
/**
|
|
7
4
|
* Create a blob URL from a file.
|
|
8
5
|
*
|
|
9
|
-
* @param
|
|
6
|
+
* @param file The file to create a blob URL for.
|
|
10
7
|
*
|
|
11
|
-
* @return
|
|
8
|
+
* @return The blob URL.
|
|
12
9
|
*/
|
|
13
10
|
export function createBlobURL(file) {
|
|
14
11
|
const url = window.URL.createObjectURL(file);
|
|
@@ -21,9 +18,9 @@ export function createBlobURL(file) {
|
|
|
21
18
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
22
19
|
* `undefined`.
|
|
23
20
|
*
|
|
24
|
-
* @param
|
|
21
|
+
* @param url The blob URL.
|
|
25
22
|
*
|
|
26
|
-
* @return
|
|
23
|
+
* @return The file for the blob URL.
|
|
27
24
|
*/
|
|
28
25
|
export function getBlobByURL(url) {
|
|
29
26
|
return cache[url];
|
|
@@ -34,9 +31,9 @@ export function getBlobByURL(url) {
|
|
|
34
31
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
35
32
|
* `undefined`.
|
|
36
33
|
*
|
|
37
|
-
* @param
|
|
34
|
+
* @param url The blob URL.
|
|
38
35
|
*
|
|
39
|
-
* @return
|
|
36
|
+
* @return The blob type.
|
|
40
37
|
*/
|
|
41
38
|
export function getBlobTypeByURL(url) {
|
|
42
39
|
return getBlobByURL(url)?.type.split('/')[0]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).
|
|
@@ -45,7 +42,7 @@ export function getBlobTypeByURL(url) {
|
|
|
45
42
|
/**
|
|
46
43
|
* Remove the resource and file cache from memory.
|
|
47
44
|
*
|
|
48
|
-
* @param
|
|
45
|
+
* @param url The blob URL.
|
|
49
46
|
*/
|
|
50
47
|
export function revokeBlobURL(url) {
|
|
51
48
|
if (cache[url]) {
|
|
@@ -57,9 +54,9 @@ export function revokeBlobURL(url) {
|
|
|
57
54
|
/**
|
|
58
55
|
* Check whether a url is a blob url.
|
|
59
56
|
*
|
|
60
|
-
* @param
|
|
57
|
+
* @param url The URL.
|
|
61
58
|
*
|
|
62
|
-
* @return
|
|
59
|
+
* @return Is the url a blob url?
|
|
63
60
|
*/
|
|
64
61
|
export function isBlobURL(url) {
|
|
65
62
|
if (!url || !url.indexOf) {
|
|
@@ -87,9 +84,9 @@ export function isBlobURL(url) {
|
|
|
87
84
|
* downloadBlob( filename, fileContent, 'application/json' );
|
|
88
85
|
* ```
|
|
89
86
|
*
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
87
|
+
* @param filename File name.
|
|
88
|
+
* @param content File content (BufferSource | Blob | string).
|
|
89
|
+
* @param contentType (Optional) File mime type. Default is `''`.
|
|
93
90
|
*/
|
|
94
91
|
export function downloadBlob(filename, content, contentType = '') {
|
|
95
92
|
if (!filename || !content) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cache","createBlobURL","file","url","window","URL","createObjectURL","getBlobByURL","getBlobTypeByURL","type","split","revokeBlobURL","revokeObjectURL","isBlobURL","indexOf","downloadBlob","filename","content","contentType","Blob","anchorElement","document","createElement","href","download","style","display","body","appendChild","click","removeChild"],"sources":["@wordpress/blob/src/index.
|
|
1
|
+
{"version":3,"names":["cache","createBlobURL","file","url","window","URL","createObjectURL","getBlobByURL","getBlobTypeByURL","type","split","revokeBlobURL","revokeObjectURL","isBlobURL","indexOf","downloadBlob","filename","content","contentType","Blob","anchorElement","document","createElement","href","download","style","display","body","appendChild","click","removeChild"],"sources":["@wordpress/blob/src/index.ts"],"sourcesContent":["const cache: Record< string, File > = {};\n\n/**\n * Create a blob URL from a file.\n *\n * @param file The file to create a blob URL for.\n *\n * @return The blob URL.\n */\nexport function createBlobURL( file: File ): string {\n\tconst url = window.URL.createObjectURL( file );\n\n\tcache[ url ] = file;\n\n\treturn url;\n}\n\n/**\n * Retrieve a file based on a blob URL. The file must have been created by\n * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return\n * `undefined`.\n *\n * @param url The blob URL.\n *\n * @return The file for the blob URL.\n */\nexport function getBlobByURL( url: string ): File | undefined {\n\treturn cache[ url ];\n}\n\n/**\n * Retrieve a blob type based on URL. The file must have been created by\n * `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return\n * `undefined`.\n *\n * @param url The blob URL.\n *\n * @return The blob type.\n */\nexport function getBlobTypeByURL( url: string ): string | undefined {\n\treturn getBlobByURL( url )?.type.split( '/' )[ 0 ]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).\n}\n\n/**\n * Remove the resource and file cache from memory.\n *\n * @param url The blob URL.\n */\nexport function revokeBlobURL( url: string ): void {\n\tif ( cache[ url ] ) {\n\t\twindow.URL.revokeObjectURL( url );\n\t}\n\n\tdelete cache[ url ];\n}\n\n/**\n * Check whether a url is a blob url.\n *\n * @param url The URL.\n *\n * @return Is the url a blob url?\n */\nexport function isBlobURL( url: string | undefined ): boolean {\n\tif ( ! url || ! url.indexOf ) {\n\t\treturn false;\n\t}\n\treturn url.indexOf( 'blob:' ) === 0;\n}\n\n/**\n * Downloads a file, e.g., a text or readable stream, in the browser.\n * Appropriate for downloading smaller file sizes, e.g., < 5 MB.\n *\n * Example usage:\n *\n * ```js\n * \tconst fileContent = JSON.stringify(\n * \t\t{\n * \t\t\t\"title\": \"My Post\",\n * \t\t},\n * \t\tnull,\n * \t\t2\n * \t);\n * \tconst filename = 'file.json';\n *\n * \tdownloadBlob( filename, fileContent, 'application/json' );\n * ```\n *\n * @param filename File name.\n * @param content File content (BufferSource | Blob | string).\n * @param contentType (Optional) File mime type. Default is `''`.\n */\nexport function downloadBlob(\n\tfilename: string,\n\tcontent: BlobPart,\n\tcontentType: string = ''\n): void {\n\tif ( ! filename || ! content ) {\n\t\treturn;\n\t}\n\n\tconst file = new window.Blob( [ content ], { type: contentType } );\n\tconst url = window.URL.createObjectURL( file );\n\tconst anchorElement = document.createElement( 'a' );\n\tanchorElement.href = url;\n\tanchorElement.download = filename;\n\tanchorElement.style.display = 'none';\n\tdocument.body.appendChild( anchorElement );\n\tanchorElement.click();\n\tdocument.body.removeChild( anchorElement );\n\twindow.URL.revokeObjectURL( url );\n}\n"],"mappings":"AAAA,MAAMA,KAA6B,GAAG,CAAC,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAEC,IAAU,EAAW;EACnD,MAAMC,GAAG,GAAGC,MAAM,CAACC,GAAG,CAACC,eAAe,CAAEJ,IAAK,CAAC;EAE9CF,KAAK,CAAEG,GAAG,CAAE,GAAGD,IAAI;EAEnB,OAAOC,GAAG;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,YAAYA,CAAEJ,GAAW,EAAqB;EAC7D,OAAOH,KAAK,CAAEG,GAAG,CAAE;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,gBAAgBA,CAAEL,GAAW,EAAuB;EACnE,OAAOI,YAAY,CAAEJ,GAAI,CAAC,EAAEM,IAAI,CAACC,KAAK,CAAE,GAAI,CAAC,CAAE,CAAC,CAAE,CAAC,CAAC;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAAER,GAAW,EAAS;EAClD,IAAKH,KAAK,CAAEG,GAAG,CAAE,EAAG;IACnBC,MAAM,CAACC,GAAG,CAACO,eAAe,CAAET,GAAI,CAAC;EAClC;EAEA,OAAOH,KAAK,CAAEG,GAAG,CAAE;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASU,SAASA,CAAEV,GAAuB,EAAY;EAC7D,IAAK,CAAEA,GAAG,IAAI,CAAEA,GAAG,CAACW,OAAO,EAAG;IAC7B,OAAO,KAAK;EACb;EACA,OAAOX,GAAG,CAACW,OAAO,CAAE,OAAQ,CAAC,KAAK,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAC3BC,QAAgB,EAChBC,OAAiB,EACjBC,WAAmB,GAAG,EAAE,EACjB;EACP,IAAK,CAAEF,QAAQ,IAAI,CAAEC,OAAO,EAAG;IAC9B;EACD;EAEA,MAAMf,IAAI,GAAG,IAAIE,MAAM,CAACe,IAAI,CAAE,CAAEF,OAAO,CAAE,EAAE;IAAER,IAAI,EAAES;EAAY,CAAE,CAAC;EAClE,MAAMf,GAAG,GAAGC,MAAM,CAACC,GAAG,CAACC,eAAe,CAAEJ,IAAK,CAAC;EAC9C,MAAMkB,aAAa,GAAGC,QAAQ,CAACC,aAAa,CAAE,GAAI,CAAC;EACnDF,aAAa,CAACG,IAAI,GAAGpB,GAAG;EACxBiB,aAAa,CAACI,QAAQ,GAAGR,QAAQ;EACjCI,aAAa,CAACK,KAAK,CAACC,OAAO,GAAG,MAAM;EACpCL,QAAQ,CAACM,IAAI,CAACC,WAAW,CAAER,aAAc,CAAC;EAC1CA,aAAa,CAACS,KAAK,CAAC,CAAC;EACrBR,QAAQ,CAACM,IAAI,CAACG,WAAW,CAAEV,aAAc,CAAC;EAC1ChB,MAAM,CAACC,GAAG,CAACO,eAAe,CAAET,GAAI,CAAC;AAClC","ignoreList":[]}
|
package/build-types/index.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create a blob URL from a file.
|
|
3
3
|
*
|
|
4
|
-
* @param
|
|
4
|
+
* @param file The file to create a blob URL for.
|
|
5
5
|
*
|
|
6
|
-
* @return
|
|
6
|
+
* @return The blob URL.
|
|
7
7
|
*/
|
|
8
|
-
export function createBlobURL(file: File): string;
|
|
8
|
+
export declare function createBlobURL(file: File): string;
|
|
9
9
|
/**
|
|
10
10
|
* Retrieve a file based on a blob URL. The file must have been created by
|
|
11
11
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
12
12
|
* `undefined`.
|
|
13
13
|
*
|
|
14
|
-
* @param
|
|
14
|
+
* @param url The blob URL.
|
|
15
15
|
*
|
|
16
|
-
* @return
|
|
16
|
+
* @return The file for the blob URL.
|
|
17
17
|
*/
|
|
18
|
-
export function getBlobByURL(url: string): File | undefined;
|
|
18
|
+
export declare function getBlobByURL(url: string): File | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Retrieve a blob type based on URL. The file must have been created by
|
|
21
21
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
22
22
|
* `undefined`.
|
|
23
23
|
*
|
|
24
|
-
* @param
|
|
24
|
+
* @param url The blob URL.
|
|
25
25
|
*
|
|
26
|
-
* @return
|
|
26
|
+
* @return The blob type.
|
|
27
27
|
*/
|
|
28
|
-
export function getBlobTypeByURL(url: string): string | undefined;
|
|
28
|
+
export declare function getBlobTypeByURL(url: string): string | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Remove the resource and file cache from memory.
|
|
31
31
|
*
|
|
32
|
-
* @param
|
|
32
|
+
* @param url The blob URL.
|
|
33
33
|
*/
|
|
34
|
-
export function revokeBlobURL(url: string): void;
|
|
34
|
+
export declare function revokeBlobURL(url: string): void;
|
|
35
35
|
/**
|
|
36
36
|
* Check whether a url is a blob url.
|
|
37
37
|
*
|
|
38
|
-
* @param
|
|
38
|
+
* @param url The URL.
|
|
39
39
|
*
|
|
40
|
-
* @return
|
|
40
|
+
* @return Is the url a blob url?
|
|
41
41
|
*/
|
|
42
|
-
export function isBlobURL(url: string | undefined): boolean;
|
|
42
|
+
export declare function isBlobURL(url: string | undefined): boolean;
|
|
43
43
|
/**
|
|
44
44
|
* Downloads a file, e.g., a text or readable stream, in the browser.
|
|
45
45
|
* Appropriate for downloading smaller file sizes, e.g., < 5 MB.
|
|
@@ -59,9 +59,9 @@ export function isBlobURL(url: string | undefined): boolean;
|
|
|
59
59
|
* downloadBlob( filename, fileContent, 'application/json' );
|
|
60
60
|
* ```
|
|
61
61
|
*
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
62
|
+
* @param filename File name.
|
|
63
|
+
* @param content File content (BufferSource | Blob | string).
|
|
64
|
+
* @param contentType (Optional) File mime type. Default is `''`.
|
|
65
65
|
*/
|
|
66
|
-
export function downloadBlob(filename: string, content: BlobPart, contentType?: string): void;
|
|
66
|
+
export declare function downloadBlob(filename: string, content: BlobPart, contentType?: string): void;
|
|
67
67
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAE,IAAI,EAAE,IAAI,GAAI,MAAM,CAMlD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAE,GAAG,EAAE,MAAM,GAAI,IAAI,GAAG,SAAS,CAE5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAE,GAAG,EAAE,MAAM,GAAI,MAAM,GAAG,SAAS,CAElE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAE,GAAG,EAAE,MAAM,GAAI,IAAI,CAMjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAI,OAAO,CAK5D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,YAAY,CAC3B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,QAAQ,EACjB,WAAW,GAAE,MAAW,GACtB,IAAI,CAeN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/blob",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Blob utilities for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "66d3bf12e67d16deddc4b4a9ec42e1d0bed3479a"
|
|
37
37
|
}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* @type {Record<string, File|undefined>}
|
|
3
|
-
*/
|
|
4
|
-
const cache = {};
|
|
1
|
+
const cache: Record< string, File > = {};
|
|
5
2
|
|
|
6
3
|
/**
|
|
7
4
|
* Create a blob URL from a file.
|
|
8
5
|
*
|
|
9
|
-
* @param
|
|
6
|
+
* @param file The file to create a blob URL for.
|
|
10
7
|
*
|
|
11
|
-
* @return
|
|
8
|
+
* @return The blob URL.
|
|
12
9
|
*/
|
|
13
|
-
export function createBlobURL( file ) {
|
|
10
|
+
export function createBlobURL( file: File ): string {
|
|
14
11
|
const url = window.URL.createObjectURL( file );
|
|
15
12
|
|
|
16
13
|
cache[ url ] = file;
|
|
@@ -23,11 +20,11 @@ export function createBlobURL( file ) {
|
|
|
23
20
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
24
21
|
* `undefined`.
|
|
25
22
|
*
|
|
26
|
-
* @param
|
|
23
|
+
* @param url The blob URL.
|
|
27
24
|
*
|
|
28
|
-
* @return
|
|
25
|
+
* @return The file for the blob URL.
|
|
29
26
|
*/
|
|
30
|
-
export function getBlobByURL( url ) {
|
|
27
|
+
export function getBlobByURL( url: string ): File | undefined {
|
|
31
28
|
return cache[ url ];
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -36,20 +33,20 @@ export function getBlobByURL( url ) {
|
|
|
36
33
|
* `createBlobURL` and not removed by `revokeBlobURL`, otherwise it will return
|
|
37
34
|
* `undefined`.
|
|
38
35
|
*
|
|
39
|
-
* @param
|
|
36
|
+
* @param url The blob URL.
|
|
40
37
|
*
|
|
41
|
-
* @return
|
|
38
|
+
* @return The blob type.
|
|
42
39
|
*/
|
|
43
|
-
export function getBlobTypeByURL( url ) {
|
|
40
|
+
export function getBlobTypeByURL( url: string ): string | undefined {
|
|
44
41
|
return getBlobByURL( url )?.type.split( '/' )[ 0 ]; // 0: media type , 1: file extension eg ( type: 'image/jpeg' ).
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
/**
|
|
48
45
|
* Remove the resource and file cache from memory.
|
|
49
46
|
*
|
|
50
|
-
* @param
|
|
47
|
+
* @param url The blob URL.
|
|
51
48
|
*/
|
|
52
|
-
export function revokeBlobURL( url ) {
|
|
49
|
+
export function revokeBlobURL( url: string ): void {
|
|
53
50
|
if ( cache[ url ] ) {
|
|
54
51
|
window.URL.revokeObjectURL( url );
|
|
55
52
|
}
|
|
@@ -60,11 +57,11 @@ export function revokeBlobURL( url ) {
|
|
|
60
57
|
/**
|
|
61
58
|
* Check whether a url is a blob url.
|
|
62
59
|
*
|
|
63
|
-
* @param
|
|
60
|
+
* @param url The URL.
|
|
64
61
|
*
|
|
65
|
-
* @return
|
|
62
|
+
* @return Is the url a blob url?
|
|
66
63
|
*/
|
|
67
|
-
export function isBlobURL( url ) {
|
|
64
|
+
export function isBlobURL( url: string | undefined ): boolean {
|
|
68
65
|
if ( ! url || ! url.indexOf ) {
|
|
69
66
|
return false;
|
|
70
67
|
}
|
|
@@ -90,11 +87,15 @@ export function isBlobURL( url ) {
|
|
|
90
87
|
* downloadBlob( filename, fileContent, 'application/json' );
|
|
91
88
|
* ```
|
|
92
89
|
*
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
90
|
+
* @param filename File name.
|
|
91
|
+
* @param content File content (BufferSource | Blob | string).
|
|
92
|
+
* @param contentType (Optional) File mime type. Default is `''`.
|
|
96
93
|
*/
|
|
97
|
-
export function downloadBlob(
|
|
94
|
+
export function downloadBlob(
|
|
95
|
+
filename: string,
|
|
96
|
+
content: BlobPart,
|
|
97
|
+
contentType: string = ''
|
|
98
|
+
): void {
|
|
98
99
|
if ( ! filename || ! content ) {
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { isBlobURL, getBlobTypeByURL, downloadBlob } from '
|
|
4
|
+
import { isBlobURL, getBlobTypeByURL, downloadBlob } from '..';
|
|
5
5
|
|
|
6
6
|
describe( 'isBlobURL', () => {
|
|
7
7
|
it( 'returns true if the url starts with "blob:"', () => {
|
|
@@ -13,17 +13,23 @@ describe( 'isBlobURL', () => {
|
|
|
13
13
|
} );
|
|
14
14
|
|
|
15
15
|
it( 'returns false if the url is not defined', () => {
|
|
16
|
-
expect(
|
|
16
|
+
expect(
|
|
17
|
+
// @ts-expect-error This is not a valid call according to types.
|
|
18
|
+
isBlobURL()
|
|
19
|
+
).toBe( false );
|
|
17
20
|
} );
|
|
18
21
|
} );
|
|
19
22
|
|
|
20
23
|
describe( 'getBlobTypeByURL', () => {
|
|
21
24
|
it( 'returns undefined if the blob is not found', () => {
|
|
22
|
-
expect( getBlobTypeByURL( 'blob:notexisting' ) ).
|
|
25
|
+
expect( getBlobTypeByURL( 'blob:notexisting' ) ).toBeUndefined();
|
|
23
26
|
} );
|
|
24
27
|
|
|
25
28
|
it( 'returns undefined if the url is not defined', () => {
|
|
26
|
-
expect(
|
|
29
|
+
expect(
|
|
30
|
+
// @ts-expect-error This is not a valid call according to types.
|
|
31
|
+
getBlobTypeByURL()
|
|
32
|
+
).toBeUndefined();
|
|
27
33
|
} );
|
|
28
34
|
} );
|
|
29
35
|
|
|
@@ -36,13 +42,17 @@ describe( 'downloadBlob', () => {
|
|
|
36
42
|
const createElementSpy = jest
|
|
37
43
|
.spyOn( global.document, 'createElement' )
|
|
38
44
|
.mockReturnValue( mockAnchorElement );
|
|
45
|
+
|
|
39
46
|
const mockBlob = jest.fn();
|
|
40
|
-
const blobSpy = jest
|
|
47
|
+
const blobSpy = jest
|
|
48
|
+
.spyOn( window, 'Blob' )
|
|
49
|
+
.mockReturnValue( mockBlob as unknown as Blob );
|
|
41
50
|
jest.spyOn( document.body, 'appendChild' );
|
|
42
51
|
jest.spyOn( document.body, 'removeChild' );
|
|
43
52
|
beforeEach( () => {
|
|
44
53
|
// Can't seem to spy on these static methods. They are `undefined`.
|
|
45
54
|
// Possibly overwritten: https://github.com/WordPress/gutenberg/blob/trunk/packages/jest-preset-default/scripts/setup-globals.js#L5
|
|
55
|
+
// @ts-expect-error This is not a valid URL object.
|
|
46
56
|
window.URL = {
|
|
47
57
|
createObjectURL,
|
|
48
58
|
revokeObjectURL,
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/index.js"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","886e50ef125efb7878f744e86908884c0133e7a6d9d80013f421b0cd8fb2af94",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"87d219e4d7353ca9cecdfe1fef957a8814470c8d693e80dd52748a92516ef734","signature":"16258cc4f086b5039fe3a4583a182baab614d41dc7287aa3ebedf686dee4502a"}],"root":[70],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[68,69,12,13,15,14,2,16,17,18,19,20,21,22,23,3,24,4,25,29,26,27,28,30,31,32,5,33,34,35,36,6,40,37,38,39,41,7,42,47,48,43,44,45,46,8,52,49,50,51,53,9,54,55,56,59,57,58,60,61,10,1,62,11,66,64,63,67,65,70],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.4.5"}
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/index.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","886e50ef125efb7878f744e86908884c0133e7a6d9d80013f421b0cd8fb2af94",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"900d1e17e812c1ac65da007150000cf8d43e3c1132f441e5a5376d97ba9b7815","signature":"26dbb5d43d71f83d67778a513a7b130555d5d844bce071e340373e69d7ca3c8f"}],"root":[70],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[68,69,12,13,15,14,2,16,17,18,19,20,21,22,23,3,24,4,25,29,26,27,28,30,31,32,5,33,34,35,36,6,40,37,38,39,41,7,42,47,48,43,44,45,46,8,52,49,50,51,53,9,54,55,56,59,57,58,60,61,10,1,62,11,66,64,63,67,65,70],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.4.5"}
|