You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
echo'{"type":"module"}'> package.json
npm i import-in-the-middle typebox
repro.js
import*asTypefrom'typebox/type';import{Value}from'typebox/value';import{TypeasT}from'typebox';console.log('IsTemplateLiteral:',typeofType.IsTemplateLiteral);console.log('IsString:',typeofType.IsString);console.log('IsObject:',typeofType.IsObject);try{constunionSchema=T.Object({level: T.Union([T.Literal('a'),T.Literal('b')])});console.log('Convert union OK:',JSON.stringify(Value.Convert(unionSchema,{level: 'a'})));}catch(e){console.log('CONVERT union ERROR:',(e).message);}
$ node repro.js
IsTemplateLiteral: function
IsString: function
IsObject: function
Convert union OK: {"level":"a"}
$ node --loader=import-in-the-middle/hook.mjs repro.js
...
IsTemplateLiteral: undefined
...
CONVERT union ERROR: Type.IsTemplateLiteral is not a function
Activity