MIRROR: javascript for 馃悳's, a tiny runtime with big ambitions
1Ant.version = import.meta.env.VERSION;
2Ant.target = import.meta.env.TARGET;
3Ant.revision = import.meta.env.GIT_HASH;
4Ant.buildDate = import.meta.env.BUILD_TIMESTAMP;
5Ant.host = import.meta.env.HOST as AntHost;
6
7Ant.typeof = function (t) {
8 const value = Ant.raw.typeof(t);
9
10 const types = {
11 T_OBJ: 'object',
12 T_STR: 'string',
13 T_ARR: 'array',
14 T_FUNC: 'function',
15 T_CFUNC: 'cfunc',
16 T_PROMISE: 'promise',
17 T_GENERATOR: 'generator',
18 T_UNDEF: 'undefined',
19 T_NULL: 'null',
20 T_BOOL: 'boolean',
21 T_NUM: 'number',
22 T_BIGINT: 'bigint',
23 T_SYMBOL: 'symbol',
24 T_TYPEDARRAY: 'typedarray',
25 T_ERR: 'err',
26 T_NTARG: 'ntarg'
27 } as const;
28
29 const names = Object.values(types);
30 return value < names.length ? names[value] : '??';
31};
32
33Ant.inspect = (...args) => console.inspect(...args);