zarro 1.193.0 → 1.194.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.
@@ -26,7 +26,7 @@
26
26
  }
27
27
  function parseBoolEnvVar(name, value) {
28
28
  try {
29
- return parseBool(value);
29
+ return parseBool(value, true);
30
30
  }
31
31
  catch (e) {
32
32
  throw new ZarroError(`environment variable '${name}' is invalid: could not parse '${value}' as a boolean value`);
@@ -10,13 +10,16 @@ const truthy = [
10
10
  "no",
11
11
  "false"
12
12
  ];
13
- function parseBool(value) {
13
+ function parseBool(value, strict) {
14
14
  if (truthy.indexOf(value === null || value === void 0 ? void 0 : value.toString()) > -1) {
15
15
  return true;
16
16
  }
17
17
  if (falsey.indexOf(value === null || value === void 0 ? void 0 : value.toString()) > -1) {
18
18
  return false;
19
19
  }
20
- throw new Error(`could not parse '${value}' as a boolean value`);
20
+ if (strict) {
21
+ throw new Error(`could not parse '${value}' as a boolean value`);
22
+ }
23
+ return !!value;
21
24
  }
22
25
  exports.parseBool = parseBool;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.193.0",
3
+ "version": "1.194.0",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "index.js"
package/types.d.ts CHANGED
@@ -2218,7 +2218,7 @@ declare global {
2218
2218
  }
2219
2219
 
2220
2220
  interface ParseBool {
2221
- parseBool: (s: string) => boolean;
2221
+ parseBool: (s: string, strict?: boolean) => boolean;
2222
2222
  }
2223
2223
  }
2224
2224