@fastly/compute-js-static-publish 3.5.0 → 3.6.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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastly/compute-js-static-publish",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0",
|
|
5
5
|
"description": "Static Publisher for Compute@Edge JavaScript",
|
|
6
6
|
"main": "./build/index.js",
|
|
7
7
|
"types": "./build/index.d.ts",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/fastly/compute-js-static-publish#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@fastly/js-compute": "^1.
|
|
33
|
+
"@fastly/js-compute": "^1.4.0",
|
|
34
34
|
"command-line-args": "^5.2.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -84,7 +84,7 @@ function mergeContentTypes(contentTypes) {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
function testFileContentType(contentTypes, file) {
|
|
87
|
-
for (const contentType of contentTypes) {
|
|
87
|
+
for (const contentType of contentTypes ?? defaultContentTypes) {
|
|
88
88
|
let matched = false;
|
|
89
89
|
if(contentType.test instanceof RegExp) {
|
|
90
90
|
matched = contentType.test.test(file);
|
|
@@ -100,6 +100,7 @@ function testFileContentType(contentTypes, file) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
module.exports = {
|
|
103
|
+
defaultContentTypes,
|
|
103
104
|
mergeContentTypes,
|
|
104
105
|
testFileContentType,
|
|
105
106
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ContentTypeDef = {
|
|
2
|
+
test: RegExp | ((path: string) => boolean),
|
|
3
|
+
type: string,
|
|
4
|
+
binary?: boolean,
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export type ContentTypeTestResult = {
|
|
8
|
+
type: string,
|
|
9
|
+
binary: boolean,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
declare const defaultContentTypes: ContentTypeDef[];
|
|
13
|
+
|
|
14
|
+
declare function mergeContentTypes(entries?: ContentTypeDef[]): ContentTypeDef[];
|
|
15
|
+
declare function testFileContentType(entries: ContentTypeDef[] | null | undefined, path: string): ContentTypeTestResult | null;
|