Comparing version 0.1.16 to 0.1.17
#!/usr/bin/env node | ||
const { resolve } = require('path') | ||
const script = process.argv.splice(2, 1)[0] | ||
@@ -11,4 +13,5 @@ | ||
const jiti = require('..')(process.cwd()) | ||
const resolved = process.argv[1] = jiti.resolve(script) | ||
const pwd = process.cwd() | ||
const jiti = require('..')(pwd) | ||
const resolved = process.argv[1] = jiti.resolve(resolve(pwd, script)) | ||
jiti(resolved) |
@@ -5,2 +5,14 @@ # Changelog | ||
### [0.1.17](https://github.com/nuxt-contrib/jiti/compare/v0.1.16...v0.1.17) (2020-11-27) | ||
### Features | ||
* use native import for mjs files ([#10](https://github.com/nuxt-contrib/jiti/issues/10)) ([da34753](https://github.com/nuxt-contrib/jiti/commit/da34753d54e4bc726bb354dcbd77b4f3d7f7e0a0)) | ||
### Bug Fixes | ||
* **cli:** resolve relative to cwd ([52a4c12](https://github.com/nuxt-contrib/jiti/commit/52a4c124bc649b366d481cbe6463537b245ad4d1)) | ||
### [0.1.16](https://github.com/nuxt-contrib/jiti/compare/v0.1.15...v0.1.16) (2020-11-23) | ||
@@ -7,0 +19,0 @@ |
@@ -8,3 +8,4 @@ /// <reference types="node" /> | ||
cache?: boolean | string; | ||
dynamicImport?: (id: string) => Promise<any>; | ||
}; | ||
export default function createJITI(_filename?: string, opts?: JITIOptions): typeof require; |
/*! For license information please see jiti.js.LICENSE.txt */ | ||
module.exports=(()=>{var e={"./node_modules/create-require/create-require.js":(e,r,t)=>{const n=t("module"),o=t("path"),s=t("fs");e.exports=function(e){return e||(e=process.cwd()),function(e){try{return s.lstatSync(e).isDirectory()}catch(e){return!1}}(e)&&(e=o.join(e,"index.js")),n.createRequire?n.createRequire(e):n.createRequireFromPath?n.createRequireFromPath(e):function(e){const r=new n.Module(e,null);return r.filename=e,r.paths=n.Module._nodeModulePaths(o.dirname(e)),r._compile("module.exports = require;",e),r.exports}(e)}},"./node_modules/destr/dist/index.js":e=>{"use strict";var r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,t=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,n=/^["{[]|^-?[0-9][0-9.]{0,14}$/;function o(e,r){if("__proto__"!==e&&"constructor"!==e)return r}e.exports=function(e){if("string"!=typeof e)return e;var s=e.toLowerCase();if("true"===s)return!0;if("false"===s)return!1;if("null"===s)return null;if("nan"===s)return NaN;if("infinity"===s)return 1/0;if("undefined"!==s){if(!n.test(e))return e;try{return r.test(e)||t.test(e)?JSON.parse(e,o):JSON.parse(e)}catch(r){return e}}}},"./node_modules/function-bind/implementation.js":e=>{"use strict";var r="Function.prototype.bind called on incompatible ",t=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var s=this;if("function"!=typeof s||n.call(s)!==o)throw new TypeError(r+s);for(var i,a=t.call(arguments,1),c=function(){if(this instanceof i){var r=s.apply(this,a.concat(t.call(arguments)));return Object(r)===r?r:this}return s.apply(e,a.concat(t.call(arguments)))},l=Math.max(0,s.length-a.length),u=[],d=0;d<l;d++)u.push("$"+d);if(i=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),s.prototype){var p=function(){};p.prototype=s.prototype,i.prototype=new p,p.prototype=null}return i}},"./node_modules/function-bind/index.js":(e,r,t)=>{"use strict";var n=t("./node_modules/function-bind/implementation.js");e.exports=Function.prototype.bind||n},"./node_modules/has/src/index.js":(e,r,t)=>{"use strict";var n=t("./node_modules/function-bind/index.js");e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},"./node_modules/is-core-module/core.json":e=>{"use strict";e.exports=JSON.parse('{"assert":true,"assert/strict":">= 15","async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"diagnostics_channel":">= 15.1","dns":true,"dns/promises":">= 15","domain":">= 0.7.12","events":true,"freelist":"< 6","fs":true,"fs/promises":[">= 10 && < 10.1",">= 14"],"_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6.0 && < 12","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"stream/promises":">= 15","string_decoder":true,"sys":[">= 0.6 && < 0.7",">= 0.8"],"timers":true,"timers/promises":">= 15","_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8":">= 1","vm":true,"wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","zlib":true}')},"./node_modules/is-core-module/index.js":(e,r,t)=>{"use strict";var n=t("./node_modules/has/src/index.js");function o(e,r){for(var t=e.split("."),n=r.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),i=0;i<3;++i){var a=parseInt(t[i]||0,10),c=parseInt(s[i]||0,10);if(a!==c)return"<"===o?a<c:">="===o&&a>=c}return">="===o}function s(e,r){var t=r.split(/ ?&& ?/);if(0===t.length)return!1;for(var n=0;n<t.length;++n)if(!o(e,t[n]))return!1;return!0}var i=t("./node_modules/is-core-module/core.json");e.exports=function(e,r){return n(i,e)&&function(e,r){if("boolean"==typeof r)return r;var t=void 0===e?process.versions&&process.versions.node&&process.versions.node:e;if("string"!=typeof t)throw new TypeError(void 0===e?"Unable to determine current node version":"If provided, a valid node version is required");if(r&&"object"==typeof r){for(var n=0;n<r.length;++n)if(s(t,r[n]))return!0;return!1}return s(t,r)}(r,i[e])}},"./node_modules/mkdirp/index.js":(e,r,t)=>{const n=t("./node_modules/mkdirp/lib/opts-arg.js"),o=t("./node_modules/mkdirp/lib/path-arg.js"),{mkdirpNative:s,mkdirpNativeSync:i}=t("./node_modules/mkdirp/lib/mkdirp-native.js"),{mkdirpManual:a,mkdirpManualSync:c}=t("./node_modules/mkdirp/lib/mkdirp-manual.js"),{useNative:l,useNativeSync:u}=t("./node_modules/mkdirp/lib/use-native.js"),d=(e,r)=>(e=o(e),r=n(r),l(r)?s(e,r):a(e,r));d.sync=(e,r)=>(e=o(e),r=n(r),u(r)?i(e,r):c(e,r)),d.native=(e,r)=>s(o(e),n(r)),d.manual=(e,r)=>a(o(e),n(r)),d.nativeSync=(e,r)=>i(o(e),n(r)),d.manualSync=(e,r)=>c(o(e),n(r)),e.exports=d},"./node_modules/mkdirp/lib/find-made.js":(e,r,t)=>{const{dirname:n}=t("path"),o=(e,r,t)=>t===r?Promise.resolve():e.statAsync(r).then((e=>e.isDirectory()?t:void 0),(t=>"ENOENT"===t.code?o(e,n(r),r):void 0)),s=(e,r,t)=>{if(t!==r)try{return e.statSync(r).isDirectory()?t:void 0}catch(t){return"ENOENT"===t.code?s(e,n(r),r):void 0}};e.exports={findMade:o,findMadeSync:s}},"./node_modules/mkdirp/lib/mkdirp-manual.js":(e,r,t)=>{const{dirname:n}=t("path"),o=(e,r,t)=>{r.recursive=!1;const s=n(e);return s===e?r.mkdirAsync(e,r).catch((e=>{if("EISDIR"!==e.code)throw e})):r.mkdirAsync(e,r).then((()=>t||e),(n=>{if("ENOENT"===n.code)return o(s,r).then((t=>o(e,r,t)));if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;return r.statAsync(e).then((e=>{if(e.isDirectory())return t;throw n}),(()=>{throw n}))}))},s=(e,r,t)=>{const o=n(e);if(r.recursive=!1,o===e)try{return r.mkdirSync(e,r)}catch(e){if("EISDIR"!==e.code)throw e;return}try{return r.mkdirSync(e,r),t||e}catch(n){if("ENOENT"===n.code)return s(e,r,s(o,r,t));if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(!r.statSync(e).isDirectory())throw n}catch(e){throw n}}};e.exports={mkdirpManual:o,mkdirpManualSync:s}},"./node_modules/mkdirp/lib/mkdirp-native.js":(e,r,t)=>{const{dirname:n}=t("path"),{findMade:o,findMadeSync:s}=t("./node_modules/mkdirp/lib/find-made.js"),{mkdirpManual:i,mkdirpManualSync:a}=t("./node_modules/mkdirp/lib/mkdirp-manual.js");e.exports={mkdirpNative:(e,r)=>(r.recursive=!0,n(e)===e?r.mkdirAsync(e,r):o(r,e).then((t=>r.mkdirAsync(e,r).then((()=>t)).catch((t=>{if("ENOENT"===t.code)return i(e,r);throw t}))))),mkdirpNativeSync:(e,r)=>{if(r.recursive=!0,n(e)===e)return r.mkdirSync(e,r);const t=s(r,e);try{return r.mkdirSync(e,r),t}catch(t){if("ENOENT"===t.code)return a(e,r);throw t}}}},"./node_modules/mkdirp/lib/opts-arg.js":(e,r,t)=>{const{promisify:n}=t("util"),o=t("fs");e.exports=e=>{if(e)if("object"==typeof e)e={mode:511,fs:o,...e};else if("number"==typeof e)e={mode:e,fs:o};else{if("string"!=typeof e)throw new TypeError("invalid options argument");e={mode:parseInt(e,8),fs:o}}else e={mode:511,fs:o};return e.mkdir=e.mkdir||e.fs.mkdir||o.mkdir,e.mkdirAsync=n(e.mkdir),e.stat=e.stat||e.fs.stat||o.stat,e.statAsync=n(e.stat),e.statSync=e.statSync||e.fs.statSync||o.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||o.mkdirSync,e}},"./node_modules/mkdirp/lib/path-arg.js":(e,r,t)=>{const n=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:o,parse:s}=t("path");e.exports=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=o(e),"win32"===n){const r=/[*|"<>?:]/,{root:t}=s(e);if(r.test(e.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e}},"./node_modules/mkdirp/lib/use-native.js":(e,r,t)=>{const n=t("fs"),o=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),s=+o[0]>10||10==+o[0]&&+o[1]>=12,i=s?e=>e.mkdir===n.mkdir:()=>!1,a=s?e=>e.mkdirSync===n.mkdirSync:()=>!1;e.exports={useNative:i,useNativeSync:a}},"./node_modules/path-parse/index.js":e=>{"use strict";var r="win32"===process.platform,t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,n=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,o={parse:function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var r,o,s,i,a,c=(r=e,s=((o=t.exec(r))[1]||"")+(o[2]||""),i=o[3]||"",[s,(a=n.exec(i))[1],a[2],a[3]]);if(!c||4!==c.length)throw new TypeError("Invalid path '"+e+"'");return{root:c[0],dir:c[0]+c[1].slice(0,-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}}},s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i={parse:function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var r,t=(r=e,s.exec(r).slice(1));if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}}};e.exports=r?o.parse:i.parse,e.exports.posix=i.parse,e.exports.win32=o.parse},"./node_modules/resolve/index.js":(e,r,t)=>{var n=t("./node_modules/resolve/lib/async.js");n.core=t("./node_modules/resolve/lib/core.js"),n.isCore=t("./node_modules/resolve/lib/is-core.js"),n.sync=t("./node_modules/resolve/lib/sync.js"),e.exports=n},"./node_modules/resolve/lib/async.js":(e,r,t)=>{var n=t("fs"),o=t("path"),s=t("./node_modules/resolve/lib/caller.js"),i=t("./node_modules/resolve/lib/node-modules-paths.js"),a=t("./node_modules/resolve/lib/normalize-options.js"),c=t("./node_modules/is-core-module/index.js"),l=n.realpath&&"function"==typeof n.realpath.native?n.realpath.native:n.realpath,u=function(e,r){n.stat(e,(function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?r(null,!1):r(e):r(null,t.isFile()||t.isFIFO())}))},d=function(e,r){n.stat(e,(function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?r(null,!1):r(e):r(null,t.isDirectory())}))},p=function(e,r){l(e,(function(t,n){t&&"ENOENT"!==t.code?r(t):r(null,t?e:n)}))},m=function(e,r,t,n){t&&!1===t.preserveSymlinks?e(r,n):n(null,r)};e.exports=function(e,r,t){var l=t,f=r;if("function"==typeof r&&(l=f,f={}),"string"!=typeof e){var h=new TypeError("Path must be a string.");return process.nextTick((function(){l(h)}))}var _=(f=a(e,f)).isFile||u,v=f.isDirectory||d,y=f.readFile||n.readFile,g=f.realpath||p,b=f.packageIterator,j=f.extensions||[".js"],k=!1!==f.includeCoreModules,x=f.basedir||o.dirname(s()),S=f.filename||x;f.paths=f.paths||[];var w,E=o.resolve(x);function O(r,t,n){r?l(r):t?l(null,t,n):T(w,(function(r,t,n){if(r)l(r);else if(t)m(g,t,f,(function(e,r){e?l(e):l(null,r,n)}));else{var o=new Error("Cannot find module '"+e+"' from '"+S+"'");o.code="MODULE_NOT_FOUND",l(o)}}))}function N(e,r,t){var n=r,s=t;"function"==typeof n&&(s=n,n=void 0),function e(r,t,n){if(0===r.length)return s(null,void 0,n);var i=t+r[0],a=n;function c(n,c,u){if(a=c,n)return s(n);if(u&&a&&f.pathFilter){var d=o.relative(u,i),p=d.slice(0,d.length-r[0].length),m=f.pathFilter(a,t,p);if(m)return e([""].concat(j.slice()),o.resolve(u,m),a)}_(i,l)}function l(n,o){return n?s(n):o?s(null,i,a):void e(r.slice(1),t,a)}a?c(null,a):F(o.dirname(i),c)}([""].concat(j),e,n)}function F(e,r){return""===e||"/"===e||"win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e)?r(null):void m(g,e,f,(function(t,n){if(t)return F(o.dirname(e),r);var s=o.join(n,"package.json");_(s,(function(t,n){if(!n)return F(o.dirname(e),r);y(s,(function(t,n){t&&r(t);try{var o=JSON.parse(n)}catch(e){}o&&f.packageFilter&&(o=f.packageFilter(o,s)),r(null,o,e)}))}))}))}function T(e,r,t){var n=t,s=r;"function"==typeof s&&(n=s,s=f.package),m(g,e,f,(function(r,t){if(r)return n(r);var i=o.join(t,"package.json");_(i,(function(r,t){return r?n(r):t?void y(i,(function(r,t){if(r)return n(r);try{var s=JSON.parse(t)}catch(e){}if(s&&f.packageFilter&&(s=f.packageFilter(s,i)),s&&s.main){if("string"!=typeof s.main){var a=new TypeError("package “"+s.name+"” `main` must be a string");return a.code="INVALID_PACKAGE_MAIN",n(a)}return"."!==s.main&&"./"!==s.main||(s.main="index"),void N(o.resolve(e,s.main),s,(function(r,t,s){return r?n(r):t?n(null,t,s):s?void T(o.resolve(e,s.main),s,(function(r,t,s){return r?n(r):t?n(null,t,s):void N(o.join(e,"index"),s,n)})):N(o.join(e,"index"),s,n)}))}N(o.join(e,"/index"),s,n)})):N(o.join(e,"index"),s,n)}))}))}function M(e,r){if(0===r.length)return e(null,void 0);var t=r[0];function n(r,n,o){return r?e(r):n?e(null,n,o):void T(t,f.package,s)}function s(t,n,o){return t?e(t):n?e(null,n,o):void M(e,r.slice(1))}v(o.dirname(t),(function(o,s){return o?e(o):s?void N(t,f.package,n):M(e,r.slice(1))}))}m(g,E,f,(function(r,t){r?l(r):function(r){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))w=o.resolve(r,e),"."!==e&&".."!==e&&"/"!==e.slice(-1)||(w+="/"),/\/$/.test(e)&&w===r?T(w,f.package,O):N(w,f.package,O);else{if(k&&c(e))return l(null,e);!function(e,r,t){var n=function(){return function(e,r,t){for(var n=i(r,t,e),s=0;s<n.length;s++)n[s]=o.join(n[s],e);return n}(e,r,f)};M(t,b?b(e,r,n,f):n())}(e,r,(function(r,t,n){if(r)l(r);else{if(t)return m(g,t,f,(function(e,r){e?l(e):l(null,r,n)}));var o=new Error("Cannot find module '"+e+"' from '"+S+"'");o.code="MODULE_NOT_FOUND",l(o)}}))}}(t)}))}},"./node_modules/resolve/lib/caller.js":e=>{e.exports=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,r){return r};var r=(new Error).stack;return Error.prepareStackTrace=e,r[2].getFileName()}},"./node_modules/resolve/lib/core.js":(e,r,t)=>{var n=process.versions&&process.versions.node&&process.versions.node.split(".")||[];function o(e){for(var r=e.split(" "),t=r.length>1?r[0]:"=",o=(r.length>1?r[1]:r[0]).split("."),s=0;s<3;++s){var i=parseInt(n[s]||0,10),a=parseInt(o[s]||0,10);if(i!==a)return"<"===t?i<a:">="===t&&i>=a}return">="===t}function s(e){var r=e.split(/ ?&& ?/);if(0===r.length)return!1;for(var t=0;t<r.length;++t)if(!o(r[t]))return!1;return!0}function i(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){for(var r=0;r<e.length;++r)if(s(e[r]))return!0;return!1}return s(e)}var a=t("./node_modules/resolve/lib/core.json"),c={};for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(c[l]=i(a[l]));e.exports=c},"./node_modules/resolve/lib/core.json":e=>{"use strict";e.exports=JSON.parse('{"assert":true,"assert/strict":">= 15","async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"diagnostics_channel":">= 15.1","dns":true,"dns/promises":">= 15","domain":">= 0.7.12","events":true,"freelist":"< 6","fs":true,"fs/promises":[">= 10 && < 10.1",">= 14"],"_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6.0 && < 12","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"stream/promises":">= 15","string_decoder":true,"sys":[">= 0.6 && < 0.7",">= 0.8"],"timers":true,"timers/promises":">= 15","_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8":">= 1","vm":true,"wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","zlib":true}')},"./node_modules/resolve/lib/is-core.js":(e,r,t)=>{var n=t("./node_modules/is-core-module/index.js");e.exports=function(e){return n(e)}},"./node_modules/resolve/lib/node-modules-paths.js":(e,r,t)=>{var n=t("path"),o=n.parse||t("./node_modules/path-parse/index.js"),s=function(e,r){var t="/";/^([A-Za-z]:)/.test(e)?t="":/^\\\\/.test(e)&&(t="\\\\");for(var s=[e],i=o(e);i.dir!==s[s.length-1];)s.push(i.dir),i=o(i.dir);return s.reduce((function(e,o){return e.concat(r.map((function(e){return n.resolve(t,o,e)})))}),[])};e.exports=function(e,r,t){var n=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&"function"==typeof r.paths)return r.paths(t,e,(function(){return s(e,n)}),r);var o=s(e,n);return r&&r.paths?o.concat(r.paths):o}},"./node_modules/resolve/lib/normalize-options.js":e=>{e.exports=function(e,r){return r||{}}},"./node_modules/resolve/lib/sync.js":(e,r,t)=>{var n=t("./node_modules/is-core-module/index.js"),o=t("fs"),s=t("path"),i=t("./node_modules/resolve/lib/caller.js"),a=t("./node_modules/resolve/lib/node-modules-paths.js"),c=t("./node_modules/resolve/lib/normalize-options.js"),l=o.realpathSync&&"function"==typeof o.realpathSync.native?o.realpathSync.native:o.realpathSync,u=function(e){try{var r=o.statSync(e)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return r.isFile()||r.isFIFO()},d=function(e){try{var r=o.statSync(e)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return r.isDirectory()},p=function(e){try{return l(e)}catch(e){if("ENOENT"!==e.code)throw e}return e},m=function(e,r,t){return t&&!1===t.preserveSymlinks?e(r):r};e.exports=function(e,r){if("string"!=typeof e)throw new TypeError("Path must be a string.");var t=c(e,r),l=t.isFile||u,f=t.readFileSync||o.readFileSync,h=t.isDirectory||d,_=t.realpathSync||p,v=t.packageIterator,y=t.extensions||[".js"],g=!1!==t.includeCoreModules,b=t.basedir||s.dirname(i()),j=t.filename||b;t.paths=t.paths||[];var k=m(_,s.resolve(b),t);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var x=s.resolve(k,e);"."!==e&&".."!==e&&"/"!==e.slice(-1)||(x+="/");var S=O(x)||F(x);if(S)return m(_,S,t)}else{if(g&&n(e))return e;var w=function(e,r){for(var n=function(){return function(e,r,t){for(var n=a(r,t,e),o=0;o<n.length;o++)n[o]=s.join(n[o],e);return n}(e,r,t)},o=v?v(e,r,n,t):n(),i=0;i<o.length;i++){var c=o[i];if(h(s.dirname(c))){var l=O(c);if(l)return l;var u=F(c);if(u)return u}}}(e,k);if(w)return m(_,w,t)}var E=new Error("Cannot find module '"+e+"' from '"+j+"'");throw E.code="MODULE_NOT_FOUND",E;function O(e){var r=N(s.dirname(e));if(r&&r.dir&&r.pkg&&t.pathFilter){var n=s.relative(r.dir,e),o=t.pathFilter(r.pkg,e,n);o&&(e=s.resolve(r.dir,o))}if(l(e))return e;for(var i=0;i<y.length;i++){var a=e+y[i];if(l(a))return a}}function N(e){if(""!==e&&"/"!==e&&!("win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e))){var r=s.join(m(_,e,t),"package.json");if(!l(r))return N(s.dirname(e));var n=f(r);try{var o=JSON.parse(n)}catch(e){}return o&&t.packageFilter&&(o=t.packageFilter(o,e)),{pkg:o,dir:e}}}function F(e){var r=s.join(m(_,e,t),"/package.json");if(l(r)){try{var n=f(r,"UTF8"),o=JSON.parse(n)}catch(e){}if(o&&t.packageFilter&&(o=t.packageFilter(o,e)),o&&o.main){if("string"!=typeof o.main){var i=new TypeError("package “"+o.name+"” `main` must be a string");throw i.code="INVALID_PACKAGE_MAIN",i}"."!==o.main&&"./"!==o.main||(o.main="index");try{var a=O(s.resolve(e,o.main));if(a)return a;var c=F(s.resolve(e,o.main));if(c)return c}catch(e){}}}return O(s.join(e,"/index"))}}},"./src/jiti.ts":(e,r,t)=>{"use strict";t.d(r,{default:()=>S}),t("./node_modules/v8-compile-cache/v8-compile-cache.js");var n=t("fs"),o=t("module"),s=t("path"),i=t("os"),a=t("crypto"),c=t("vm"),l=t.n(c),u=t("./node_modules/mkdirp/index.js"),d=t.n(u),p=t("./node_modules/destr/dist/index.js"),m=t.n(p),f=t("./node_modules/create-require/create-require.js"),h=t.n(f),_=t("./node_modules/resolve/index.js"),v=t.n(_);function y(e){try{return(0,n.lstatSync)(e).isDirectory()}catch(e){return!1}}function g(e){try{return(0,n.accessSync)(e,n.constants.W_OK),!0}catch(e){return!1}}e=t.hmd(e);const b=m()(process.env.JITI_DEBUG),j=m()(process.env.JITI_CACHE),k={debug:b,cache:void 0===j||j};function x(e,r=8){return(0,a.createHash)("md5").update(e).digest("hex").substr(0,r)}function S(r=process.cwd(),t={}){function a(...e){t.debug&&console.log("[jiti]",...e)}if(t=Object.assign(Object.assign({},k),t),y(r)&&(r=(0,s.join)(r,"index.js")),!0===t.cache){const e=(0,s.join)(process.cwd(),"node_modules");y(e)&&(t.cache=(0,s.join)(e,".cache/jiti")),!0!==t.cache&&g(t.cache)?g(t.cache)||(t.cache=!1):t.cache=(0,s.join)((0,i.tmpdir)(),"node-jiti")}t.cache?(y(t.cache)||d().sync(t.cache),a("Cache dir:",t.cache)):a("Cache is disabled");const c={extensions:[".js",".mjs",".ts"],basedir:(0,s.dirname)(r)},u=e=>v().sync(e,c);u.paths=e=>[];const p=h()(r);function m(e,r,o){if(!t.cache)return o();const i=` /* v1.1-${x(r,16)} */`,a=(0,s.basename)((0,s.dirname)(e))+"-"+(0,s.basename)(e),c=(0,s.join)(t.cache,a+"."+x(e)+".js");if((0,n.existsSync)(c)){const e=(0,n.readFileSync)(c,"utf-8");if(e.endsWith(i))return e}const l=o();return(0,n.writeFileSync)(c,l+i,"utf-8"),l}function f(r){var i;if(o.builtinModules.includes(r))return p(r);const c=u(r);if(p.cache[c])return null===(i=p.cache[c])||void 0===i?void 0:i.exports;let d=(0,n.readFileSync)(c,"utf-8");if(c.match(/\.ts$/))a("[ts]",c),d=m(c,d,(()=>t.transform({source:d,filename:c,ts:!0})));else{if(!(d.match(/^\s*import .* from/m)||d.match(/import\s*\(/)||d.match(/^\s*export /m)))return a("[bail]",c),p(r);a("[esm]",c),d=m(c,d,(()=>t.transform({source:d,filename:c})))}const f=new o.Module(c);return f.filename=c,f.parent=e,f.require=S(c,t),f.path=(0,s.dirname)(c),f.paths=o.Module._nodeModulePaths(f.path),l().runInThisContext(o.Module.wrap(d),{filename:c,lineOffset:0,displayErrors:!0})(f.exports,f.require,f,f.filename,(0,s.dirname)(f.filename)),f.loaded=!0,p.cache[c]=f,(h=f.exports)&&"object"==typeof h&&"default"in h?h.default:h;var h}return f.resolve=u,f.cache=p.cache,f.extensions=p.extensions,f.main=p.main,f}},"./node_modules/v8-compile-cache/v8-compile-cache.js":(e,r,t)=>{"use strict";e=t.nmd(e);const n=t("module"),o=t("crypto"),s=t("fs"),i=t("path"),a=t("vm"),c=t("os"),l=Object.prototype.hasOwnProperty;class u{constructor(e,r){const t=r?f(r+"."):"";this._blobFilename=i.join(e,t+"BLOB"),this._mapFilename=i.join(e,t+"MAP"),this._lockFilename=i.join(e,t+"LOCK"),this._directory=e,this._load()}has(e,r){return l.call(this._memoryBlobs,e)?this._invalidationKeys[e]===r:!!l.call(this._storedMap,e)&&this._storedMap[e][0]===r}get(e,r){if(l.call(this._memoryBlobs,e)){if(this._invalidationKeys[e]===r)return this._memoryBlobs[e]}else if(l.call(this._storedMap,e)){const t=this._storedMap[e];if(t[0]===r)return this._storedBlob.slice(t[1],t[2])}}set(e,r,t){this._invalidationKeys[e]=r,this._memoryBlobs[e]=t,this._dirty=!0}delete(e){l.call(this._memoryBlobs,e)&&(this._dirty=!0,delete this._memoryBlobs[e]),l.call(this._invalidationKeys,e)&&(this._dirty=!0,delete this._invalidationKeys[e]),l.call(this._storedMap,e)&&(this._dirty=!0,delete this._storedMap[e])}isDirty(){return this._dirty}save(){const e=this._getDump(),r=Buffer.concat(e[0]),t=JSON.stringify(e[1]);try{p(this._directory),s.writeFileSync(this._lockFilename,"LOCK",{flag:"wx"})}catch(e){return!1}try{s.writeFileSync(this._blobFilename,r),s.writeFileSync(this._mapFilename,t)}finally{s.unlinkSync(this._lockFilename)}return!0}_load(){try{this._storedBlob=s.readFileSync(this._blobFilename),this._storedMap=JSON.parse(s.readFileSync(this._mapFilename))}catch(e){this._storedBlob=Buffer.alloc(0),this._storedMap={}}this._dirty=!1,this._memoryBlobs={},this._invalidationKeys={}}_getDump(){const e=[],r={};let t=0;function n(n,o,s){e.push(s),r[n]=[o,t,t+s.length],t+=s.length}for(const e of Object.keys(this._memoryBlobs)){const r=this._memoryBlobs[e];n(e,this._invalidationKeys[e],r)}for(const e of Object.keys(this._storedMap)){if(l.call(r,e))continue;const t=this._storedMap[e],o=this._storedBlob.slice(t[1],t[2]);n(e,t[0],o)}return[e,r]}}class d{constructor(){this._cacheStore=null,this._previousModuleCompile=null}setCacheStore(e){this._cacheStore=e}install(){const e=this,r="function"==typeof t("./node_modules/v8-compile-cache sync recursive").resolve.paths;this._previousModuleCompile=n.prototype._compile,n.prototype._compile=function(t,o){const s=this;function a(e){return s.require(e)}function c(e,r){return n._resolveFilename(e,s,!1,r)}a.resolve=c,r&&(c.paths=function(e){return n._resolveLookupPaths(e,s,!0)}),a.main=process.mainModule,a.extensions=n._extensions,a.cache=n._cache;const l=i.dirname(o),u=e._moduleCompile(o,t),d=[s.exports,a,s,o,l,process,global,Buffer];return u.apply(s.exports,d)}}uninstall(){n.prototype._compile=this._previousModuleCompile}_moduleCompile(e,r){var t=r.length;if(t>=2&&35===r.charCodeAt(0)&&33===r.charCodeAt(1))if(2===t)r="";else{for(var s=2;s<t;++s){var i=r.charCodeAt(s);if(10===i||13===i)break}r=s===t?"":r.slice(s)}var c=n.wrap(r),l=o.createHash("sha1").update(r,"utf8").digest("hex"),u=this._cacheStore.get(e,l),d=new a.Script(c,{filename:e,lineOffset:0,displayErrors:!0,cachedData:u,produceCachedData:!0});return d.cachedDataProduced?this._cacheStore.set(e,l,d.cachedData):d.cachedDataRejected&&this._cacheStore.delete(e),d.runInThisContext({filename:e,lineOffset:0,columnOffset:0,displayErrors:!0})}}function p(e){m(i.resolve(e),511)}function m(e,r){try{s.mkdirSync(e,r)}catch(r){if("ENOENT"===r.code)m(i.dirname(e)),m(e);else try{if(!s.statSync(e).isDirectory())throw r}catch(e){throw r}}}function f(e){const r={"\\":"zB",":":"zC","/":"zS","\0":"z0",z:"zZ"};return e.replace(/[\\:/\x00z]/g,(e=>r[e]))}function h(){return!0===new a.Script('""',{produceCachedData:!0}).cachedDataProduced}function _(){const e=process.env.V8_COMPILE_CACHE_CACHE_DIR;if(e)return e;const r="function"==typeof process.getuid?"v8-compile-cache-"+process.getuid():"v8-compile-cache",t="string"==typeof process.versions.v8?process.versions.v8:"string"==typeof process.versions.chakracore?"chakracore-"+process.versions.chakracore:"node-"+process.version;return i.join(c.tmpdir(),r,t)}function v(){return e.parent&&"string"==typeof e.parent.filename?e.parent.filename:process.cwd()}if(!process.env.DISABLE_V8_COMPILE_CACHE&&h()){const e=new u(_(),v()),r=new d;r.setCacheStore(e),r.install(),process.once("exit",(()=>{e.isDirty()&&e.save(),r.uninstall()}))}e.exports.__TEST__={FileSystemBlobStore:u,NativeCompileCache:d,mkdirpSync:p,slashEscape:f,supportsCachedData:h,getCacheDir:_,getParentName:v}},"./node_modules/v8-compile-cache sync recursive":e=>{function r(e){var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}r.keys=()=>[],r.resolve=r,r.id="./node_modules/v8-compile-cache sync recursive",e.exports=r},crypto:e=>{"use strict";e.exports=require("crypto")},fs:e=>{"use strict";e.exports=require("fs")},module:e=>{"use strict";e.exports=require("module")},os:e=>{"use strict";e.exports=require("os")},path:e=>{"use strict";e.exports=require("path")},util:e=>{"use strict";e.exports=require("util")},vm:e=>{"use strict";e.exports=require("vm")}},r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n](o,o.exports,t),o.loaded=!0,o.exports}return t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t("./src/jiti.ts")})().default; | ||
module.exports=(()=>{var e={"./node_modules/create-require/create-require.js":(e,r,t)=>{const n=t("module"),o=t("path"),s=t("fs");e.exports=function(e){return e||(e=process.cwd()),function(e){try{return s.lstatSync(e).isDirectory()}catch(e){return!1}}(e)&&(e=o.join(e,"index.js")),n.createRequire?n.createRequire(e):n.createRequireFromPath?n.createRequireFromPath(e):function(e){const r=new n.Module(e,null);return r.filename=e,r.paths=n.Module._nodeModulePaths(o.dirname(e)),r._compile("module.exports = require;",e),r.exports}(e)}},"./node_modules/destr/dist/index.js":e=>{"use strict";var r=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,t=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,n=/^["{[]|^-?[0-9][0-9.]{0,14}$/;function o(e,r){if("__proto__"!==e&&"constructor"!==e)return r}e.exports=function(e){if("string"!=typeof e)return e;var s=e.toLowerCase();if("true"===s)return!0;if("false"===s)return!1;if("null"===s)return null;if("nan"===s)return NaN;if("infinity"===s)return 1/0;if("undefined"!==s){if(!n.test(e))return e;try{return r.test(e)||t.test(e)?JSON.parse(e,o):JSON.parse(e)}catch(r){return e}}}},"./node_modules/function-bind/implementation.js":e=>{"use strict";var r="Function.prototype.bind called on incompatible ",t=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var s=this;if("function"!=typeof s||n.call(s)!==o)throw new TypeError(r+s);for(var i,a=t.call(arguments,1),c=function(){if(this instanceof i){var r=s.apply(this,a.concat(t.call(arguments)));return Object(r)===r?r:this}return s.apply(e,a.concat(t.call(arguments)))},l=Math.max(0,s.length-a.length),u=[],d=0;d<l;d++)u.push("$"+d);if(i=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(c),s.prototype){var p=function(){};p.prototype=s.prototype,i.prototype=new p,p.prototype=null}return i}},"./node_modules/function-bind/index.js":(e,r,t)=>{"use strict";var n=t("./node_modules/function-bind/implementation.js");e.exports=Function.prototype.bind||n},"./node_modules/has/src/index.js":(e,r,t)=>{"use strict";var n=t("./node_modules/function-bind/index.js");e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},"./node_modules/is-core-module/core.json":e=>{"use strict";e.exports=JSON.parse('{"assert":true,"assert/strict":">= 15","async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"diagnostics_channel":">= 15.1","dns":true,"dns/promises":">= 15","domain":">= 0.7.12","events":true,"freelist":"< 6","fs":true,"fs/promises":[">= 10 && < 10.1",">= 14"],"_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6.0 && < 12","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"stream/promises":">= 15","string_decoder":true,"sys":[">= 0.6 && < 0.7",">= 0.8"],"timers":true,"timers/promises":">= 15","_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8":">= 1","vm":true,"wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","zlib":true}')},"./node_modules/is-core-module/index.js":(e,r,t)=>{"use strict";var n=t("./node_modules/has/src/index.js");function o(e,r){for(var t=e.split("."),n=r.split(" "),o=n.length>1?n[0]:"=",s=(n.length>1?n[1]:n[0]).split("."),i=0;i<3;++i){var a=parseInt(t[i]||0,10),c=parseInt(s[i]||0,10);if(a!==c)return"<"===o?a<c:">="===o&&a>=c}return">="===o}function s(e,r){var t=r.split(/ ?&& ?/);if(0===t.length)return!1;for(var n=0;n<t.length;++n)if(!o(e,t[n]))return!1;return!0}var i=t("./node_modules/is-core-module/core.json");e.exports=function(e,r){return n(i,e)&&function(e,r){if("boolean"==typeof r)return r;var t=void 0===e?process.versions&&process.versions.node&&process.versions.node:e;if("string"!=typeof t)throw new TypeError(void 0===e?"Unable to determine current node version":"If provided, a valid node version is required");if(r&&"object"==typeof r){for(var n=0;n<r.length;++n)if(s(t,r[n]))return!0;return!1}return s(t,r)}(r,i[e])}},"./node_modules/mkdirp/index.js":(e,r,t)=>{const n=t("./node_modules/mkdirp/lib/opts-arg.js"),o=t("./node_modules/mkdirp/lib/path-arg.js"),{mkdirpNative:s,mkdirpNativeSync:i}=t("./node_modules/mkdirp/lib/mkdirp-native.js"),{mkdirpManual:a,mkdirpManualSync:c}=t("./node_modules/mkdirp/lib/mkdirp-manual.js"),{useNative:l,useNativeSync:u}=t("./node_modules/mkdirp/lib/use-native.js"),d=(e,r)=>(e=o(e),r=n(r),l(r)?s(e,r):a(e,r));d.sync=(e,r)=>(e=o(e),r=n(r),u(r)?i(e,r):c(e,r)),d.native=(e,r)=>s(o(e),n(r)),d.manual=(e,r)=>a(o(e),n(r)),d.nativeSync=(e,r)=>i(o(e),n(r)),d.manualSync=(e,r)=>c(o(e),n(r)),e.exports=d},"./node_modules/mkdirp/lib/find-made.js":(e,r,t)=>{const{dirname:n}=t("path"),o=(e,r,t)=>t===r?Promise.resolve():e.statAsync(r).then((e=>e.isDirectory()?t:void 0),(t=>"ENOENT"===t.code?o(e,n(r),r):void 0)),s=(e,r,t)=>{if(t!==r)try{return e.statSync(r).isDirectory()?t:void 0}catch(t){return"ENOENT"===t.code?s(e,n(r),r):void 0}};e.exports={findMade:o,findMadeSync:s}},"./node_modules/mkdirp/lib/mkdirp-manual.js":(e,r,t)=>{const{dirname:n}=t("path"),o=(e,r,t)=>{r.recursive=!1;const s=n(e);return s===e?r.mkdirAsync(e,r).catch((e=>{if("EISDIR"!==e.code)throw e})):r.mkdirAsync(e,r).then((()=>t||e),(n=>{if("ENOENT"===n.code)return o(s,r).then((t=>o(e,r,t)));if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;return r.statAsync(e).then((e=>{if(e.isDirectory())return t;throw n}),(()=>{throw n}))}))},s=(e,r,t)=>{const o=n(e);if(r.recursive=!1,o===e)try{return r.mkdirSync(e,r)}catch(e){if("EISDIR"!==e.code)throw e;return}try{return r.mkdirSync(e,r),t||e}catch(n){if("ENOENT"===n.code)return s(e,r,s(o,r,t));if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(!r.statSync(e).isDirectory())throw n}catch(e){throw n}}};e.exports={mkdirpManual:o,mkdirpManualSync:s}},"./node_modules/mkdirp/lib/mkdirp-native.js":(e,r,t)=>{const{dirname:n}=t("path"),{findMade:o,findMadeSync:s}=t("./node_modules/mkdirp/lib/find-made.js"),{mkdirpManual:i,mkdirpManualSync:a}=t("./node_modules/mkdirp/lib/mkdirp-manual.js");e.exports={mkdirpNative:(e,r)=>(r.recursive=!0,n(e)===e?r.mkdirAsync(e,r):o(r,e).then((t=>r.mkdirAsync(e,r).then((()=>t)).catch((t=>{if("ENOENT"===t.code)return i(e,r);throw t}))))),mkdirpNativeSync:(e,r)=>{if(r.recursive=!0,n(e)===e)return r.mkdirSync(e,r);const t=s(r,e);try{return r.mkdirSync(e,r),t}catch(t){if("ENOENT"===t.code)return a(e,r);throw t}}}},"./node_modules/mkdirp/lib/opts-arg.js":(e,r,t)=>{const{promisify:n}=t("util"),o=t("fs");e.exports=e=>{if(e)if("object"==typeof e)e={mode:511,fs:o,...e};else if("number"==typeof e)e={mode:e,fs:o};else{if("string"!=typeof e)throw new TypeError("invalid options argument");e={mode:parseInt(e,8),fs:o}}else e={mode:511,fs:o};return e.mkdir=e.mkdir||e.fs.mkdir||o.mkdir,e.mkdirAsync=n(e.mkdir),e.stat=e.stat||e.fs.stat||o.stat,e.statAsync=n(e.stat),e.statSync=e.statSync||e.fs.statSync||o.statSync,e.mkdirSync=e.mkdirSync||e.fs.mkdirSync||o.mkdirSync,e}},"./node_modules/mkdirp/lib/path-arg.js":(e,r,t)=>{const n=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:o,parse:s}=t("path");e.exports=e=>{if(/\0/.test(e))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:e,code:"ERR_INVALID_ARG_VALUE"});if(e=o(e),"win32"===n){const r=/[*|"<>?:]/,{root:t}=s(e);if(r.test(e.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:e,code:"EINVAL"})}return e}},"./node_modules/mkdirp/lib/use-native.js":(e,r,t)=>{const n=t("fs"),o=(process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version).replace(/^v/,"").split("."),s=+o[0]>10||10==+o[0]&&+o[1]>=12,i=s?e=>e.mkdir===n.mkdir:()=>!1,a=s?e=>e.mkdirSync===n.mkdirSync:()=>!1;e.exports={useNative:i,useNativeSync:a}},"./node_modules/path-parse/index.js":e=>{"use strict";var r="win32"===process.platform,t=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,n=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,o={parse:function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var r,o,s,i,a,c=(r=e,s=((o=t.exec(r))[1]||"")+(o[2]||""),i=o[3]||"",[s,(a=n.exec(i))[1],a[2],a[3]]);if(!c||4!==c.length)throw new TypeError("Invalid path '"+e+"'");return{root:c[0],dir:c[0]+c[1].slice(0,-1),base:c[2],ext:c[3],name:c[2].slice(0,c[2].length-c[3].length)}}},s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i={parse:function(e){if("string"!=typeof e)throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var r,t=(r=e,s.exec(r).slice(1));if(!t||4!==t.length)throw new TypeError("Invalid path '"+e+"'");return t[1]=t[1]||"",t[2]=t[2]||"",t[3]=t[3]||"",{root:t[0],dir:t[0]+t[1].slice(0,-1),base:t[2],ext:t[3],name:t[2].slice(0,t[2].length-t[3].length)}}};e.exports=r?o.parse:i.parse,e.exports.posix=i.parse,e.exports.win32=o.parse},"./node_modules/resolve/index.js":(e,r,t)=>{var n=t("./node_modules/resolve/lib/async.js");n.core=t("./node_modules/resolve/lib/core.js"),n.isCore=t("./node_modules/resolve/lib/is-core.js"),n.sync=t("./node_modules/resolve/lib/sync.js"),e.exports=n},"./node_modules/resolve/lib/async.js":(e,r,t)=>{var n=t("fs"),o=t("path"),s=t("./node_modules/resolve/lib/caller.js"),i=t("./node_modules/resolve/lib/node-modules-paths.js"),a=t("./node_modules/resolve/lib/normalize-options.js"),c=t("./node_modules/is-core-module/index.js"),l=n.realpath&&"function"==typeof n.realpath.native?n.realpath.native:n.realpath,u=function(e,r){n.stat(e,(function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?r(null,!1):r(e):r(null,t.isFile()||t.isFIFO())}))},d=function(e,r){n.stat(e,(function(e,t){return e?"ENOENT"===e.code||"ENOTDIR"===e.code?r(null,!1):r(e):r(null,t.isDirectory())}))},p=function(e,r){l(e,(function(t,n){t&&"ENOENT"!==t.code?r(t):r(null,t?e:n)}))},m=function(e,r,t,n){t&&!1===t.preserveSymlinks?e(r,n):n(null,r)};e.exports=function(e,r,t){var l=t,f=r;if("function"==typeof r&&(l=f,f={}),"string"!=typeof e){var h=new TypeError("Path must be a string.");return process.nextTick((function(){l(h)}))}var _=(f=a(e,f)).isFile||u,v=f.isDirectory||d,y=f.readFile||n.readFile,g=f.realpath||p,b=f.packageIterator,j=f.extensions||[".js"],k=!1!==f.includeCoreModules,x=f.basedir||o.dirname(s()),S=f.filename||x;f.paths=f.paths||[];var w,E=o.resolve(x);function O(r,t,n){r?l(r):t?l(null,t,n):T(w,(function(r,t,n){if(r)l(r);else if(t)m(g,t,f,(function(e,r){e?l(e):l(null,r,n)}));else{var o=new Error("Cannot find module '"+e+"' from '"+S+"'");o.code="MODULE_NOT_FOUND",l(o)}}))}function N(e,r,t){var n=r,s=t;"function"==typeof n&&(s=n,n=void 0),function e(r,t,n){if(0===r.length)return s(null,void 0,n);var i=t+r[0],a=n;function c(n,c,u){if(a=c,n)return s(n);if(u&&a&&f.pathFilter){var d=o.relative(u,i),p=d.slice(0,d.length-r[0].length),m=f.pathFilter(a,t,p);if(m)return e([""].concat(j.slice()),o.resolve(u,m),a)}_(i,l)}function l(n,o){return n?s(n):o?s(null,i,a):void e(r.slice(1),t,a)}a?c(null,a):F(o.dirname(i),c)}([""].concat(j),e,n)}function F(e,r){return""===e||"/"===e||"win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e)?r(null):void m(g,e,f,(function(t,n){if(t)return F(o.dirname(e),r);var s=o.join(n,"package.json");_(s,(function(t,n){if(!n)return F(o.dirname(e),r);y(s,(function(t,n){t&&r(t);try{var o=JSON.parse(n)}catch(e){}o&&f.packageFilter&&(o=f.packageFilter(o,s)),r(null,o,e)}))}))}))}function T(e,r,t){var n=t,s=r;"function"==typeof s&&(n=s,s=f.package),m(g,e,f,(function(r,t){if(r)return n(r);var i=o.join(t,"package.json");_(i,(function(r,t){return r?n(r):t?void y(i,(function(r,t){if(r)return n(r);try{var s=JSON.parse(t)}catch(e){}if(s&&f.packageFilter&&(s=f.packageFilter(s,i)),s&&s.main){if("string"!=typeof s.main){var a=new TypeError("package “"+s.name+"” `main` must be a string");return a.code="INVALID_PACKAGE_MAIN",n(a)}return"."!==s.main&&"./"!==s.main||(s.main="index"),void N(o.resolve(e,s.main),s,(function(r,t,s){return r?n(r):t?n(null,t,s):s?void T(o.resolve(e,s.main),s,(function(r,t,s){return r?n(r):t?n(null,t,s):void N(o.join(e,"index"),s,n)})):N(o.join(e,"index"),s,n)}))}N(o.join(e,"/index"),s,n)})):N(o.join(e,"index"),s,n)}))}))}function M(e,r){if(0===r.length)return e(null,void 0);var t=r[0];function n(r,n,o){return r?e(r):n?e(null,n,o):void T(t,f.package,s)}function s(t,n,o){return t?e(t):n?e(null,n,o):void M(e,r.slice(1))}v(o.dirname(t),(function(o,s){return o?e(o):s?void N(t,f.package,n):M(e,r.slice(1))}))}m(g,E,f,(function(r,t){r?l(r):function(r){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))w=o.resolve(r,e),"."!==e&&".."!==e&&"/"!==e.slice(-1)||(w+="/"),/\/$/.test(e)&&w===r?T(w,f.package,O):N(w,f.package,O);else{if(k&&c(e))return l(null,e);!function(e,r,t){var n=function(){return function(e,r,t){for(var n=i(r,t,e),s=0;s<n.length;s++)n[s]=o.join(n[s],e);return n}(e,r,f)};M(t,b?b(e,r,n,f):n())}(e,r,(function(r,t,n){if(r)l(r);else{if(t)return m(g,t,f,(function(e,r){e?l(e):l(null,r,n)}));var o=new Error("Cannot find module '"+e+"' from '"+S+"'");o.code="MODULE_NOT_FOUND",l(o)}}))}}(t)}))}},"./node_modules/resolve/lib/caller.js":e=>{e.exports=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,r){return r};var r=(new Error).stack;return Error.prepareStackTrace=e,r[2].getFileName()}},"./node_modules/resolve/lib/core.js":(e,r,t)=>{var n=process.versions&&process.versions.node&&process.versions.node.split(".")||[];function o(e){for(var r=e.split(" "),t=r.length>1?r[0]:"=",o=(r.length>1?r[1]:r[0]).split("."),s=0;s<3;++s){var i=parseInt(n[s]||0,10),a=parseInt(o[s]||0,10);if(i!==a)return"<"===t?i<a:">="===t&&i>=a}return">="===t}function s(e){var r=e.split(/ ?&& ?/);if(0===r.length)return!1;for(var t=0;t<r.length;++t)if(!o(r[t]))return!1;return!0}function i(e){if("boolean"==typeof e)return e;if(e&&"object"==typeof e){for(var r=0;r<e.length;++r)if(s(e[r]))return!0;return!1}return s(e)}var a=t("./node_modules/resolve/lib/core.json"),c={};for(var l in a)Object.prototype.hasOwnProperty.call(a,l)&&(c[l]=i(a[l]));e.exports=c},"./node_modules/resolve/lib/core.json":e=>{"use strict";e.exports=JSON.parse('{"assert":true,"assert/strict":">= 15","async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debug_agent":">= 1 && < 8","_debugger":"< 8","dgram":true,"diagnostics_channel":">= 15.1","dns":true,"dns/promises":">= 15","domain":">= 0.7.12","events":true,"freelist":"< 6","fs":true,"fs/promises":[">= 10 && < 10.1",">= 14"],"_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6.0 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6.0 && < 12","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"stream/promises":">= 15","string_decoder":true,"sys":[">= 0.6 && < 0.7",">= 0.8"],"timers":true,"timers/promises":">= 15","_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0 && < 12"],"v8":">= 1","vm":true,"wasi":">= 13.4 && < 13.5","worker_threads":">= 11.7","zlib":true}')},"./node_modules/resolve/lib/is-core.js":(e,r,t)=>{var n=t("./node_modules/is-core-module/index.js");e.exports=function(e){return n(e)}},"./node_modules/resolve/lib/node-modules-paths.js":(e,r,t)=>{var n=t("path"),o=n.parse||t("./node_modules/path-parse/index.js"),s=function(e,r){var t="/";/^([A-Za-z]:)/.test(e)?t="":/^\\\\/.test(e)&&(t="\\\\");for(var s=[e],i=o(e);i.dir!==s[s.length-1];)s.push(i.dir),i=o(i.dir);return s.reduce((function(e,o){return e.concat(r.map((function(e){return n.resolve(t,o,e)})))}),[])};e.exports=function(e,r,t){var n=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&"function"==typeof r.paths)return r.paths(t,e,(function(){return s(e,n)}),r);var o=s(e,n);return r&&r.paths?o.concat(r.paths):o}},"./node_modules/resolve/lib/normalize-options.js":e=>{e.exports=function(e,r){return r||{}}},"./node_modules/resolve/lib/sync.js":(e,r,t)=>{var n=t("./node_modules/is-core-module/index.js"),o=t("fs"),s=t("path"),i=t("./node_modules/resolve/lib/caller.js"),a=t("./node_modules/resolve/lib/node-modules-paths.js"),c=t("./node_modules/resolve/lib/normalize-options.js"),l=o.realpathSync&&"function"==typeof o.realpathSync.native?o.realpathSync.native:o.realpathSync,u=function(e){try{var r=o.statSync(e)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return r.isFile()||r.isFIFO()},d=function(e){try{var r=o.statSync(e)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return!1;throw e}return r.isDirectory()},p=function(e){try{return l(e)}catch(e){if("ENOENT"!==e.code)throw e}return e},m=function(e,r,t){return t&&!1===t.preserveSymlinks?e(r):r};e.exports=function(e,r){if("string"!=typeof e)throw new TypeError("Path must be a string.");var t=c(e,r),l=t.isFile||u,f=t.readFileSync||o.readFileSync,h=t.isDirectory||d,_=t.realpathSync||p,v=t.packageIterator,y=t.extensions||[".js"],g=!1!==t.includeCoreModules,b=t.basedir||s.dirname(i()),j=t.filename||b;t.paths=t.paths||[];var k=m(_,s.resolve(b),t);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var x=s.resolve(k,e);"."!==e&&".."!==e&&"/"!==e.slice(-1)||(x+="/");var S=O(x)||F(x);if(S)return m(_,S,t)}else{if(g&&n(e))return e;var w=function(e,r){for(var n=function(){return function(e,r,t){for(var n=a(r,t,e),o=0;o<n.length;o++)n[o]=s.join(n[o],e);return n}(e,r,t)},o=v?v(e,r,n,t):n(),i=0;i<o.length;i++){var c=o[i];if(h(s.dirname(c))){var l=O(c);if(l)return l;var u=F(c);if(u)return u}}}(e,k);if(w)return m(_,w,t)}var E=new Error("Cannot find module '"+e+"' from '"+j+"'");throw E.code="MODULE_NOT_FOUND",E;function O(e){var r=N(s.dirname(e));if(r&&r.dir&&r.pkg&&t.pathFilter){var n=s.relative(r.dir,e),o=t.pathFilter(r.pkg,e,n);o&&(e=s.resolve(r.dir,o))}if(l(e))return e;for(var i=0;i<y.length;i++){var a=e+y[i];if(l(a))return a}}function N(e){if(""!==e&&"/"!==e&&!("win32"===process.platform&&/^\w:[/\\]*$/.test(e)||/[/\\]node_modules[/\\]*$/.test(e))){var r=s.join(m(_,e,t),"package.json");if(!l(r))return N(s.dirname(e));var n=f(r);try{var o=JSON.parse(n)}catch(e){}return o&&t.packageFilter&&(o=t.packageFilter(o,e)),{pkg:o,dir:e}}}function F(e){var r=s.join(m(_,e,t),"/package.json");if(l(r)){try{var n=f(r,"UTF8"),o=JSON.parse(n)}catch(e){}if(o&&t.packageFilter&&(o=t.packageFilter(o,e)),o&&o.main){if("string"!=typeof o.main){var i=new TypeError("package “"+o.name+"” `main` must be a string");throw i.code="INVALID_PACKAGE_MAIN",i}"."!==o.main&&"./"!==o.main||(o.main="index");try{var a=O(s.resolve(e,o.main));if(a)return a;var c=F(s.resolve(e,o.main));if(c)return c}catch(e){}}}return O(s.join(e,"/index"))}}},"./src/jiti.ts":(e,r,t)=>{"use strict";t.d(r,{default:()=>S}),t("./node_modules/v8-compile-cache/v8-compile-cache.js");var n=t("fs"),o=t("module"),s=t("path"),i=t("os"),a=t("crypto"),c=t("vm"),l=t.n(c),u=t("./node_modules/mkdirp/index.js"),d=t.n(u),p=t("./node_modules/destr/dist/index.js"),m=t.n(p),f=t("./node_modules/create-require/create-require.js"),h=t.n(f),_=t("./node_modules/resolve/index.js"),v=t.n(_);function y(e){try{return(0,n.lstatSync)(e).isDirectory()}catch(e){return!1}}function g(e){try{return(0,n.accessSync)(e,n.constants.W_OK),!0}catch(e){return!1}}e=t.hmd(e);const b=m()(process.env.JITI_DEBUG),j=m()(process.env.JITI_CACHE),k={debug:b,cache:void 0===j||j};function x(e,r=8){return(0,a.createHash)("md5").update(e).digest("hex").substr(0,r)}function S(r=process.cwd(),t={}){function a(...e){t.debug&&console.log("[jiti]",...e)}if(t=Object.assign(Object.assign({},k),t),y(r)&&(r=(0,s.join)(r,"index.js")),!0===t.cache){const e=(0,s.join)(process.cwd(),"node_modules");y(e)&&(t.cache=(0,s.join)(e,".cache/jiti")),!0!==t.cache&&g(t.cache)?g(t.cache)||(t.cache=!1):t.cache=(0,s.join)((0,i.tmpdir)(),"node-jiti")}t.cache?(y(t.cache)||d().sync(t.cache),a("Cache dir:",t.cache)):a("Cache is disabled");const c={extensions:[".ts",".js",".mjs"],basedir:(0,s.dirname)(r)},u=e=>v().sync(e,c);u.paths=e=>[];const p=h()(r);function m(e,r,o){if(!t.cache)return o();const i=` /* v2-${x(r,16)} */`,a=(0,s.basename)((0,s.dirname)(e))+"-"+(0,s.basename)(e),c=(0,s.join)(t.cache,a+"."+x(e)+".js");if((0,n.existsSync)(c)){const e=(0,n.readFileSync)(c,"utf-8");if(e.endsWith(i))return e}const l=o();return(0,n.writeFileSync)(c,l+i,"utf-8"),l}function f(r){var i;if(o.builtinModules.includes(r))return p(r);const c=u(r);if(c.match(/\.mjs$/)&&t.dynamicImport)return a("[mjs bail]",c),t.dynamicImport(c);if(p.cache[c])return null===(i=p.cache[c])||void 0===i?void 0:i.exports;let d=(0,n.readFileSync)(c,"utf-8");if(c.match(/\.ts$/))a("[ts]",c),d=m(c,d,(()=>t.transform({source:d,filename:c,ts:!0})));else{if(!(d.match(/^\s*import .* from/m)||d.match(/import\s*\(/)||d.match(/^\s*export /m)))return a("[bail]",c),p(r);a("[esm]",c),d=m(c,d,(()=>t.transform({source:d,filename:c})))}const f=new o.Module(c);return f.filename=c,f.parent=e,f.require=S(c,t),f.path=(0,s.dirname)(c),f.paths=o.Module._nodeModulePaths(f.path),l().runInThisContext(o.Module.wrap(d),{filename:c,lineOffset:0,displayErrors:!0})(f.exports,f.require,f,f.filename,(0,s.dirname)(f.filename)),f.loaded=!0,p.cache[c]=f,f.exports}return f.resolve=u,f.cache=p.cache,f.extensions=p.extensions,f.main=p.main,f}},"./node_modules/v8-compile-cache/v8-compile-cache.js":(e,r,t)=>{"use strict";e=t.nmd(e);const n=t("module"),o=t("crypto"),s=t("fs"),i=t("path"),a=t("vm"),c=t("os"),l=Object.prototype.hasOwnProperty;class u{constructor(e,r){const t=r?f(r+"."):"";this._blobFilename=i.join(e,t+"BLOB"),this._mapFilename=i.join(e,t+"MAP"),this._lockFilename=i.join(e,t+"LOCK"),this._directory=e,this._load()}has(e,r){return l.call(this._memoryBlobs,e)?this._invalidationKeys[e]===r:!!l.call(this._storedMap,e)&&this._storedMap[e][0]===r}get(e,r){if(l.call(this._memoryBlobs,e)){if(this._invalidationKeys[e]===r)return this._memoryBlobs[e]}else if(l.call(this._storedMap,e)){const t=this._storedMap[e];if(t[0]===r)return this._storedBlob.slice(t[1],t[2])}}set(e,r,t){this._invalidationKeys[e]=r,this._memoryBlobs[e]=t,this._dirty=!0}delete(e){l.call(this._memoryBlobs,e)&&(this._dirty=!0,delete this._memoryBlobs[e]),l.call(this._invalidationKeys,e)&&(this._dirty=!0,delete this._invalidationKeys[e]),l.call(this._storedMap,e)&&(this._dirty=!0,delete this._storedMap[e])}isDirty(){return this._dirty}save(){const e=this._getDump(),r=Buffer.concat(e[0]),t=JSON.stringify(e[1]);try{p(this._directory),s.writeFileSync(this._lockFilename,"LOCK",{flag:"wx"})}catch(e){return!1}try{s.writeFileSync(this._blobFilename,r),s.writeFileSync(this._mapFilename,t)}finally{s.unlinkSync(this._lockFilename)}return!0}_load(){try{this._storedBlob=s.readFileSync(this._blobFilename),this._storedMap=JSON.parse(s.readFileSync(this._mapFilename))}catch(e){this._storedBlob=Buffer.alloc(0),this._storedMap={}}this._dirty=!1,this._memoryBlobs={},this._invalidationKeys={}}_getDump(){const e=[],r={};let t=0;function n(n,o,s){e.push(s),r[n]=[o,t,t+s.length],t+=s.length}for(const e of Object.keys(this._memoryBlobs)){const r=this._memoryBlobs[e];n(e,this._invalidationKeys[e],r)}for(const e of Object.keys(this._storedMap)){if(l.call(r,e))continue;const t=this._storedMap[e],o=this._storedBlob.slice(t[1],t[2]);n(e,t[0],o)}return[e,r]}}class d{constructor(){this._cacheStore=null,this._previousModuleCompile=null}setCacheStore(e){this._cacheStore=e}install(){const e=this,r="function"==typeof t("./node_modules/v8-compile-cache sync recursive").resolve.paths;this._previousModuleCompile=n.prototype._compile,n.prototype._compile=function(t,o){const s=this;function a(e){return s.require(e)}function c(e,r){return n._resolveFilename(e,s,!1,r)}a.resolve=c,r&&(c.paths=function(e){return n._resolveLookupPaths(e,s,!0)}),a.main=process.mainModule,a.extensions=n._extensions,a.cache=n._cache;const l=i.dirname(o),u=e._moduleCompile(o,t),d=[s.exports,a,s,o,l,process,global,Buffer];return u.apply(s.exports,d)}}uninstall(){n.prototype._compile=this._previousModuleCompile}_moduleCompile(e,r){var t=r.length;if(t>=2&&35===r.charCodeAt(0)&&33===r.charCodeAt(1))if(2===t)r="";else{for(var s=2;s<t;++s){var i=r.charCodeAt(s);if(10===i||13===i)break}r=s===t?"":r.slice(s)}var c=n.wrap(r),l=o.createHash("sha1").update(r,"utf8").digest("hex"),u=this._cacheStore.get(e,l),d=new a.Script(c,{filename:e,lineOffset:0,displayErrors:!0,cachedData:u,produceCachedData:!0});return d.cachedDataProduced?this._cacheStore.set(e,l,d.cachedData):d.cachedDataRejected&&this._cacheStore.delete(e),d.runInThisContext({filename:e,lineOffset:0,columnOffset:0,displayErrors:!0})}}function p(e){m(i.resolve(e),511)}function m(e,r){try{s.mkdirSync(e,r)}catch(r){if("ENOENT"===r.code)m(i.dirname(e)),m(e);else try{if(!s.statSync(e).isDirectory())throw r}catch(e){throw r}}}function f(e){const r={"\\":"zB",":":"zC","/":"zS","\0":"z0",z:"zZ"};return e.replace(/[\\:/\x00z]/g,(e=>r[e]))}function h(){return!0===new a.Script('""',{produceCachedData:!0}).cachedDataProduced}function _(){const e=process.env.V8_COMPILE_CACHE_CACHE_DIR;if(e)return e;const r="function"==typeof process.getuid?"v8-compile-cache-"+process.getuid():"v8-compile-cache",t="string"==typeof process.versions.v8?process.versions.v8:"string"==typeof process.versions.chakracore?"chakracore-"+process.versions.chakracore:"node-"+process.version;return i.join(c.tmpdir(),r,t)}function v(){return e.parent&&"string"==typeof e.parent.filename?e.parent.filename:process.cwd()}if(!process.env.DISABLE_V8_COMPILE_CACHE&&h()){const e=new u(_(),v()),r=new d;r.setCacheStore(e),r.install(),process.once("exit",(()=>{e.isDirty()&&e.save(),r.uninstall()}))}e.exports.__TEST__={FileSystemBlobStore:u,NativeCompileCache:d,mkdirpSync:p,slashEscape:f,supportsCachedData:h,getCacheDir:_,getParentName:v}},"./node_modules/v8-compile-cache sync recursive":e=>{function r(e){var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}r.keys=()=>[],r.resolve=r,r.id="./node_modules/v8-compile-cache sync recursive",e.exports=r},crypto:e=>{"use strict";e.exports=require("crypto")},fs:e=>{"use strict";e.exports=require("fs")},module:e=>{"use strict";e.exports=require("module")},os:e=>{"use strict";e.exports=require("os")},path:e=>{"use strict";e.exports=require("path")},util:e=>{"use strict";e.exports=require("util")},vm:e=>{"use strict";e.exports=require("vm")}},r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={id:n,loaded:!1,exports:{}};return e[n](o,o.exports,t),o.loaded=!0,o.exports}return t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t("./src/jiti.ts")})().default; |
{ | ||
"name": "jiti", | ||
"version": "0.1.16", | ||
"version": "0.1.17", | ||
"description": "Runtime typescript and ESM support for Node.js (CommonJS)", | ||
"repository": "nuxt-contrib/jiti", | ||
"license": "MIT", | ||
"main": "./index.js", | ||
"main": "./lib/index.js", | ||
"types": "dist/jiti.d.ts", | ||
"bin": "bin/jiti.js", | ||
"files": [ | ||
"index.js", | ||
"lib", | ||
"dist" | ||
@@ -19,2 +19,3 @@ ], | ||
"dev": "yarn clean && yarn webpack --watch", | ||
"jiti": "JITI_DEBUG=1 ./bin/jiti.js", | ||
"lint": "eslint --ext .ts,.js .", | ||
@@ -21,0 +22,0 @@ "release": "yarn test && yarn build && yarn standard-version && git push --follow-tags && npm publish", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1162057
15
4305