@tahminator/pipeline 1.0.34 → 1.0.35

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.
@@ -1,5 +1,6 @@
1
1
  import { $ } from "bun";
2
2
  import yaml from "yaml";
3
+ const validScalarTypes = ["string", "number", "boolean"];
3
4
  export class SopsEnvClientStrategy {
4
5
  /**
5
6
  * __NOTE: Only yaml files are currently supported.__
@@ -30,10 +31,10 @@ export class SopsEnvClientStrategy {
30
31
  throw new Error(`Expected ${envFile.name} to decrypt to a root-level YAML object.`);
31
32
  }
32
33
  for (const [key, value] of Object.entries(parsed)) {
33
- if (typeof value !== "string") {
34
- throw new Error(`Expected ${envFile.name} key \`${key}\` to contain a string value.`);
34
+ if (!validScalarTypes.includes(typeof value)) {
35
+ throw new Error(`Expected ${envFile.name} key \`${key}\` to contain a string/number/boolean value.`);
35
36
  }
36
- loaded.set(key, value);
37
+ loaded.set(key, String(value));
37
38
  }
38
39
  return loaded;
39
40
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "author": "Tahmid Ahmed",
5
5
  "description": "A collection of Bun shell scripts that can be re-used in various CICD pipelines.",
6
- "version": "1.0.34",
6
+ "version": "1.0.35",
7
7
  "repository": {
8
8
  "url": "git+https://github.com/tahminator/pipeline.git"
9
9
  },