@atlaspack/optimizer-data-url 2.14.5-canary.138 → 2.14.5-canary.139
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/lib/DataURLOptimizer.js
CHANGED
|
@@ -33,6 +33,8 @@ function _isbinaryfile() {
|
|
|
33
33
|
return data;
|
|
34
34
|
}
|
|
35
35
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
36
|
+
// @ts-expect-error TS7016
|
|
37
|
+
|
|
36
38
|
const fixedEncodeURIComponent = str => {
|
|
37
39
|
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
|
|
38
40
|
return '%' + c.charCodeAt(0).toString(16);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/optimizer-data-url",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.139+d2fd84977",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,17 +9,21 @@
|
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "https://github.com/atlassian-labs/atlaspack.git"
|
|
11
11
|
},
|
|
12
|
-
"main": "lib/DataURLOptimizer.js",
|
|
13
|
-
"source": "src/DataURLOptimizer.
|
|
12
|
+
"main": "./lib/DataURLOptimizer.js",
|
|
13
|
+
"source": "./src/DataURLOptimizer.ts",
|
|
14
|
+
"types": "./lib/DataURLOptimizer.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">= 16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
19
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
19
|
+
"@atlaspack/plugin": "2.14.5-canary.139+d2fd84977",
|
|
20
|
+
"@atlaspack/utils": "2.14.5-canary.139+d2fd84977",
|
|
20
21
|
"isbinaryfile": "^4.0.2",
|
|
21
22
|
"mime": "^2.4.4"
|
|
22
23
|
},
|
|
23
24
|
"type": "commonjs",
|
|
24
|
-
"
|
|
25
|
-
|
|
25
|
+
"scripts": {
|
|
26
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src"
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
|
|
29
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// @flow strict-local
|
|
2
|
-
|
|
3
1
|
import {Optimizer} from '@atlaspack/plugin';
|
|
4
2
|
import {blobToBuffer} from '@atlaspack/utils';
|
|
3
|
+
// @ts-expect-error TS7016
|
|
5
4
|
import mime from 'mime';
|
|
6
5
|
import {isBinaryFile} from 'isbinaryfile';
|
|
7
6
|
|
|
@@ -11,7 +10,7 @@ const fixedEncodeURIComponent = (str: string): string => {
|
|
|
11
10
|
});
|
|
12
11
|
};
|
|
13
12
|
|
|
14
|
-
export default
|
|
13
|
+
export default new Optimizer({
|
|
15
14
|
async optimize({bundle, contents}) {
|
|
16
15
|
let bufferContents = await blobToBuffer(contents);
|
|
17
16
|
let hasBinaryContent = await isBinaryFile(bufferContents);
|
|
@@ -29,4 +28,4 @@ export default (new Optimizer({
|
|
|
29
28
|
contents: `data:${mimeType}${encoding},${content}`,
|
|
30
29
|
};
|
|
31
30
|
},
|
|
32
|
-
})
|
|
31
|
+
}) as Optimizer<unknown, unknown>;
|
package/tsconfig.json
ADDED