arkenv 1.0.0-alpha.1 → 1.0.0-alpha.3

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,86 +0,0 @@
1
- import { i as StandardSchemaV1 } from "./index-Br22fqkz.mjs";
2
-
3
- //#region src/parse-standard.d.ts
4
- /**
5
- * Configuration options for {@link parseStandard}.
6
- */
7
- type ParseStandardConfig = {
8
- /**
9
- * The environment variables to parse. Defaults to `process.env`
10
- */
11
- env?: Record<string, string | undefined>;
12
- /**
13
- * Control how ArkEnv handles environment variables that are not defined in your schema.
14
- *
15
- * Defaults to `'delete'` to ensure your output object only contains
16
- * keys you've explicitly declared.
17
- *
18
- * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.
19
- * - `ignore`: Undeclared keys are allowed and preserved in the output.
20
- * - `reject`: Undeclared keys will cause validation to fail.
21
- *
22
- * @default "delete"
23
- */
24
- onUndeclaredKey?: "ignore" | "delete" | "reject";
25
- /**
26
- * Whether to perform best-effort coercion on the environment variables.
27
- * Coercion requires validators that implement the StandardJSONSchemaV1 spec
28
- * (e.g. Zod, Valibot).
29
- *
30
- * @see https://standard-schema.dev
31
- * @default true
32
- */
33
- coerce?: boolean;
34
- /**
35
- * The format to use for array parsing when coercion is enabled.
36
- *
37
- * - `comma` (default): Strings are split by comma and trimmed.
38
- * - `json`: Strings are parsed as JSON.
39
- *
40
- * @default "comma"
41
- */
42
- arrayFormat?: "comma" | "json";
43
- /**
44
- * Whether to treat empty strings (`""`) as `undefined` before validation.
45
- *
46
- * When enabled, an environment variable set to an empty value (e.g. `PORT=`)
47
- * will be treated as if it were missing, allowing defaults to apply and
48
- * preventing validation errors for numeric or boolean types.
49
- *
50
- * @default false
51
- */
52
- emptyAsUndefined?: boolean;
53
- };
54
- //#endregion
55
- //#region src/standard.d.ts
56
- /**
57
- * Configuration options for the `arkenv/standard` entry's `arkenv`.
58
- */
59
- type StandardEnvConfig = ParseStandardConfig;
60
- /**
61
- * Parse and validate environment variables using Standard Schema 1.0 validators (e.g. Zod, Valibot).
62
- *
63
- * This entry is ArkType-free - ArkType is never imported, even transitively.
64
- * Use this when your project must not depend on ArkType.
65
- *
66
- * @param def An object mapping variable names to Standard Schema validators
67
- * @param config Optional configuration
68
- * @returns The validated environment variables
69
- * @throws An {@link ArkEnvError} if validation fails
70
- *
71
- * @example
72
- * ```ts
73
- * import arkenv from "arkenv/standard";
74
- * import { z } from "zod";
75
- *
76
- * const env = arkenv({
77
- * PORT: z.coerce.number(),
78
- * HOST: z.string(),
79
- * });
80
- * ```
81
- */
82
- declare function arkenv<const T extends Record<string, StandardSchemaV1>>(def: T, config?: StandardEnvConfig): { [K in keyof T]: StandardSchemaV1.InferOutput<T[K]> };
83
- //#endregion
84
- export { StandardEnvConfig, arkenv, arkenv as default };
85
-
86
- //# sourceMappingURL=standard.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"standard.d.mts","names":[],"sources":["../src/parse-standard.ts","../src/standard.ts"],"mappings":";;;;;;KAWY,mBAAA;EAAmB;;;EAI9B,GAAA,GAAM,MAAA;EAAA;;;;;;;;;;ACJP;;EDiBC,eAAA;ECjB+B;;AAwBhC;;;;;;EDEC,MAAA;ECCgB;;;;;;;;EDQhB,WAAA;ECVK;;;;;;;;;EDqBL,gBAAA;AAAA;;;;AA9CD;;KCAY,iBAAA,GAAoB,mBAAA;;;;;;;;;;;;;AAAhC;;;;;AAwBA;;;;;iBAAgB,MAAA,iBAAuB,MAAA,SAAe,gBAAA,EAAA,CACrD,GAAA,EAAK,CAAA,EACL,MAAA,GAAS,iBAAA,iBACO,CAAA,GAAI,gBAAA,CAAiB,WAAA,CAAY,CAAA,CAAE,CAAA"}
package/dist/standard.mjs DELETED
@@ -1,3 +0,0 @@
1
- import{n as e,r as t,t as n}from"./shared-B7lIFzfk.mjs";import{t as r}from"./core-B0IkKRzg.mjs";function i(e,t){if(typeof t==`string`)throw new r([{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.`}])}function a(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 r([{path:e,message:`Invalid validator: expected a Standard Schema 1.0 validator (must have "~standard" property). Import from "arkenv" to use ArkType schemas.`}])}function o(e){if(!e||typeof e!=`object`||Array.isArray(e))throw new r([{path:``,message:`Invalid schema: expected an object mapping in "standard" mode.`}])}function s(e,t){let n={type:`object`,properties:{}},r=!1;for(let i in e){let a=e[i];if(!a){t.push(i);continue}let o=a[`~standard`];if(typeof o?.jsonSchema?.input==`function`)try{let e=o.jsonSchema.input({target:`draft-07`});if(e){n.properties[i]=e,r=!0;continue}}catch{}if(typeof a.jsonSchema?.input==`function`)try{let e=a.jsonSchema.input({target:`draft-07`});if(e){n.properties[i]=e,r=!0;continue}}catch{}if(typeof a.toJSONSchema==`function`)try{let e=a.toJSONSchema();if(e){n.properties[i]=e,r=!0;continue}}catch{}if(typeof a.toStandardJSONSchema?.v1==`function`)try{let e=a.toStandardJSONSchema.v1();if(e){n.properties[i]=e,r=!0;continue}}catch{}t.push(i)}return{jsonSchema:n,hasJsonSchema:r}}function c(e,t){return!t||t.length===0?e:[e,...t.map(e=>typeof e==`object`&&e&&`key`in e?String(e.key):String(e))].join(`.`)}function l(i,a){let{env:o=process.env,onUndeclaredKey:l=`delete`,coerce:u=!0,arrayFormat:d=`comma`,emptyAsUndefined:f=!1}=a,p={},m=[],h=f?t(o):o,g=new Set(Object.keys(h)),_={...h},v=[];if(u){let{jsonSchema:t,hasJsonSchema:r}=s(i,v);r&&(_=n(_,e(t),{arrayFormat:d}))}for(let e in i){let t=i[e],n=_[e];if(!t||typeof t!=`object`||!(`~standard`in t))throw new r([{path:e,message:`Invalid schema: expected a Standard Schema 1.0 validator (e.g. Zod, Valibot) in 'standard' mode.`}]);let a=t[`~standard`].validate(n);if(a instanceof Promise)throw new r([{path:e,message:`Async validation is not supported. ArkEnv is synchronous.`}]);if(a.issues)for(let t of a.issues){let n=c(e,t.path),r=t.message;u&&v.includes(e)&&(r+=` (Hint: coercion is enabled by default, but the validator for '${e}' lacks Standard JSON Schema support.)`),m.push({path:n,message:r})}else p[e]=a.value;g.delete(e)}if(l!==`delete`)for(let e of g)l===`reject`?m.push({path:e,message:`Undeclared key`}):l===`ignore`&&(p[e]=_[e]);if(m.length>0)throw new r(m);return p}function u(e,t){o(e);for(let t in e){let n=e[t];i(t,n),a(t,n)}return l(e,t??{})}export{u as arkenv,u as default};
2
-
3
- //# sourceMappingURL=standard.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"standard.mjs","names":[],"sources":["../src/guards.ts","../src/parse-standard.ts","../src/standard.ts"],"sourcesContent":["import { ArkEnvError } from \"./core\";\n\n/**\n * Throws if the given value is a string (ArkType DSL) in standard mode.\n * @internal\n */\nexport function assertNotArkTypeDsl(key: string, value: unknown): void {\n\tif (typeof value === \"string\") {\n\t\tthrow new ArkEnvError([\n\t\t\t{\n\t\t\t\tpath: key,\n\t\t\t\tmessage:\n\t\t\t\t\t'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.',\n\t\t\t},\n\t\t]);\n\t}\n}\n\n/**\n * Throws if the given value is not a well-formed Standard Schema validator\n * (must have a `~standard` property whose `validate` field is a function).\n * @internal\n */\nexport function assertStandardSchema(key: string, value: unknown): void {\n\tconst std =\n\t\tvalue &&\n\t\ttypeof value === \"object\" &&\n\t\t\"~standard\" in value &&\n\t\t(value as Record<string, unknown>)[\"~standard\"];\n\n\tif (\n\t\t!std ||\n\t\ttypeof std !== \"object\" ||\n\t\t!(\"validate\" in std) ||\n\t\ttypeof (std as Record<string, unknown>).validate !== \"function\"\n\t) {\n\t\tthrow new ArkEnvError([\n\t\t\t{\n\t\t\t\tpath: key,\n\t\t\t\tmessage:\n\t\t\t\t\t'Invalid validator: expected a Standard Schema 1.0 validator (must have \"~standard\" property). Import from \"arkenv\" to use ArkType schemas.',\n\t\t\t},\n\t\t]);\n\t}\n}\n\n/**\n * Throws if `def` is not a plain object (i.e. not a valid schema map).\n * @internal\n */\nexport function assertStandardSchemaMap(\n\tdef: unknown,\n): asserts def is Record<string, unknown> {\n\tif (!def || typeof def !== \"object\" || Array.isArray(def)) {\n\t\tthrow new ArkEnvError([\n\t\t\t{\n\t\t\t\tpath: \"\",\n\t\t\t\tmessage:\n\t\t\t\t\t'Invalid schema: expected an object mapping in \"standard\" mode.',\n\t\t\t},\n\t\t]);\n\t}\n}\n","import type { StandardSchemaV1 } from \"@repo/types\";\nimport {\n\tapplyCoercion,\n\tfindCoercionPaths,\n\tstripEmptyStrings,\n} from \"./coercion/shared\";\nimport { ArkEnvError, type ValidationIssue } from \"./core\";\n\n/**\n * Configuration options for {@link parseStandard}.\n */\nexport type ParseStandardConfig = {\n\t/**\n\t * The environment variables to parse. Defaults to `process.env`\n\t */\n\tenv?: Record<string, string | undefined>;\n\t/**\n\t * Control how ArkEnv handles environment variables that are not defined in your schema.\n\t *\n\t * Defaults to `'delete'` to ensure your output object only contains\n\t * keys you've explicitly declared.\n\t *\n\t * - `delete` (ArkEnv default): Undeclared keys are allowed on input but stripped from the output.\n\t * - `ignore`: Undeclared keys are allowed and preserved in the output.\n\t * - `reject`: Undeclared keys will cause validation to fail.\n\t *\n\t * @default \"delete\"\n\t */\n\tonUndeclaredKey?: \"ignore\" | \"delete\" | \"reject\";\n\t/**\n\t * Whether to perform best-effort coercion on the environment variables.\n\t * Coercion requires validators that implement the StandardJSONSchemaV1 spec\n\t * (e.g. Zod, Valibot).\n\t *\n\t * @see https://standard-schema.dev\n\t * @default true\n\t */\n\tcoerce?: boolean;\n\t/**\n\t * The format to use for array parsing when coercion is enabled.\n\t *\n\t * - `comma` (default): Strings are split by comma and trimmed.\n\t * - `json`: Strings are parsed as JSON.\n\t *\n\t * @default \"comma\"\n\t */\n\tarrayFormat?: \"comma\" | \"json\";\n\n\t/**\n\t * Whether to treat empty strings (`\"\"`) as `undefined` before validation.\n\t *\n\t * When enabled, an environment variable set to an empty value (e.g. `PORT=`)\n\t * will be treated as if it were missing, allowing defaults to apply and\n\t * preventing validation errors for numeric or boolean types.\n\t *\n\t * @default false\n\t */\n\temptyAsUndefined?: boolean;\n};\n\n/**\n * Extract JSON Schema definitions from standard schema validators.\n */\nfunction extractJsonSchema(\n\tdef: Record<string, unknown>,\n\tmissingJsonSchemaKeys: string[],\n): { jsonSchema: Record<string, any>; hasJsonSchema: boolean } {\n\tconst jsonSchema: Record<string, any> = { type: \"object\", properties: {} };\n\tlet hasJsonSchema = false;\n\n\tfor (const key in def) {\n\t\tconst validator = def[key] as any;\n\t\tif (!validator) {\n\t\t\tmissingJsonSchemaKeys.push(key);\n\t\t\tcontinue;\n\t\t}\n\n\t\t// 1. Standard way via ~standard property\n\t\tconst std = validator[\"~standard\"];\n\t\tif (typeof std?.jsonSchema?.input === \"function\") {\n\t\t\ttry {\n\t\t\t\tconst schema = std.jsonSchema.input({ target: \"draft-07\" });\n\t\t\t\tif (schema) {\n\t\t\t\t\tjsonSchema.properties[key] = schema;\n\t\t\t\t\thasJsonSchema = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\t// 2. Direct jsonSchema.input on validator\n\t\tif (typeof validator.jsonSchema?.input === \"function\") {\n\t\t\ttry {\n\t\t\t\tconst schema = validator.jsonSchema.input({ target: \"draft-07\" });\n\t\t\t\tif (schema) {\n\t\t\t\t\tjsonSchema.properties[key] = schema;\n\t\t\t\t\thasJsonSchema = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\t// 3. toJSONSchema method (e.g. zod mini, zod-to-json-schema)\n\t\tif (typeof validator.toJSONSchema === \"function\") {\n\t\t\ttry {\n\t\t\t\tconst schema = validator.toJSONSchema();\n\t\t\t\tif (schema) {\n\t\t\t\t\tjsonSchema.properties[key] = schema;\n\t\t\t\t\thasJsonSchema = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\t// 4. toStandardJSONSchema.v1 method (e.g. stnl)\n\t\tif (typeof validator.toStandardJSONSchema?.v1 === \"function\") {\n\t\t\ttry {\n\t\t\t\tconst schema = validator.toStandardJSONSchema.v1();\n\t\t\t\tif (schema) {\n\t\t\t\t\tjsonSchema.properties[key] = schema;\n\t\t\t\t\thasJsonSchema = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} catch {}\n\t\t}\n\n\t\tmissingJsonSchemaKeys.push(key);\n\t}\n\n\treturn { jsonSchema, hasJsonSchema };\n}\n\n/**\n * Format standard schema validation issue path.\n */\nfunction formatIssuePath(\n\tkey: string,\n\tpath:\n\t\t| readonly (\n\t\t\t\t| string\n\t\t\t\t| number\n\t\t\t\t| symbol\n\t\t\t\t| { readonly key: string | number | symbol }\n\t\t )[]\n\t\t| undefined,\n): string {\n\tif (!path || path.length === 0) return key;\n\n\tconst segments = path.map((segment) =>\n\t\tsegment !== null && typeof segment === \"object\" && \"key\" in segment\n\t\t\t? String(segment.key)\n\t\t\t: String(segment),\n\t);\n\treturn [key, ...segments].join(\".\");\n}\n\n/**\n * Parse and validate environment variables using Standard Schema 1.0 validators.\n *\n * @param def An object mapping environment variable keys to Standard Schema 1.0 validators\n * @param config Parsing options, including environment source, undeclared key handling, and coercion config\n * @returns The parsed and validated environment variables\n * @throws An ArkEnvError if validation fails\n */\nexport function parseStandard(\n\tdef: Record<string, unknown>,\n\tconfig: ParseStandardConfig,\n) {\n\tconst {\n\t\tenv = process.env,\n\t\tonUndeclaredKey = \"delete\",\n\t\tcoerce = true,\n\t\tarrayFormat = \"comma\",\n\t\temptyAsUndefined = false,\n\t} = config;\n\tconst output: Record<string, unknown> = {};\n\tconst errors: ValidationIssue[] = [];\n\n\tconst processedEnv = emptyAsUndefined\n\t\t? stripEmptyStrings(env as Record<string, string | undefined>)\n\t\t: env;\n\tconst envKeys = new Set(Object.keys(processedEnv));\n\n\tlet coercedEnv: Record<string, unknown> = { ...processedEnv };\n\tconst missingJsonSchemaKeys: string[] = [];\n\n\tif (coerce) {\n\t\tconst { jsonSchema, hasJsonSchema } = extractJsonSchema(\n\t\t\tdef,\n\t\t\tmissingJsonSchemaKeys,\n\t\t);\n\t\tif (hasJsonSchema) {\n\t\t\tcoercedEnv = applyCoercion(coercedEnv, findCoercionPaths(jsonSchema), {\n\t\t\t\tarrayFormat,\n\t\t\t}) as Record<string, unknown>;\n\t\t}\n\t}\n\n\t// 1. Validate declared keys\n\tfor (const key in def) {\n\t\tconst validator = def[key];\n\t\tconst value = coercedEnv[key];\n\n\t\t// Check if it's a Standard Schema validator\n\t\tif (\n\t\t\t!validator ||\n\t\t\ttypeof validator !== \"object\" ||\n\t\t\t!(\"~standard\" in validator)\n\t\t) {\n\t\t\tthrow new ArkEnvError([\n\t\t\t\t{\n\t\t\t\t\tpath: key,\n\t\t\t\t\tmessage: `Invalid schema: expected a Standard Schema 1.0 validator (e.g. Zod, Valibot) in 'standard' mode.`,\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\tconst result = (validator as StandardSchemaV1)[\"~standard\"].validate(value);\n\n\t\tif (result instanceof Promise) {\n\t\t\tthrow new ArkEnvError([\n\t\t\t\t{\n\t\t\t\t\tpath: key,\n\t\t\t\t\tmessage: \"Async validation is not supported. ArkEnv is synchronous.\",\n\t\t\t\t},\n\t\t\t]);\n\t\t}\n\n\t\tif (result.issues) {\n\t\t\tfor (const issue of result.issues) {\n\t\t\t\tconst issuePath = formatIssuePath(key, issue.path);\n\t\t\t\tlet message = issue.message;\n\n\t\t\t\tif (coerce && missingJsonSchemaKeys.includes(key)) {\n\t\t\t\t\tmessage += ` (Hint: coercion is enabled by default, but the validator for '${key}' lacks Standard JSON Schema support.)`;\n\t\t\t\t}\n\n\t\t\t\terrors.push({\n\t\t\t\t\tpath: issuePath,\n\t\t\t\t\tmessage,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\toutput[key] = result.value;\n\t\t}\n\n\t\tenvKeys.delete(key);\n\t}\n\n\t// 2. Handle undeclared keys\n\tif (onUndeclaredKey !== \"delete\") {\n\t\tfor (const key of envKeys) {\n\t\t\tif (onUndeclaredKey === \"reject\") {\n\t\t\t\terrors.push({\n\t\t\t\t\tpath: key,\n\t\t\t\t\tmessage: \"Undeclared key\",\n\t\t\t\t});\n\t\t\t} else if (onUndeclaredKey === \"ignore\") {\n\t\t\t\toutput[key] = coercedEnv[key];\n\t\t\t}\n\t\t}\n\t}\n\n\tif (errors.length > 0) {\n\t\tthrow new ArkEnvError(errors);\n\t}\n\n\treturn output;\n}\n","import type { StandardSchemaV1 } from \"@repo/types\";\nimport {\n\tassertNotArkTypeDsl,\n\tassertStandardSchema,\n\tassertStandardSchemaMap,\n} from \"./guards\";\nimport { type ParseStandardConfig, parseStandard } from \"./parse-standard\";\n\n/**\n * Configuration options for the `arkenv/standard` entry's `arkenv`.\n */\nexport type StandardEnvConfig = ParseStandardConfig;\n\n/**\n * Parse and validate environment variables using Standard Schema 1.0 validators (e.g. Zod, Valibot).\n *\n * This entry is ArkType-free - ArkType is never imported, even transitively.\n * Use this when your project must not depend on ArkType.\n *\n * @param def An object mapping variable names to Standard Schema validators\n * @param config Optional configuration\n * @returns The validated environment variables\n * @throws An {@link ArkEnvError} if validation fails\n *\n * @example\n * ```ts\n * import arkenv from \"arkenv/standard\";\n * import { z } from \"zod\";\n *\n * const env = arkenv({\n * PORT: z.coerce.number(),\n * HOST: z.string(),\n * });\n * ```\n */\nexport function arkenv<const T extends Record<string, StandardSchemaV1>>(\n\tdef: T,\n\tconfig?: StandardEnvConfig,\n): { [K in keyof T]: StandardSchemaV1.InferOutput<T[K]> } {\n\tassertStandardSchemaMap(def);\n\n\tfor (const key in def) {\n\t\tconst validator = (def as Record<string, unknown>)[key];\n\t\tassertNotArkTypeDsl(key, validator);\n\t\tassertStandardSchema(key, validator);\n\t}\n\n\treturn parseStandard(def as Record<string, unknown>, config ?? {}) as {\n\t\t[K in keyof T]: StandardSchemaV1.InferOutput<T[K]>;\n\t};\n}\n\n/**\n * ArkEnv's Standard Schema export\n *\n * {@link https://arkenv.js.org | ArkEnv} is a typesafe environment variables validator from editor to runtime.\n */\nexport default arkenv;\n"],"mappings":"gGAMA,SAAgB,EAAoB,EAAa,EAAsB,CACtE,GAAI,OAAO,GAAU,SACpB,MAAM,IAAI,EAAY,CACrB,CACC,KAAM,EACN,QACC,8JACD,CACD,CAAC,CASJ,SAAgB,EAAqB,EAAa,EAAsB,CACvE,IAAM,EACL,GACA,OAAO,GAAU,UACjB,cAAe,GACd,EAAkC,aAEpC,GACC,CAAC,GACD,OAAO,GAAQ,UACf,EAAE,aAAc,IAChB,OAAQ,EAAgC,UAAa,WAErD,MAAM,IAAI,EAAY,CACrB,CACC,KAAM,EACN,QACC,6IACD,CACD,CAAC,CAQJ,SAAgB,EACf,EACyC,CACzC,GAAI,CAAC,GAAO,OAAO,GAAQ,UAAY,MAAM,QAAQ,EAAI,CACxD,MAAM,IAAI,EAAY,CACrB,CACC,KAAM,GACN,QACC,iEACD,CACD,CAAC,CCGJ,SAAS,EACR,EACA,EAC8D,CAC9D,IAAM,EAAkC,CAAE,KAAM,SAAU,WAAY,EAAE,CAAE,CACtE,EAAgB,GAEpB,IAAK,IAAM,KAAO,EAAK,CACtB,IAAM,EAAY,EAAI,GACtB,GAAI,CAAC,EAAW,CACf,EAAsB,KAAK,EAAI,CAC/B,SAID,IAAM,EAAM,EAAU,aACtB,GAAI,OAAO,GAAK,YAAY,OAAU,WACrC,GAAI,CACH,IAAM,EAAS,EAAI,WAAW,MAAM,CAAE,OAAQ,WAAY,CAAC,CAC3D,GAAI,EAAQ,CACX,EAAW,WAAW,GAAO,EAC7B,EAAgB,GAChB,eAEM,EAIT,GAAI,OAAO,EAAU,YAAY,OAAU,WAC1C,GAAI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