@kasoa/env 0.0.10 → 0.0.12

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/README.md CHANGED
@@ -20,6 +20,7 @@ const env = defineEnv(
20
20
  PORT: v.pipe(v.string(), v.transform(Number)),
21
21
  NODE_ENV: v.optional(v.picklist(["development", "production"]), "development"),
22
22
  }),
23
+ process.env,
23
24
  );
24
25
 
25
26
  // env is fully typed:
@@ -35,12 +36,12 @@ const env = defineEnv(
35
36
 
36
37
  ## API
37
38
 
38
- ### `defineEnv(schema, env?)`
39
+ ### `defineEnv(schema, env)`
39
40
 
40
41
  Validates environment variables against the provided schema.
41
42
 
42
43
  - `schema` - A Standard Schema compatible schema
43
- - `env` - Optional env object (defaults to `process.env`)
44
+ - `env` - Env object to validate
44
45
 
45
46
  Returns the validated and typed environment object.
46
47
 
@@ -1,4 +1,4 @@
1
1
  import type { StandardSchemaV1 } from "@standard-schema/spec";
2
2
  export type InferEnv<T extends StandardSchemaV1> = StandardSchemaV1.InferOutput<T>;
3
- export declare function defineEnv<T extends StandardSchemaV1>(schema: T, env?: Record<string, string | undefined>): InferEnv<T>;
3
+ export declare function defineEnv<T extends StandardSchemaV1>(schema: T, env: Readonly<Record<string, string | undefined>>): InferEnv<T>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAEnF,wBAAgB,SAAS,CAAC,CAAC,SAAS,gBAAgB,EAClD,MAAM,EAAE,CAAC,EACT,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GACpD,QAAQ,CAAC,CAAC,CAAC,CAab"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;AAEnF,wBAAgB,SAAS,CAAC,CAAC,SAAS,gBAAgB,EAClD,MAAM,EAAE,CAAC,EACT,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,QAAQ,CAAC,CAAC,CAAC,CAab"}
package/dist/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export function defineEnv(schema, env = process.env) {
1
+ export function defineEnv(schema, env) {
2
2
  const normalizedEnv = normalizeEnv(env);
3
3
  const result = schema["~standard"].validate(normalizedEnv);
4
4
  if (result instanceof Promise) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kasoa/env",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "description": "Type-safe environment variable validation using Standard Schema",
5
5
  "keywords": [
6
6
  "env",
@@ -39,14 +39,14 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^25.3.0",
42
- "@typescript/native-preview": "^7.0.0-dev.20260223.1",
43
- "oxfmt": "^0.35.0",
44
- "oxlint": "^1.50.0",
45
- "oxlint-tsgolint": "^0.14.2",
42
+ "@typescript/native-preview": "^7.0.0-dev.20260224.1",
43
+ "oxfmt": "^0.36.0",
44
+ "oxlint": "^1.51.0",
45
+ "oxlint-tsgolint": "^0.16.0",
46
46
  "valibot": "^1.2.0",
47
47
  "vitest": "^4.0.18",
48
- "@kasoa/oxfmt-config": "0.0.3",
49
- "@kasoa/oxlint-config": "0.0.3"
48
+ "@kasoa/oxlint-config": "0.0.6",
49
+ "@kasoa/oxfmt-config": "0.0.5"
50
50
  },
51
51
  "engines": {
52
52
  "node": ">=24"
@@ -54,8 +54,8 @@
54
54
  "scripts": {
55
55
  "dev": "tsgo --watch",
56
56
  "build": "tsgo",
57
- "lint": "oxlint --type-aware --fix .",
58
- "format": "oxfmt -c ./node_modules/@kasoa/oxfmt-config/configs/base.json .",
57
+ "lint": "oxlint --fix .",
58
+ "format": "oxfmt -c ./node_modules/@kasoa/oxfmt-config/dist/src/base/index.json .",
59
59
  "typecheck": "tsgo --noEmit",
60
60
  "test": "vitest run"
61
61
  }