@bgord/bun 1.4.15 → 1.4.16

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/bun",
3
- "version": "1.4.15",
3
+ "version": "1.4.16",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -1,6 +1,8 @@
1
1
  import type { z } from "zod/v4";
2
2
  import { NodeEnvironment, type NodeEnvironmentEnum } from "../src/node-env.vo";
3
3
 
4
+ export type EnvironmentResultType<Schema> = z.infer<Schema> & { type: NodeEnvironmentEnum };
5
+
4
6
  export class EnvironmentValidator<Schema extends z.ZodObject<any>> {
5
7
  private readonly type: NodeEnvironmentEnum;
6
8
  private readonly schema: Schema;
@@ -10,7 +12,7 @@ export class EnvironmentValidator<Schema extends z.ZodObject<any>> {
10
12
  this.type = NodeEnvironment.parse(config.type);
11
13
  }
12
14
 
13
- load(env: NodeJS.ProcessEnv): z.infer<Schema> & { type: NodeEnvironmentEnum } {
15
+ load(env: NodeJS.ProcessEnv): EnvironmentResultType<Schema> {
14
16
  return { ...this.schema.parse(env), type: this.type };
15
17
  }
16
18
  }