Files
scriptc/tests/fixtures/effect4/schema-aot-generated.js
Chris Tate e2d58f60d2 Expand static support for common Effect 4 patterns (#600)
* Expand static compilation for common Effect 4 patterns

* Run every Effect 4 fixture slice in CI

* Preserve existing corpus behavior across Effect 4 lowering

* Preserve Effect platform callbacks and native stream state

* Record new corpus baselines and retain child stdin refusals

* Retire the obsolete stateful regex diagnostic

* Preserve promise reference count layout for cycle collection
2026-10-01 17:36:29 -05:00

12 lines
3.8 KiB
JavaScript

// Generated by SchemaAOTCompiler. Regenerate after schema or Effect changes.
import { runtime } from "effect/schema/SchemaCompiler/runtime";
function d0(ast,resolve,operation){const R=runtime;switch(operation){case "is":{return (function(C,R){"use strict";const {getCheckIssues:K,matchesTemplateLiteral:T,getCandidateIndex:U,getIndexSignatureKeys:G,defaultParseOptions:D,hasExcessProperties:E}=R;;;return function(i,o){if(typeof i!=="object"||i===null||Array.isArray(i))return false;if(o!==D&&o.onExcessProperty==="error"&&E(C[0],i,void 0))return false;const v0=i["n"];if(typeof v0!=="number")return false;const v1=v0;if(K(C[1],v1,0,o))return false;return true}})([ast,ast.propertySignatures[0].type],R)}case "decode":{return (function(C,R){"use strict";const {invalid:I,getCheckIssues:K,matchesTemplateLiteral:T,getCandidateIndex:U,getIndexSignatureKeys:G,defaultParseOptions:D,hasExcessProperties:E}=R;;;return function(i,o){if(typeof i!=="object"||i===null||Array.isArray(i))return I;if(o!==D&&o.onExcessProperty==="error"&&E(C[0],i,void 0))return I;const v1=i["n"];if(typeof v1!=="number")return I;const v2=v1;if(K(C[1],v2,0,o))return I;const v0={"n":v2};return v0}})([ast,ast.propertySignatures[0].type],R)}case "make":{if(ast.propertySignatures.some(p=>resolve(p.type).compiled!==void 0))return;return (function(C,R){"use strict";const {invalid:I,getCheckIssues:K,matchesTemplateLiteral:T,getCandidateIndex:U,getIndexSignatureKeys:G,defaultParseOptions:D,hasExcessProperties:E}=R;;;return function(i,o){if(typeof i!=="object"||i===null||Array.isArray(i))return I;if(o!==D&&o.onExcessProperty==="error"&&E(C[0],i,void 0))return I;const v1=i["n"];if(typeof v1!=="number")return I;const v2=v1;if(K(C[1],v2,0,o))return I;const v0={"n":v2};return v0}})([ast,ast.propertySignatures[0].type],R)}case "decodeEffect":{return R.decode(ast,resolve,function({ast,getProperties,fallback,resume,step}){;return function(i,o){try{if(i===R.missing)return R.missingExit;if(o.errors==="all"||o.onExcessProperty!==void 0||(o.concurrency!==void 0&&o.concurrency!==1))return fallback(i,o);if(typeof i!=="object"||i===null||Array.isArray(i))return R.invalidType(ast,i,o);const properties=getProperties(),out={};const state={ast,input:i,out,options:o,issues:void 0};let r,t,value;const p0=properties[0],h0="n" in i,v0=h0?i["n"]:R.missing;r=p0.parser(v0,o);if(r===R.sameExit){if(h0){out["n"]=v0}}else{if(!R.effectIsExit(r))return resume(state,0,r);if(r._tag==="Success"&&(value=r[R.args])!==R.missing){out["n"]=value}else{t=step(state,p0,r);if(t)return t}};return R.succeed(out)}catch(e){return R.die(e)}}},true,undefined,undefined)}case "makeEffect":{return R.make(ast,resolve,function({ast,getProperties,fallback,resume,step}){;return function(i,o){try{if(i===R.missing)return R.missingExit;if(o.errors==="all"||o.onExcessProperty!==void 0||(o.concurrency!==void 0&&o.concurrency!==1))return fallback(i,o);if(typeof i!=="object"||i===null||Array.isArray(i))return R.invalidType(ast,i,o);const properties=getProperties(),out={};const state={ast,input:i,out,options:o,issues:void 0};let r,t,value;const p0=properties[0],h0="n" in i,v0=h0?i["n"]:R.missing;r=p0.parser(v0,o);if(r===R.sameExit){if(h0){out["n"]=v0}}else{if(!R.effectIsExit(r))return resume(state,0,r);if(r._tag==="Success"&&(value=r[R.args])!==R.missing){out["n"]=value}else{t=step(state,p0,r);if(t)return t}};return R.succeed(out)}catch(e){return R.die(e)}}},undefined)}}}
function d1(ast,resolve,operation){const R=runtime;switch(operation){case "decodeEffect":{return R.decode(ast,resolve,undefined,true,undefined,undefined)}case "makeEffect":{return R.make(ast,resolve,undefined,undefined)}}}
/** @param {ReadonlyArray<import("effect/SchemaAST").AST>} asts */
export function install(asts){
const a0=asts[0];
const a1=a0.propertySignatures[0].type;
runtime.setCompiler(a0,d0);
runtime.setCompiler(a1,d1);
}