@fastly/compute-js-static-publish 4.2.0 → 4.2.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.
@@ -2,28 +2,28 @@ import path from "path";
2
2
  import globToRegExp from 'glob-to-regexp';
3
3
  import { buildNormalizeFunctionForArray, buildNormalizeFunctionForObject, isSpecified, isStringAndNotEmpty, } from "./util/data.js";
4
4
  const normalizeContentTypeDef = buildNormalizeFunctionForObject((config, errors) => {
5
- let { test, type, binary } = config;
5
+ let { test, contentType, text } = config;
6
6
  if (typeof test === 'function' || test instanceof RegExp) {
7
7
  // ok
8
8
  }
9
9
  else {
10
10
  errors.push('test cannot be null.');
11
11
  }
12
- if (isStringAndNotEmpty(type)) {
12
+ if (isStringAndNotEmpty(contentType)) {
13
13
  // ok
14
14
  }
15
15
  else {
16
- errors.push('type must be a non-empty string.');
16
+ errors.push('contentType must be a non-empty string.');
17
17
  }
18
- if (!isSpecified(config, 'binary')) {
19
- binary = false;
18
+ if (!isSpecified(config, 'text')) {
19
+ text = true;
20
20
  }
21
21
  else {
22
- if (typeof binary === 'boolean') {
22
+ if (typeof text === 'boolean') {
23
23
  // ok
24
24
  }
25
25
  else {
26
- errors.push('binary, if specified, must be a boolean value.');
26
+ errors.push('text, if specified, must be a boolean value.');
27
27
  }
28
28
  }
29
29
  if (errors.length > 0) {
@@ -31,8 +31,8 @@ const normalizeContentTypeDef = buildNormalizeFunctionForObject((config, errors)
31
31
  }
32
32
  return {
33
33
  test,
34
- contentType: type,
35
- binary,
34
+ contentType,
35
+ text,
36
36
  };
37
37
  });
38
38
  const normalizeContentTypeDefs = buildNormalizeFunctionForArray((config, errors) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fastly/compute-js-static-publish",
3
3
  "type": "module",
4
- "version": "4.2.0",
4
+ "version": "4.2.1",
5
5
  "description": "Static Publisher for Compute@Edge JavaScript",
6
6
  "main": "./build/index.js",
7
7
  "types": "./build/index.d.ts",