@arkenv/standard 1.0.0-alpha.7 → 1.0.0-alpha.9
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/dist/bind-arkenv-D5X_ukEU.js +1 -0
- package/dist/{bind-arkenv-F4i-iDsA.cjs → bind-arkenv-DCVPKJ39.cjs} +1 -1
- package/dist/index-ByAIZ0F1.d.ts +622 -0
- package/dist/index-DdPEn3aK.d.cts +622 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{src-BZoXXFsx.cjs → src-CJWeQijZ.js} +1 -1
- package/dist/{src-BxruqAr0.js → src-DTEO2b2p.cjs} +1 -2
- package/dist/valibot.cjs +1 -1
- package/dist/valibot.d.cts +2 -3
- package/dist/valibot.d.ts +2 -3
- package/dist/valibot.js +1 -2
- package/dist/zod-mini.cjs +1 -1
- package/dist/zod-mini.d.cts +2 -3
- package/dist/zod-mini.d.ts +2 -3
- package/dist/zod-mini.js +1 -2
- package/package.json +1 -1
- package/dist/bind-arkenv-Z7Nl-5uk.js +0 -2
- package/dist/bind-arkenv-Z7Nl-5uk.js.map +0 -1
- package/dist/index-DLnvC3Za.d.ts +0 -12612
- package/dist/index-DLnvC3Za.d.ts.map +0 -1
- package/dist/index-Dn1RAoiV.d.cts +0 -12612
- package/dist/index-Dn1RAoiV.d.cts.map +0 -1
- package/dist/src-BxruqAr0.js.map +0 -1
- package/dist/valibot.d.cts.map +0 -1
- package/dist/valibot.d.ts.map +0 -1
- package/dist/valibot.js.map +0 -1
- package/dist/zod-mini.d.cts.map +0 -1
- package/dist/zod-mini.d.ts.map +0 -1
- package/dist/zod-mini.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const e=`ArkEnvError`,t=e=>{if(typeof e==`number`||typeof e!=`string`||!e.trim())return e;if(e.trim()===`NaN`)return NaN;let t=Number(e);return Number.isNaN(t)?e:t},n=e=>e===`true`?!0:e===`false`?!1:e,r=e=>{if(typeof e!=`string`)return e;let t=e.trim();if(t[0]!==`{`&&t[0]!==`[`)return e;try{return JSON.parse(t)}catch{return e}},i=e=>{if(e instanceof Date||typeof e!=`string`||!e.trim())return e;let t=new Date(e);return Number.isNaN(t.getTime())?e:t},a=e=>{let t={};for(let n in e){let r=e[n];r!==``&&(t[n]=r)}return t},o=(e,t=[])=>{let n=[];if(!e||typeof e!=`object`||Array.isArray(e))return n;let r=e;if(`const`in r){let e=typeof r.const;(e===`number`||e===`boolean`)&&n.push({path:[...t],type:`primitive`})}`enum`in r&&Array.isArray(r.enum)&&r.enum.some(e=>typeof e==`number`||typeof e==`boolean`)&&n.push({path:[...t],type:`primitive`});let i=r.type;if(i===`number`||i===`integer`||i===`boolean`)n.push({path:[...t],type:`primitive`});else if(i===`string`&&`format`in r&&(r.format===`date-time`||r.format===`date`))n.push({path:[...t],type:`date`});else if(i===`object`){if(r.properties&&Object.keys(r.properties).length>0){n.push({path:[...t],type:`object`});for(let e in r.properties)n.push(...o(r.properties[e],[...t,e]))}}else i===`array`&&(n.push({path:[...t],type:`array`}),r.items&&(Array.isArray(r.items)?r.items.forEach((e,r)=>{n.push(...o(e,[...t,String(r)]))}):n.push(...o(r.items,[...t,`*`]))));for(let e of[`anyOf`,`allOf`,`oneOf`])if(r[e]&&Array.isArray(r[e]))for(let i of r[e])n.push(...o(i,t));let a=new Set;return n.filter(e=>{let t=e.path.join(`/`)+`:`+e.type;return a.has(t)?!1:a.add(t)})},s=(e,a,o={})=>{let{arrayFormat:s=`comma`}=o,c=e=>{if(s===`json`)try{return JSON.parse(e)}catch{return e}return e.trim()?e.split(`,`).map(e=>e.trim()):[]},l=(e,a)=>{if(a===`array`&&typeof e==`string`)return c(e);if(a===`object`&&typeof e==`string`)return r(e);if(a===`date`&&typeof e==`string`)return i(e);if(a===`primitive`){if(Array.isArray(e))return e.map(e=>{if(typeof e!=`string`)return e;let r=t(e);return typeof r==`number`?r:n(e)});if(typeof e!=`string`)return e;let r=t(e);return typeof r==`number`?r:n(e)}return e};if(typeof e!=`object`||!e){let t=a.find(e=>e.path.length===0);return t?l(e,t.type):e}let u=[...a].sort((e,t)=>e.path.length-t.path.length),d=(e,t,n)=>{if(t.length===0)return n(e);let[r,...i]=t;if(r===`*`){if(Array.isArray(e)){let t=!1,r=e.map(e=>{let r=d(e,i,n);return r!==e&&(t=!0),r});return t?r:e}return e}if(!e||typeof e!=`object`)return e;if(Array.isArray(e)){let t=Number(r);if(!Number.isNaN(t)&&t>=0&&t<e.length){let r=d(e[t],i,n);if(r!==e[t]){let n=[...e];return n[t]=r,n}}return e}if(Object.hasOwn(e,r)){let t=d(e[r],i,n);if(t!==e[r])return{...e,[r]:t}}return e},f=e;for(let e of u)e.path.length>0&&(f=d(f,e.path,t=>l(t,e.type)));return f};function c(e,t,n,r){let i=t?a(e):e,c={...i},l=[];if(r){let e=r();l.push(...e.missingKeys||[]),e.hasSchema&&(c=s(c,o(e.schema),{arrayFormat:n}))}return{processedEnv:i,coercedEnv:c,missingKeys:l}}const l=(e,t=2,{dontDetectNewlines:n=!1}={})=>n?`${` `.repeat(t)}${e}`:e.split(`
|
|
2
2
|
`).map(e=>`${` `.repeat(t)}${e}`).join(`
|
|
3
3
|
`),u={red:`\x1B[31m`,yellow:`\x1B[33m`,cyan:`\x1B[36m`,reset:`\x1B[0m`},d=()=>typeof process<`u`&&process.versions!=null&&process.versions.node!=null,f=()=>!!(!d()||process.env.NO_COLOR!==void 0||process.env.CI!==void 0||process.stdout&&!process.stdout.isTTY),p=(e,t)=>d()&&!f()?`${u[e]}${t}${u.reset}`:t;function m(e){return e.map(e=>`${p(`yellow`,e.path)} ${e.message.trimStart()}`).join(`
|
|
4
|
-
`)}var h=class extends Error{constructor(t,n=`Errors found while validating environment variables`){let r=m(t);super(`${p(`red`,n)}\n${l(r)}\n`),this.name=e,this.issues=t}};Object.defineProperty(h,`name`,{value:e});function g(e,t){if(typeof t==`string`)throw new h([{path:e,message:`ArkType DSL strings are not supported in "standard" mode. Use a Standard Schema validator (e.g., Zod, Valibot) or import from "arkenv" for ArkType schemas.`,code:`INVALID_SCHEMA`}])}function _(e,t){let n=t&&typeof t==`object`&&`~standard`in t&&t[`~standard`];if(!n||typeof n!=`object`||!(`validate`in n)||typeof n.validate!=`function`)throw new h([{path:e,message:`Invalid validator: expected a Standard Schema 1.0 validator (must have "~standard" property). Import from "arkenv" to use ArkType schemas.`,code:`INVALID_SCHEMA`}])}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))throw new h([{path:``,message:`Invalid schema: expected an object mapping in "standard" mode.`,code:`INVALID_SCHEMA`}])}const y=/secret|(_|^)key(_|$)|token|(_|^)password(_|$)|(_|^)pass(_|$)|(_|^)auth(_|$)|jwt|cert|credential|database_url|db_url/i;function b(e){if(e!==void 0)return e;if(typeof process>`u`)return!1;let t=process.env.ARKENV_DEBUG_SECRETS;return t===`true`||t===`1`}function x(e){return y.test(e)&&!/public/i.test(e)}function S(e,t,n){let r=b(n?.debugSecrets);if(e===void 0)return`missing`;if(e===null)return`null`;if(!r&&x(t))return`[REDACTED]`;if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);if(typeof e==`symbol`)return e.toString();if(typeof e==`function`)return`[Function]`;if(e&&typeof e==`object`)try{if(Array.isArray(e)){let r=e.slice(0,3).map(e=>S(e,t,n));return e.length>3&&r.push(`...(+${e.length-3} more)`),`[${r.join(`, `)}]`}let r=Object.keys(e),i=r.slice(0,3).map(r=>`${r}: ${S(e[r],t,n)}`);return r.length>3&&i.push(`...(+${r.length-3} more)`),`{ ${i.join(`, `)} }`}catch{return Object.prototype.toString.call(e)}return String(e)}const C={too_small:`VALUE_TOO_SMALL`,too_big:`VALUE_TOO_LARGE`,invalid_string:`INVALID_FORMAT`,invalid_date:`INVALID_FORMAT`,custom:`INVALID_FORMAT`};function w(e,t,n){let r=t.toLowerCase();return e===`invalid_type`&&(n===void 0||n===`undefined`)||r===`required`?`MISSING_VARIABLE`:e in C?C[e]:/regex|pattern|match/.test(r)?`PATTERN_MISMATCH`:`INVALID_TYPE`}function T(e){let t=e.minimum??e.min,n=e.maximum??e.max;return{...typeof t==`number`?{min:t}:{},...typeof n==`number`?{max:n}:{}}}function E(e){try{return{success:!0,data:e()}}catch(e){if(e instanceof h)return{success:!1,issues:e.issues};throw e}}function D(e,t,n,r,i,a){let o={path:e,message:t,code:n,meta:r??{}};return i&&(o.expected=i),a!==void 0&&(o.received=a),o}function O(e,t,n,r,i,a){if(t===`MISSING_VARIABLE`)return n?`must be ${n} (was missing)`:`is required`;if(e.includes(`(was `))return e;let o=`(was ${p(`cyan`,!b(a?.debugSecrets)&&x(i)?`[REDACTED]`:S(r,i,a))})`;return n&&!e.includes(`Expected`)?`must be ${n} ${o}`:`${e} ${o}`}function
|
|
5
|
-
//# sourceMappingURL=src-BxruqAr0.js.map
|
|
4
|
+
`)}var h=class extends Error{constructor(t,n=`Errors found while validating environment variables`){let r=m(t);super(`${p(`red`,n)}\n${l(r)}\n`),this.name=e,this.issues=t}};Object.defineProperty(h,`name`,{value:e});function g(e,t){if(typeof t==`string`)throw new h([{path:e,message:`ArkType DSL strings are not supported in "standard" mode. Use a Standard Schema validator (e.g., Zod, Valibot) or import from "arkenv" for ArkType schemas.`,code:`INVALID_SCHEMA`}])}function _(e,t){let n=t&&typeof t==`object`&&`~standard`in t&&t[`~standard`];if(!n||typeof n!=`object`||!(`validate`in n)||typeof n.validate!=`function`)throw new h([{path:e,message:`Invalid validator: expected a Standard Schema 1.0 validator (must have "~standard" property). Import from "arkenv" to use ArkType schemas.`,code:`INVALID_SCHEMA`}])}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))throw new h([{path:``,message:`Invalid schema: expected an object mapping in "standard" mode.`,code:`INVALID_SCHEMA`}])}const y=/secret|(_|^)key(_|$)|token|(_|^)password(_|$)|(_|^)pass(_|$)|(_|^)auth(_|$)|jwt|cert|credential|database_url|db_url/i;function b(e){if(e!==void 0)return e;if(typeof process>`u`)return!1;let t=process.env.ARKENV_DEBUG_SECRETS;return t===`true`||t===`1`}function x(e){return y.test(e)&&!/public/i.test(e)}function S(e,t,n){let r=b(n?.debugSecrets);if(e===void 0)return`missing`;if(e===null)return`null`;if(!r&&x(t))return`[REDACTED]`;if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);if(typeof e==`symbol`)return e.toString();if(typeof e==`function`)return`[Function]`;if(e&&typeof e==`object`)try{if(Array.isArray(e)){let r=e.slice(0,3).map(e=>S(e,t,n));return e.length>3&&r.push(`...(+${e.length-3} more)`),`[${r.join(`, `)}]`}let r=Object.keys(e),i=r.slice(0,3).map(r=>`${r}: ${S(e[r],t,n)}`);return r.length>3&&i.push(`...(+${r.length-3} more)`),`{ ${i.join(`, `)} }`}catch{return Object.prototype.toString.call(e)}return String(e)}const C={too_small:`VALUE_TOO_SMALL`,too_big:`VALUE_TOO_LARGE`,invalid_string:`INVALID_FORMAT`,invalid_date:`INVALID_FORMAT`,custom:`INVALID_FORMAT`};function w(e,t,n){let r=t.toLowerCase();return e===`invalid_type`&&(n===void 0||n===`undefined`)||r===`required`?`MISSING_VARIABLE`:e in C?C[e]:/regex|pattern|match/.test(r)?`PATTERN_MISMATCH`:`INVALID_TYPE`}function T(e){let t=e.minimum??e.min,n=e.maximum??e.max;return{...typeof t==`number`?{min:t}:{},...typeof n==`number`?{max:n}:{}}}function E(e){try{return{success:!0,data:e()}}catch(e){if(e instanceof h)return{success:!1,issues:e.issues};throw e}}function D(e,t,n,r,i,a){let o={path:e,message:t,code:n,meta:r??{}};return i&&(o.expected=i),a!==void 0&&(o.received=a),o}function O(e,t,n,r,i,a){if(t===`MISSING_VARIABLE`)return n?`must be ${n} (was missing)`:`is required`;if(e.includes(`(was `))return e;let o=`(was ${p(`cyan`,!b(a?.debugSecrets)&&x(i)?`[REDACTED]`:S(r,i,a))})`;return n&&!e.includes(`Expected`)?`must be ${n} ${o}`:`${e} ${o}`}const k=[`draft-07`,`draft-2020-12`];function A(e){return Object.prototype.toString.call(e)===`[object Object]`}function j(e){let t=`converter returned a non-schema`;for(let n of k)try{let r=e({target:n});if(A(r))return{ok:!0,schema:r};t=`converter returned a non-schema`}catch(e){t=e instanceof Error?e.message:String(e)}return{ok:!1,detail:t}}function M(e,t){throw new h([D(e,`JSON Schema conversion failed for '${e}': ${t}`,`INVALID_SCHEMA`)])}function N(e,t){let n={type:`object`,properties:{}},r=!1,i=[];for(let a in e){let o=e[a];if(!o){i.push(a);continue}let s=o[`~standard`];if(typeof s?.jsonSchema?.input==`function`){let e=j(s.jsonSchema.input);if(e.ok){n.properties[a]=e.schema,r=!0;continue}M(a,e.detail)}if(typeof o.jsonSchema?.input==`function`){let e=j(o.jsonSchema.input);if(e.ok){n.properties[a]=e.schema,r=!0;continue}M(a,e.detail)}if(typeof o.toJSONSchema==`function`)try{let e=o.toJSONSchema();if(e){n.properties[a]=e,r=!0;continue}}catch{}if(typeof o.toStandardJSONSchema?.v1==`function`)try{let e=o.toStandardJSONSchema.v1();if(e){n.properties[a]=e,r=!0;continue}}catch{}if(t){let e;try{e=t(o)}catch(e){throw new h([D(a,`toJsonSchema failed for '${a}': ${e instanceof Error?e.message:String(e)}`,`INVALID_SCHEMA`)])}if(!e){i.push(a);continue}if(!A(e))throw new h([D(a,`toJsonSchema must return a plain object or undefined for '${a}'.`,`INVALID_SCHEMA`)]);n.properties[a]=e,r=!0;continue}i.push(a)}return{jsonSchema:n,hasJsonSchema:r,missingKeys:i}}function P(e){return typeof e==`object`&&e&&`key`in e?String(e.key):String(e)}function F(e,t){return!t||t.length===0?e:[e,...t.map(P)].join(`.`)}function I(e,t){let n=e,r;try{let i=e,a=e.trim();if(a[0]===`{`||a[0]===`[`)try{i=JSON.parse(e)}catch(e){r=`[Unparseable JSON: ${e.message}]`}if(!r){for(let e of t)i=i?.[P(e)];n=i}}catch(e){r=`[Traversal error: ${e.message}]`}return{receivedVal:n,traversalError:r}}function L(e,t){let{env:n=process.env,onUndeclaredKey:r=`delete`,coerce:i=!0,arrayFormat:a=`comma`,emptyAsUndefined:o=!1,toJsonSchema:s}=t,l={},u=[],{processedEnv:d,coercedEnv:f,missingKeys:p}=c(n,o,a,i?()=>{let{jsonSchema:t,hasJsonSchema:n,missingKeys:r}=N(e,s);return{schema:t,hasSchema:n,missingKeys:r}}:void 0),m=new Set(Object.keys(d));for(let n in e){let r=e[n],a=f[n];if(!r||typeof r!=`object`||!(`~standard`in r))throw new h([D(n,`Invalid schema: expected a Standard Schema 1.0 validator (e.g. Zod, Valibot) in 'standard' mode.`,`INVALID_SCHEMA`)]);let o=r[`~standard`].validate(a);if(o instanceof Promise)throw new h([D(n,`Async validation is not supported. ArkEnv is synchronous.`,`INVALID_SCHEMA`)]);if(o.issues)for(let e of o.issues){let r=F(n,e.path),a,o;if(n in d){let t=d[n];if(typeof t==`string`&&e.path?.length){let n=I(t,e.path);a=n.receivedVal,o=n.traversalError}else a=t}else a=e.received;let s=w(e.code||`invalid_type`,e.message||``,a),c=e.expected||void 0,l={...T(e)},f=e;f.validation!==void 0&&(l.validation=f.validation),o!==void 0&&(l.traversalError=o);let m=O(e.message||``,s,c,a,r,t);i&&p.includes(n)&&(m+=` (Hint: coercion is enabled by default, but the validator for '${n}' lacks Standard JSON Schema support.)`),u.push(D(r,m,s,l,c,a))}else l[n]=o.value;m.delete(n)}if(r!==`delete`)for(let e of m)r===`reject`?u.push(D(e,`Undeclared key`,`UNDECLARED_KEY`)):r===`ignore`&&(l[e]=f[e]);if(u.length>0)throw new h(u);return l}function R(e){if(!e||typeof e!=`object`&&typeof e!=`function`)return[];if(e.json&&typeof e.json==`object`&&e.json.domain===`object`){let t=[];if(Array.isArray(e.json.required))for(let n of e.json.required)n&&typeof n==`object`&&`key`in n&&t.push(n.key);if(Array.isArray(e.json.optional))for(let n of e.json.optional)n&&typeof n==`object`&&`key`in n&&t.push(n.key);return t}let t=e[`~standard`],n=typeof t?.jsonSchema?.input==`function`&&t.jsonSchema.input||typeof e.jsonSchema?.input==`function`&&e.jsonSchema.input;if(n)try{let e=n({target:`draft-07`});if(e&&typeof e==`object`&&e.properties)return Object.keys(e.properties)}catch{}if(typeof e.toJSONSchema==`function`)try{let t=e.toJSONSchema();if(t&&typeof t==`object`&&t.properties)return Object.keys(t.properties)}catch{}if(typeof e.toStandardJSONSchema?.v1==`function`)try{let t=e.toStandardJSONSchema.v1();if(t&&typeof t==`object`&&t.properties)return Object.keys(t.properties)}catch{}return Object.keys(e)}const z=Symbol.for(`arkenv.schemaCapture.v1`);function B(){let e=globalThis;return e[z]||(e[z]={capturing:!1,definitions:[]}),e[z]}function V(){return B().capturing}function H(e){let t=B();t.capturing&&t.definitions.push(e)}function U(e,t){let n=t??{};v(e);for(let t in e){let n=e[t];g(t,n),_(t,n)}return V()?(H(e),{}):n.safe?E(()=>L(e,n)):L(e,n)}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}});
|
package/dist/valibot.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./src-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./src-DTEO2b2p.cjs`),t=require(`./bind-arkenv-DCVPKJ39.cjs`);let n=require(`@valibot/to-json-schema`);const r=t.t(e=>(0,n.toJsonSchema)(e,{typeMode:`input`,target:`draft-07`}));exports.ArkEnvError=e.n,exports.arkenv=r,exports.default=r,exports.formatIssues=e.r,exports.getSchemaKeys=e.i;
|
package/dist/valibot.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-
|
|
1
|
+
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-DdPEn3aK.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/valibot.d.ts
|
|
4
4
|
/**
|
|
@@ -26,5 +26,4 @@ import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues,
|
|
|
26
26
|
*/
|
|
27
27
|
declare const arkenv: typeof arkenv$1;
|
|
28
28
|
//#endregion
|
|
29
|
-
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
|
30
|
-
//# sourceMappingURL=valibot.d.cts.map
|
|
29
|
+
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
package/dist/valibot.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-
|
|
1
|
+
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-ByAIZ0F1.js";
|
|
2
2
|
|
|
3
3
|
//#region src/valibot.d.ts
|
|
4
4
|
/**
|
|
@@ -26,5 +26,4 @@ import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues,
|
|
|
26
26
|
*/
|
|
27
27
|
declare const arkenv: typeof arkenv$1;
|
|
28
28
|
//#endregion
|
|
29
|
-
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
|
30
|
-
//# sourceMappingURL=valibot.d.ts.map
|
|
29
|
+
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
package/dist/valibot.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n}from"./src-
|
|
2
|
-
//# sourceMappingURL=valibot.js.map
|
|
1
|
+
import{i as e,n as t,r as n}from"./src-CJWeQijZ.js";import{t as r}from"./bind-arkenv-D5X_ukEU.js";import{toJsonSchema as i}from"@valibot/to-json-schema";const a=r(e=>i(e,{typeMode:`input`,target:`draft-07`}));export{t as ArkEnvError,a as arkenv,a as default,n as formatIssues,e as getSchemaKeys};
|
package/dist/zod-mini.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./src-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`./src-DTEO2b2p.cjs`),t=require(`./bind-arkenv-DCVPKJ39.cjs`);let n=require(`zod/mini`);const r=t.t(e=>(0,n.toJSONSchema)(e,{io:`input`,target:`draft-07`}));exports.ArkEnvError=e.n,exports.arkenv=r,exports.default=r,exports.formatIssues=e.r,exports.getSchemaKeys=e.i;
|
package/dist/zod-mini.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-
|
|
1
|
+
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-DdPEn3aK.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/zod-mini.d.ts
|
|
4
4
|
/**
|
|
@@ -27,5 +27,4 @@ import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues,
|
|
|
27
27
|
*/
|
|
28
28
|
declare const arkenv: typeof arkenv$1;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
|
31
|
-
//# sourceMappingURL=zod-mini.d.cts.map
|
|
30
|
+
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
package/dist/zod-mini.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-
|
|
1
|
+
import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues, r as ArkEnvError, s as getSchemaKeys, t as StandardEnvConfig } from "./index-ByAIZ0F1.js";
|
|
2
2
|
|
|
3
3
|
//#region src/zod-mini.d.ts
|
|
4
4
|
/**
|
|
@@ -27,5 +27,4 @@ import { a as SafeArkEnvResult, i as EnvIssue, n as arkenv$1, o as formatIssues,
|
|
|
27
27
|
*/
|
|
28
28
|
declare const arkenv: typeof arkenv$1;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
|
31
|
-
//# sourceMappingURL=zod-mini.d.ts.map
|
|
30
|
+
export { ArkEnvError, type EnvIssue, type SafeArkEnvResult, type StandardEnvConfig, arkenv, arkenv as default, formatIssues, getSchemaKeys };
|
package/dist/zod-mini.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import{i as e,n as t,r as n}from"./src-
|
|
2
|
-
//# sourceMappingURL=zod-mini.js.map
|
|
1
|
+
import{i as e,n as t,r as n}from"./src-CJWeQijZ.js";import{t as r}from"./bind-arkenv-D5X_ukEU.js";import{toJSONSchema as i}from"zod/mini";const a=r(e=>i(e,{io:`input`,target:`draft-07`}));export{t as ArkEnvError,a as arkenv,a as default,n as formatIssues,e as getSchemaKeys};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arkenv/standard",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.9",
|
|
5
5
|
"description": "Dependency-free, typesafe environment variables validation based on Standard Schema",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bind-arkenv-Z7Nl-5uk.js","names":["createArkEnv"],"sources":["../src/bind-arkenv.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@repo/types\";\nimport { arkenv as createArkEnv, type StandardEnvConfig } from \"./index\";\n\ntype BoundArkEnv = typeof createArkEnv;\n\n/**\n * Bind `arkenv` to a default `toJsonSchema` converter.\n *\n * Callers can still pass `toJsonSchema` to override the bound converter.\n *\n * @param defaultToJsonSchema Converter used when the call omits `toJsonSchema`\n * @returns An `arkenv` function with the same public signature as the root export\n */\nexport function bindArkEnv(\n\tdefaultToJsonSchema: NonNullable<StandardEnvConfig[\"toJsonSchema\"]>,\n): BoundArkEnv {\n\tfunction boundArkEnv<\n\t\tconst T extends Record<string, StandardSchemaV1>,\n\t\tconst Safe extends boolean | undefined = undefined,\n\t>(def: T, config?: Omit<StandardEnvConfig, \"safe\"> & { safe?: Safe }) {\n\t\treturn createArkEnv(def, {\n\t\t\t...config,\n\t\t\ttoJsonSchema: config?.toJsonSchema ?? defaultToJsonSchema,\n\t\t});\n\t}\n\n\treturn boundArkEnv as BoundArkEnv;\n}\n"],"mappings":"sCAaA,SAAgB,EACf,EACc,CACd,SAAS,EAGP,EAAQ,EAA4D,CACrE,OAAOA,EAAa,EAAK,CACxB,GAAG,EACH,aAAc,GAAQ,cAAgB,EACtC,CAAC,CAGH,OAAO"}
|