You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@expo/require-utils

Package Overview
Dependencies
Maintainers
10
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/require-utils - npm Package Compare versions

Comparing version
55.0.1
to
55.0.2
+1
build/transform.d.ts
export declare function toCommonJS(filename: string, code: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.toCommonJS = toCommonJS;
function _core() {
const data = require("@babel/core");
_core = function () {
return data;
};
return data;
}
function toCommonJS(filename, code) {
const result = (0, _core().transformSync)(code, {
filename,
babelrc: false,
plugins: [[require('@babel/plugin-transform-modules-commonjs'), {
// NOTE(@kitten): We used to use sucrase to transform, which is why
// we're doing this CJS-to-ESM transform in the first place. Our
// previous transformation isn't 100% compatible with the standard
// Node ESM loading. In Babel, this is the "node" flag (although
// node behaviour is explicitly different from this). This skips
// the `__esModule -> default` wrapper
importInterop: 'node',
loose: true
}]]
});
return result?.code ?? code;
}
//# sourceMappingURL=transform.js.map
{"version":3,"file":"transform.js","names":["_core","data","require","toCommonJS","filename","code","result","transformSync","babelrc","plugins","importInterop","loose"],"sources":["../src/transform.ts"],"sourcesContent":["import { transformSync } from '@babel/core';\n\nexport function toCommonJS(filename: string, code: string) {\n const result = transformSync(code, {\n filename,\n babelrc: false,\n plugins: [\n [\n require('@babel/plugin-transform-modules-commonjs'),\n {\n // NOTE(@kitten): We used to use sucrase to transform, which is why\n // we're doing this CJS-to-ESM transform in the first place. Our\n // previous transformation isn't 100% compatible with the standard\n // Node ESM loading. In Babel, this is the \"node\" flag (although\n // node behaviour is explicitly different from this). This skips\n // the `__esModule -> default` wrapper\n importInterop: 'node',\n loose: true,\n },\n ],\n ],\n });\n return result?.code ?? code;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEO,SAASE,UAAUA,CAACC,QAAgB,EAAEC,IAAY,EAAE;EACzD,MAAMC,MAAM,GAAG,IAAAC,qBAAa,EAACF,IAAI,EAAE;IACjCD,QAAQ;IACRI,OAAO,EAAE,KAAK;IACdC,OAAO,EAAE,CACP,CACEP,OAAO,CAAC,0CAA0C,CAAC,EACnD;MACE;MACA;MACA;MACA;MACA;MACA;MACAQ,aAAa,EAAE,MAAM;MACrBC,KAAK,EAAE;IACT,CAAC,CACF;EAEL,CAAC,CAAC;EACF,OAAOL,MAAM,EAAED,IAAI,IAAIA,IAAI;AAC7B","ignoreList":[]}
+1
-1

@@ -5,4 +5,4 @@ import type { Diagnostic } from 'typescript';

}) | null;
export declare function annotateError(code: string, filename: string, error: Error): (Error & {
export declare function annotateError(code: string | null, filename: string, error: Error): (Error & {
codeFrame: string;
}) | null;

@@ -69,17 +69,19 @@ "use strict";

}
const loc = errorToLoc(filename, error);
if (loc) {
const {
codeFrameColumns
} = require('@babel/code-frame');
const codeFrame = codeFrameColumns(code, {
start: loc
}, {
highlightCode: true
});
const annotatedError = error;
annotatedError.codeFrame = codeFrame;
annotatedError.message += `\n${codeFrame}`;
delete annotatedError.stack;
return annotatedError;
if (code) {
const loc = errorToLoc(filename, error);
if (loc) {
const {
codeFrameColumns
} = require('@babel/code-frame');
const codeFrame = codeFrameColumns(code, {
start: loc
}, {
highlightCode: true
});
const annotatedError = error;
annotatedError.codeFrame = codeFrame;
annotatedError.message += `\n${codeFrame}`;
delete annotatedError.stack;
return annotatedError;
}
}

@@ -86,0 +88,0 @@ return null;

@@ -1,1 +0,1 @@

{"version":3,"file":"codeframe.js","names":["_nodeUrl","data","_interopRequireDefault","require","e","__esModule","default","errorToLoc","filename","error","name","stack","slice","length","message","trace","match","url","pathToFileURL","href","line","Number","isSafeInteger","column","undefined","formatDiagnostic","diagnostic","start","file","messageText","codeFrameColumns","character","getLineAndCharacterOfPosition","loc","codeFrame","getText","highlightCode","annotatedError","SyntaxError","annotateError","code"],"sources":["../src/codeframe.ts"],"sourcesContent":["import url from 'node:url';\nimport type { Diagnostic } from 'typescript';\n\nfunction errorToLoc(filename: string, error: Error) {\n if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {\n let stack = `${error.stack || ''}`;\n stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */);\n stack = stack.slice(error.message.length);\n const trace = stack.match(/at ([^\\n]+):(\\d+):(\\d+)/m);\n if (url.pathToFileURL(filename).href === trace?.[1]) {\n const line = Number(trace[2]);\n return Number.isSafeInteger(line) ? { line, column: Number(trace[3]) || undefined } : null;\n }\n }\n return null;\n}\n\nexport function formatDiagnostic(diagnostic: Diagnostic | undefined) {\n if (!diagnostic) {\n return null;\n }\n const { start, file, messageText } = diagnostic;\n if (file && messageText && start != null) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const { line, character } = file.getLineAndCharacterOfPosition(start);\n const loc = { line: line + 1, column: character + 1 };\n const codeFrame = codeFrameColumns(file.getText(), { start: loc }, { highlightCode: true });\n const annotatedError = new SyntaxError(`${messageText}\\n${codeFrame}`) as SyntaxError & {\n codeFrame: string;\n };\n annotatedError.codeFrame = codeFrame;\n delete annotatedError.stack;\n return annotatedError;\n }\n return null;\n}\n\nexport function annotateError(code: string, filename: string, error: Error) {\n if (typeof error !== 'object' || error == null) {\n return null;\n }\n const loc = errorToLoc(filename, error);\n if (loc) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(code, { start: loc }, { highlightCode: true });\n const annotatedError = error as Error & { codeFrame: string };\n annotatedError.codeFrame = codeFrame;\n annotatedError.message += `\\n${codeFrame}`;\n delete annotatedError.stack;\n return annotatedError;\n }\n return null;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAA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KAAK;IAC3B,OAAO0B,cAAc;EACvB;EACA,OAAO,IAAI;AACb","ignoreList":[]}
{"version":3,"file":"codeframe.js","names":["_nodeUrl","data","_interopRequireDefault","require","e","__esModule","default","errorToLoc","filename","error","name","stack","slice","length","message","trace","match","url","pathToFileURL","href","line","Number","isSafeInteger","column","undefined","formatDiagnostic","diagnostic","start","file","messageText","codeFrameColumns","character","getLineAndCharacterOfPosition","loc","codeFrame","getText","highlightCode","annotatedError","SyntaxError","annotateError","code"],"sources":["../src/codeframe.ts"],"sourcesContent":["import url from 'node:url';\nimport type { Diagnostic } from 'typescript';\n\nfunction errorToLoc(filename: string, error: Error) {\n if (error.name === 'ReferenceError' || error.name === 'SyntaxError') {\n let stack = `${error.stack || ''}`;\n stack = stack.slice(error.name.length + 2 /* '${name}: ' prefix */);\n stack = stack.slice(error.message.length);\n const trace = stack.match(/at ([^\\n]+):(\\d+):(\\d+)/m);\n if (url.pathToFileURL(filename).href === trace?.[1]) {\n const line = Number(trace[2]);\n return Number.isSafeInteger(line) ? { line, column: Number(trace[3]) || undefined } : null;\n }\n }\n return null;\n}\n\nexport function formatDiagnostic(diagnostic: Diagnostic | undefined) {\n if (!diagnostic) {\n return null;\n }\n const { start, file, messageText } = diagnostic;\n if (file && messageText && start != null) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const { line, character } = file.getLineAndCharacterOfPosition(start);\n const loc = { line: line + 1, column: character + 1 };\n const codeFrame = codeFrameColumns(file.getText(), { start: loc }, { highlightCode: true });\n const annotatedError = new SyntaxError(`${messageText}\\n${codeFrame}`) as SyntaxError & {\n codeFrame: string;\n };\n annotatedError.codeFrame = codeFrame;\n delete annotatedError.stack;\n return annotatedError;\n }\n return null;\n}\n\nexport function annotateError(code: string | null, filename: string, error: Error) {\n if (typeof error !== 'object' || error == null) {\n return null;\n }\n if (code) {\n const loc = errorToLoc(filename, error);\n if (loc) {\n const { codeFrameColumns }: typeof import('@babel/code-frame') = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(code, { start: loc }, { highlightCode: true });\n const annotatedError = error as Error & { codeFrame: string };\n annotatedError.codeFrame = codeFrame;\n annotatedError.message += `\\n${codeFrame}`;\n delete annotatedError.stack;\n return annotatedError;\n }\n }\n return null;\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,SAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,QAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA2B,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAG3B,SAASG,UAAUA,CAACC,QAAgB,EAAEC,KAAY,EAAE;EAClD,IAAIA,KAAK,CAACC,IAAI,KAAK,gBAAgB,IAAID,KAAK,CAACC,IAAI,KAAK,aAAa,EAAE;IACnE,IAAIC,KAAK,GAAG,GAAGF,KAAK,CAACE,KAAK,IAAI,EAAE,EAAE;IAClCA,KAAK,GAAGA,KAAK,CAACC,KAAK,CAACH,KAAK,CAACC,IAAI,CAACG,MAAM,GAAG,CAAC,CAAC,wBAAwB,CAAC;IACnEF,KAAK,GAAGA,KAAK,CAACC,KAAK,CAACH,KAAK,CAACK,OAAO,CAACD,MAAM,CAAC;IACzC,MAAME,KAAK,GAAGJ,KAAK,CAACK,KAAK,CAAC,0BAA0B,CAAC;IACrD,IAAIC,kBAAG,CAACC,aAAa,CAACV,QAAQ,CAAC,CAACW,IAAI,KAAKJ,KAAK,GAAG,CAAC,CAAC,EAAE;MACnD,MAAMK,IAAI,GAAGC,MAAM,CAACN,KAAK,CAAC,CAAC,CAAC,CAAC;MAC7B,OAAOM,MAAM,CAACC,aAAa,CAACF,IAAI,CAAC,GAAG;QAAEA,IAAI;QAAEG,MAAM,EAAEF,MAAM,CAACN,KAAK,CAAC,CAAC,CAAC,CAAC,IAAIS;MAAU,CAAC,GAAG,I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CAAC;MAC7F,MAAM+B,SAAS,GAAGJ,gBAAgB,CAACU,IAAI,EAAE;QAAEb,KAAK,EAAEM;MAAI,CAAC,EAAE;QAAEG,aAAa,EAAE;MAAK,CAAC,CAAC;MACjF,MAAMC,cAAc,GAAG5B,KAAsC;MAC7D4B,cAAc,CAACH,SAAS,GAAGA,SAAS;MACpCG,cAAc,CAACvB,OAAO,IAAI,KAAKoB,SAAS,EAAE;MAC1C,OAAOG,cAAc,CAAC1B,KAAK;MAC3B,OAAO0B,cAAc;IACvB;EACF;EACA,OAAO,IAAI;AACb","ignoreList":[]}

@@ -11,6 +11,7 @@ declare module 'node:module' {

}
type Format = 'commonjs' | 'module' | 'module-typescript' | 'commonjs-typescript' | 'typescript';
export interface ModuleOptions {
paths?: string[];
}
declare function evalModule(code: string, filename: string, opts?: ModuleOptions): any;
declare function evalModule(code: string, filename: string, opts?: ModuleOptions, format?: Format): any;
declare function loadModule(filename: string): Promise<any>;

@@ -17,0 +18,0 @@ /** Require module or evaluate with TypeScript

@@ -44,2 +44,9 @@ "use strict";

}
function _transform() {
const data = require("./transform");
_transform = function () {
return data;
};
return data;
}
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }

@@ -69,3 +76,13 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }

};
function toFormat(filename) {
function maybeReadFileSync(filename) {
try {
return _nodeFs().default.readFileSync(filename, 'utf8');
} catch (error) {
if (error.code === 'ENOENT') {
return null;
}
throw error;
}
}
function toFormat(filename, isLegacy) {
if (filename.endsWith('.cjs')) {

@@ -76,3 +93,3 @@ return 'commonjs';

} else if (filename.endsWith('.js')) {
return undefined;
return isLegacy ? 'commonjs' : null;
} else if (filename.endsWith('.mts')) {

@@ -83,19 +100,9 @@ return 'module-typescript';

} else if (filename.endsWith('.ts')) {
return 'typescript';
return isLegacy ? 'commonjs-typescript' : 'typescript';
} else {
return undefined;
return null;
}
}
function isTypescriptFilename(filename) {
switch (toFormat(filename)) {
case 'module-typescript':
case 'commonjs-typescript':
case 'typescript':
return true;
default:
return false;
}
}
function compileModule(code, filename, opts) {
const format = toFormat(filename);
const format = toFormat(filename, false);
const prependPaths = opts.paths ?? [];

@@ -109,6 +116,7 @@ const nodeModulePaths = nodeModule()._nodeModulePaths(_nodePath().default.dirname(filename));

});
mod._compile(code, filename, format);
mod._compile(code, filename, format != null ? format : undefined);
mod.loaded = true;
require.cache[filename] = mod;
parent?.children?.splice(parent.children.indexOf(mod), 1);
return mod.exports;
return mod;
} catch (error) {

@@ -120,14 +128,13 @@ delete require.cache[filename];

const hasStripTypeScriptTypes = typeof nodeModule().stripTypeScriptTypes === 'function';
function evalModule(code, filename, opts = {}) {
function evalModule(code, filename, opts = {}, format = toFormat(filename, true)) {
let inputCode = code;
let inputFilename = filename;
let diagnostic;
if (filename.endsWith('.ts') || filename.endsWith('.cts') || filename.endsWith('.mts')) {
const ext = _nodePath().default.extname(filename);
if (format === 'typescript' || format === 'module-typescript' || format === 'commonjs-typescript') {
const ts = loadTypescript();
if (ts) {
let module;
if (ext === '.cts') {
if (format === 'commonjs-typescript') {
module = ts.ModuleKind.CommonJS;
} else if (ext === '.mts') {
} else if (format === 'module-typescript') {
module = ts.ModuleKind.ESNext;

@@ -168,2 +175,3 @@ } else {

if (inputCode !== code) {
const ext = _nodePath().default.extname(filename);
const inputExt = tsExtensionMapping[ext] ?? ext;

@@ -174,2 +182,4 @@ if (inputExt !== ext) {

}
} else if (format === 'commonjs') {
inputCode = (0, _transform().toCommonJS)(filename, code);
}

@@ -181,7 +191,11 @@ try {

}
return mod;
return mod.exports;
} catch (error) {
// If we have a diagnostic from TypeScript, we issue its error with a codeframe first,
// since it's likely more useful than the eval error
throw (0, _codeframe().formatDiagnostic)(diagnostic) ?? (0, _codeframe().annotateError)(code, filename, error) ?? error;
const diagnosticError = (0, _codeframe().formatDiagnostic)(diagnostic);
if (diagnosticError) {
throw diagnosticError;
}
throw (0, _codeframe().annotateError)(code, filename, error) ?? error;
}

@@ -212,4 +226,6 @@ }

function loadModuleSync(filename) {
const format = toFormat(filename, true);
const isTypeScript = format === 'module-typescript' || format === 'commonjs-typescript' || format === 'typescript';
try {
if (!isTypescriptFilename(filename)) {
if (format !== 'module' && !isTypeScript) {
return require(filename);

@@ -220,2 +236,5 @@ }

throw error;
} else if (format == null) {
const code = maybeReadFileSync(filename);
throw (0, _codeframe().annotateError)(code, filename, error) || error;
}

@@ -226,5 +245,11 @@ // We fallback to always evaluating the entrypoint module

}
// Load from cache manually, if `loaded` is set and exports are defined, to avoid
// double transform or double evaluation
if (require.cache[filename]?.exports && require.cache[filename].loaded) {
return require.cache[filename].exports;
}
const code = _nodeFs().default.readFileSync(filename, 'utf8');
return evalModule(code, filename);
return evalModule(code, filename, {}, format);
}
//# sourceMappingURL=load.js.map

@@ -1,1 +0,1 @@

{"version":3,"file":"load.js","names":["_nodeFs","data","_interopRequireDefault","require","nodeModule","_interopRequireWildcard","_nodePath","_nodeUrl","_codeframe","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_ts","loadTypescript","undefined","error","code","parent","module","tsExtensionMapping","toFormat","filename","endsWith","isTypescriptFilename","compileModule","opts","format","prependPaths","paths","nodeModulePaths","_nodeModulePaths","path","dirname","mod","assign","Module","_compile","cache","children","splice","indexOf","exports","hasStripTypeScriptTypes","stripTypeScriptTypes","evalModule","inputCode","inputFilename","diagnostic","ext","extname","ts","ModuleKind","CommonJS","ESNext","Preserve","output","transpileModule","fileName","reportDiagnostics","compilerOptions","moduleResolution","ModuleResolutionKind","Bundler","verbatimModuleSyntax","target","ScriptTarget","newLine","NewLineKind","LineFeed","inlineSourceMap","esModuleInterop","outputText","diagnostics","length","mode","sourceMap","inputExt","join","basename","formatDiagnostic","annotateError","requireOrImport","Promise","resolve","isAbsolute","url","pathToFileURL","toString","then","s","loadModule","loadModuleSync","fs","readFileSync"],"sources":["../src/load.ts"],"sourcesContent":["import fs from 'node:fs';\nimport * as nodeModule from 'node:module';\nimport path from 'node:path';\nimport url from 'node:url';\nimport type * as ts from 'typescript';\n\nimport { annotateError, formatDiagnostic } from './codeframe';\n\ndeclare module 'node:module' {\n export function _nodeModulePaths(base: string): readonly string[];\n}\n\ndeclare global {\n namespace NodeJS {\n export interface Module {\n _compile(\n code: string,\n filename: string,\n format?: 'module' | 'commonjs' | 'commonjs-typescript' | 'module-typescript' | 'typescript'\n ): unknown;\n }\n }\n}\n\nlet _ts: typeof import('typescript') | null | undefined;\nfunction loadTypescript() {\n if (_ts === undefined) {\n try {\n _ts = require('typescript');\n } catch (error: any) {\n if (error.code !== 'MODULE_NOT_FOUND') {\n throw error;\n } else {\n _ts = null;\n }\n }\n }\n return _ts;\n}\n\nconst parent = module;\n\nconst tsExtensionMapping: Record<string, string | undefined> = {\n '.ts': '.js',\n '.cts': '.cjs',\n '.mts': '.mjs',\n};\n\nfunction toFormat(filename: string) {\n if (filename.endsWith('.cjs')) {\n return 'commonjs';\n } else if (filename.endsWith('.mjs')) {\n return 'module';\n } else if (filename.endsWith('.js')) {\n return undefined;\n } else if (filename.endsWith('.mts')) {\n return 'module-typescript';\n } else if (filename.endsWith('.cts')) {\n return 'commonjs-typescript';\n } else if (filename.endsWith('.ts')) {\n return 'typescript';\n } else {\n return undefined;\n }\n}\n\nfunction isTypescriptFilename(filename: string) {\n switch (toFormat(filename)) {\n case 'module-typescript':\n case 'commonjs-typescript':\n case 'typescript':\n return true;\n default:\n return false;\n }\n}\n\nexport interface ModuleOptions {\n paths?: string[];\n}\n\nfunction compileModule<T = any>(code: string, filename: string, opts: ModuleOptions): T {\n const format = toFormat(filename);\n const prependPaths = opts.paths ?? [];\n const nodeModulePaths = nodeModule._nodeModulePaths(path.dirname(filename));\n const paths = [...prependPaths, ...nodeModulePaths];\n try {\n const mod = Object.assign(new nodeModule.Module(filename, parent), { filename, paths });\n mod._compile(code, filename, format);\n require.cache[filename] = mod;\n parent?.children?.splice(parent.children.indexOf(mod), 1);\n return mod.exports;\n } catch (error: any) {\n delete require.cache[filename];\n throw error;\n }\n}\n\nconst hasStripTypeScriptTypes = typeof nodeModule.stripTypeScriptTypes === 'function';\n\nfunction evalModule(code: string, filename: string, opts: ModuleOptions = {}) {\n let inputCode = code;\n let inputFilename = filename;\n let diagnostic: ts.Diagnostic | undefined;\n if (filename.endsWith('.ts') || filename.endsWith('.cts') || filename.endsWith('.mts')) {\n const ext = path.extname(filename);\n const ts = loadTypescript();\n\n if (ts) {\n let module: ts.ModuleKind;\n if (ext === '.cts') {\n module = ts.ModuleKind.CommonJS;\n } else if (ext === '.mts') {\n module = ts.ModuleKind.ESNext;\n } else {\n // NOTE(@kitten): We can \"preserve\" the output, meaning, it can either be ESM or CJS\n // and stop TypeScript from either transpiling it to CommonJS or adding an `export {}`\n // if no exports are used. This allows the user to choose if this file is CJS or ESM\n // (but not to mix both)\n module = ts.ModuleKind.Preserve;\n }\n const output = ts.transpileModule(code, {\n fileName: filename,\n reportDiagnostics: true,\n compilerOptions: {\n module,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n // `verbatimModuleSyntax` needs to be off, to erase as many imports as possible\n verbatimModuleSyntax: false,\n target: ts.ScriptTarget.ESNext,\n newLine: ts.NewLineKind.LineFeed,\n inlineSourceMap: true,\n esModuleInterop: true,\n },\n });\n inputCode = output?.outputText || inputCode;\n if (output?.diagnostics?.length) {\n diagnostic = output.diagnostics[0];\n }\n }\n\n if (hasStripTypeScriptTypes && inputCode === code) {\n // This may throw its own error, but this contains a code-frame already\n inputCode = nodeModule.stripTypeScriptTypes(code, {\n mode: 'transform',\n sourceMap: true,\n });\n }\n\n if (inputCode !== code) {\n const inputExt = tsExtensionMapping[ext] ?? ext;\n if (inputExt !== ext) {\n inputFilename = path.join(path.dirname(filename), path.basename(filename, ext) + inputExt);\n }\n }\n }\n\n try {\n const mod = compileModule(inputCode, inputFilename, opts);\n if (inputFilename !== filename) {\n require.cache[filename] = mod;\n }\n return mod;\n } catch (error: any) {\n // If we have a diagnostic from TypeScript, we issue its error with a codeframe first,\n // since it's likely more useful than the eval error\n throw formatDiagnostic(diagnostic) ?? annotateError(code, filename, error) ?? error;\n }\n}\n\nasync function requireOrImport(filename: string) {\n try {\n return require(filename);\n } catch {\n return await import(\n path.isAbsolute(filename) ? url.pathToFileURL(filename).toString() : filename\n );\n }\n}\n\nasync function loadModule(filename: string) {\n try {\n return await requireOrImport(filename);\n } catch (error: any) {\n if (error.code === 'ERR_UNKNOWN_FILE_EXTENSION' || error.code === 'MODULE_NOT_FOUND') {\n return loadModuleSync(filename);\n } else {\n throw error;\n }\n }\n}\n\n/** Require module or evaluate with TypeScript\n * NOTE: Requiring ESM has been added in all LTS versions (Node 20.19+, 22.12+, 24).\n * This already forms the minimum required Node version as of Expo SDK 54 */\nfunction loadModuleSync(filename: string) {\n try {\n if (!isTypescriptFilename(filename)) {\n return require(filename);\n }\n } catch (error: any) {\n if (error.code === 'MODULE_NOT_FOUND') {\n throw error;\n }\n // We fallback to always evaluating the entrypoint module\n // This is out of safety, since we're not trusting the requiring ESM feature\n // and evaluating the module manually bypasses the error when it's flagged off\n }\n const code = fs.readFileSync(filename, 'utf8');\n return evalModule(code, filename);\n}\n\nexport { evalModule, loadModule, loadModuleSync };\n"],"mappings":";;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAA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CAAC,IAAIA,KAAK;EACrF;AACF;AAEA,eAAekE,eAAeA,CAAC5D,QAAgB,EAAE;EAC/C,IAAI;IACF,OAAOnC,OAAO,CAACmC,QAAQ,CAAC;EAC1B,CAAC,CAAC,MAAM;IACN,OAAO,MAAA6D,OAAA,CAAAC,OAAA,IACLpD,mBAAI,CAACqD,UAAU,CAAC/D,QAAQ,CAAC,GAAGgE,kBAAG,CAACC,aAAa,CAACjE,QAAQ,CAAC,CAACkE,QAAQ,CAAC,CAAC,GAAGlE,QAAQ,IAAAmE,IAAA,CAAAC,CAAA,IAAArG,uBAAA,CAAAF,OAAA,CAAAuG,CAAA,GAC9E;EACH;AACF;AAEA,eAAeC,UAAUA,CAACrE,QAAgB,EAAE;EAC1C,IAAI;IACF,OAAO,MAAM4D,eAAe,CAAC5D,QAAQ,CAAC;EACxC,CAAC,CAAC,OAAON,KAAU,EAAE;IACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,4BAA4B,IAAID,KAAK,CAACC,IAAI,KAAK,kBAAkB,EAAE;MACpF,OAAO2E,cAAc,CAACtE,QAAQ,CAAC;IACjC,CAAC,MAAM;MACL,MAAMN,KAAK;IACb;EACF;AACF;;AAEA;AACA;AACA;AACA,SAAS4E,cAAcA,CAACtE,QAAgB,EAAE;EACxC,IAAI;IACF,IAAI,CAACE,oBAAoB,CAACF,QAAQ,CAAC,EAAE;MACnC,OAAOnC,OAAO,CAACmC,QAAQ,CAAC;IAC1B;EACF,CAAC,CAAC,OAAON,KAAU,EAAE;IACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,kBAAkB,EAAE;MACrC,MAAMD,KAAK;IACb;IACA;IACA;IACA;EACF;EACA,MAAMC,IAAI,GAAG4E,iBAAE,CAACC,YAAY,CAACxE,QAAQ,EAAE,MAAM,CAAC;EAC9C,OAAOuB,UAAU,CAAC5B,IAAI,EAAEK,QAAQ,CAAC;AACnC","ignoreList":[]}
{"version":3,"file":"load.js","names":["_nodeFs","data","_interopRequireDefault","require","nodeModule","_interopRequireWildcard","_nodePath","_nodeUrl","_codeframe","_transform","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_ts","loadTypescript","undefined","error","code","parent","module","tsExtensionMapping","maybeReadFileSync","filename","fs","readFileSync","toFormat","isLegacy","endsWith","compileModule","opts","format","prependPaths","paths","nodeModulePaths","_nodeModulePaths","path","dirname","mod","assign","Module","_compile","loaded","cache","children","splice","indexOf","hasStripTypeScriptTypes","stripTypeScriptTypes","evalModule","inputCode","inputFilename","diagnostic","ts","ModuleKind","CommonJS","ESNext","Preserve","output","transpileModule","fileName","reportDiagnostics","compilerOptions","moduleResolution","ModuleResolutionKind","Bundler","verbatimModuleSyntax","target","ScriptTarget","newLine","NewLineKind","LineFeed","inlineSourceMap","esModuleInterop","outputText","diagnostics","length","mode","sourceMap","ext","extname","inputExt","join","basename","toCommonJS","exports","diagnosticError","formatDiagnostic","annotateError","requireOrImport","Promise","resolve","isAbsolute","url","pathToFileURL","toString","then","s","loadModule","loadModuleSync","isTypeScript"],"sources":["../src/load.ts"],"sourcesContent":["import fs from 'node:fs';\nimport * as nodeModule from 'node:module';\nimport path from 'node:path';\nimport url from 'node:url';\nimport type * as ts from 'typescript';\n\nimport { annotateError, formatDiagnostic } from './codeframe';\nimport { toCommonJS } from './transform';\n\ndeclare module 'node:module' {\n export function _nodeModulePaths(base: string): readonly string[];\n}\n\ndeclare global {\n namespace NodeJS {\n export interface Module {\n _compile(\n code: string,\n filename: string,\n format?: 'module' | 'commonjs' | 'commonjs-typescript' | 'module-typescript' | 'typescript'\n ): unknown;\n }\n }\n}\n\nlet _ts: typeof import('typescript') | null | undefined;\nfunction loadTypescript() {\n if (_ts === undefined) {\n try {\n _ts = require('typescript');\n } catch (error: any) {\n if (error.code !== 'MODULE_NOT_FOUND') {\n throw error;\n } else {\n _ts = null;\n }\n }\n }\n return _ts;\n}\n\nconst parent = module;\n\nconst tsExtensionMapping: Record<string, string | undefined> = {\n '.ts': '.js',\n '.cts': '.cjs',\n '.mts': '.mjs',\n};\n\nfunction maybeReadFileSync(filename: string) {\n try {\n return fs.readFileSync(filename, 'utf8');\n } catch (error: any) {\n if (error.code === 'ENOENT') {\n return null;\n }\n throw error;\n }\n}\n\ntype Format = 'commonjs' | 'module' | 'module-typescript' | 'commonjs-typescript' | 'typescript';\n\nfunction toFormat(filename: string, isLegacy: true): Format;\nfunction toFormat(filename: string, isLegacy: false): Format | null;\nfunction toFormat(filename: string, isLegacy: boolean): Format | null {\n if (filename.endsWith('.cjs')) {\n return 'commonjs';\n } else if (filename.endsWith('.mjs')) {\n return 'module';\n } else if (filename.endsWith('.js')) {\n return isLegacy ? 'commonjs' : null;\n } else if (filename.endsWith('.mts')) {\n return 'module-typescript';\n } else if (filename.endsWith('.cts')) {\n return 'commonjs-typescript';\n } else if (filename.endsWith('.ts')) {\n return isLegacy ? 'commonjs-typescript' : 'typescript';\n } else {\n return null;\n }\n}\n\nexport interface ModuleOptions {\n paths?: string[];\n}\n\nfunction compileModule(code: string, filename: string, opts: ModuleOptions) {\n const format = toFormat(filename, false);\n const prependPaths = opts.paths ?? [];\n const nodeModulePaths = nodeModule._nodeModulePaths(path.dirname(filename));\n const paths = [...prependPaths, ...nodeModulePaths];\n try {\n const mod = Object.assign(new nodeModule.Module(filename, parent), { filename, paths });\n mod._compile(code, filename, format != null ? format : undefined);\n mod.loaded = true;\n require.cache[filename] = mod;\n parent?.children?.splice(parent.children.indexOf(mod), 1);\n return mod;\n } catch (error: any) {\n delete require.cache[filename];\n throw error;\n }\n}\n\nconst hasStripTypeScriptTypes = typeof nodeModule.stripTypeScriptTypes === 'function';\n\nfunction evalModule(\n code: string,\n filename: string,\n opts: ModuleOptions = {},\n format: Format = toFormat(filename, true)\n) {\n let inputCode = code;\n let inputFilename = filename;\n let diagnostic: ts.Diagnostic | undefined;\n if (\n format === 'typescript' ||\n format === 'module-typescript' ||\n format === 'commonjs-typescript'\n ) {\n const ts = loadTypescript();\n\n if (ts) {\n let module: ts.ModuleKind;\n if (format === 'commonjs-typescript') {\n module = ts.ModuleKind.CommonJS;\n } else if (format === 'module-typescript') {\n module = ts.ModuleKind.ESNext;\n } else {\n // NOTE(@kitten): We can \"preserve\" the output, meaning, it can either be ESM or CJS\n // and stop TypeScript from either transpiling it to CommonJS or adding an `export {}`\n // if no exports are used. This allows the user to choose if this file is CJS or ESM\n // (but not to mix both)\n module = ts.ModuleKind.Preserve;\n }\n const output = ts.transpileModule(code, {\n fileName: filename,\n reportDiagnostics: true,\n compilerOptions: {\n module,\n moduleResolution: ts.ModuleResolutionKind.Bundler,\n // `verbatimModuleSyntax` needs to be off, to erase as many imports as possible\n verbatimModuleSyntax: false,\n target: ts.ScriptTarget.ESNext,\n newLine: ts.NewLineKind.LineFeed,\n inlineSourceMap: true,\n esModuleInterop: true,\n },\n });\n inputCode = output?.outputText || inputCode;\n if (output?.diagnostics?.length) {\n diagnostic = output.diagnostics[0];\n }\n }\n\n if (hasStripTypeScriptTypes && inputCode === code) {\n // This may throw its own error, but this contains a code-frame already\n inputCode = nodeModule.stripTypeScriptTypes(code, {\n mode: 'transform',\n sourceMap: true,\n });\n }\n\n if (inputCode !== code) {\n const ext = path.extname(filename);\n const inputExt = tsExtensionMapping[ext] ?? ext;\n if (inputExt !== ext) {\n inputFilename = path.join(path.dirname(filename), path.basename(filename, ext) + inputExt);\n }\n }\n } else if (format === 'commonjs') {\n inputCode = toCommonJS(filename, code);\n }\n\n try {\n const mod = compileModule(inputCode, inputFilename, opts);\n if (inputFilename !== filename) {\n require.cache[filename] = mod;\n }\n return mod.exports;\n } catch (error: any) {\n // If we have a diagnostic from TypeScript, we issue its error with a codeframe first,\n // since it's likely more useful than the eval error\n const diagnosticError = formatDiagnostic(diagnostic);\n if (diagnosticError) {\n throw diagnosticError;\n }\n throw annotateError(code, filename, error) ?? error;\n }\n}\n\nasync function requireOrImport(filename: string) {\n try {\n return require(filename);\n } catch {\n return await import(\n path.isAbsolute(filename) ? url.pathToFileURL(filename).toString() : filename\n );\n }\n}\n\nasync function loadModule(filename: string) {\n try {\n return await requireOrImport(filename);\n } catch (error: any) {\n if (error.code === 'ERR_UNKNOWN_FILE_EXTENSION' || error.code === 'MODULE_NOT_FOUND') {\n return loadModuleSync(filename);\n } else {\n throw error;\n }\n }\n}\n\n/** Require module or evaluate with TypeScript\n * NOTE: Requiring ESM has been added in all LTS versions (Node 20.19+, 22.12+, 24).\n * This already forms the minimum required Node version as of Expo SDK 54 */\nfunction loadModuleSync(filename: string) {\n const format = toFormat(filename, true);\n const isTypeScript =\n format === 'module-typescript' || format === 'commonjs-typescript' || format === 'typescript';\n try {\n if (format !== 'module' && !isTypeScript) {\n return require(filename);\n }\n } catch (error: any) {\n if (error.code === 'MODULE_NOT_FOUND') {\n throw error;\n } else if (format == null) {\n const code = maybeReadFileSync(filename);\n throw annotateError(code, filename, error) || error;\n }\n // We fallback to always evaluating the entrypoint module\n // This is out of safety, since we're not trusting the requiring ESM feature\n // and evaluating the module manually bypasses the error when it's flagged off\n }\n\n // Load from cache manually, if `loaded` is set and exports are defined, to avoid\n // double transform or double evaluation\n if (require.cache[filename]?.exports && require.cache[filename].loaded) {\n return require.cache[filename].exports;\n }\n\n const code = fs.readFileSync(filename, 'utf8');\n return evalModule(code, filename, {}, format);\n}\n\nexport { evalModule, loadModule, loadModuleSync };\n"],"mappings":";;;;;;;;AAAA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAF,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,C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5E,QAAQ,CAAC;IACjC,CAAC,MAAM;MACL,MAAMN,KAAK;IACb;EACF;AACF;;AAEA;AACA;AACA;AACA,SAASkF,cAAcA,CAAC5E,QAAgB,EAAE;EACxC,MAAMQ,MAAM,GAAGL,QAAQ,CAACH,QAAQ,EAAE,IAAI,CAAC;EACvC,MAAM6E,YAAY,GAChBrE,MAAM,KAAK,mBAAmB,IAAIA,MAAM,KAAK,qBAAqB,IAAIA,MAAM,KAAK,YAAY;EAC/F,IAAI;IACF,IAAIA,MAAM,KAAK,QAAQ,IAAI,CAACqE,YAAY,EAAE;MACxC,OAAOjH,OAAO,CAACoC,QAAQ,CAAC;IAC1B;EACF,CAAC,CAAC,OAAON,KAAU,EAAE;IACnB,IAAIA,KAAK,CAACC,IAAI,KAAK,kBAAkB,EAAE;MACrC,MAAMD,KAAK;IACb,CAAC,MAAM,IAAIc,MAAM,IAAI,IAAI,EAAE;MACzB,MAAMb,IAAI,GAAGI,iBAAiB,CAACC,QAAQ,CAAC;MACxC,MAAM,IAAAiE,0BAAa,EAACtE,IAAI,EAAEK,QAAQ,EAAEN,KAAK,CAAC,IAAIA,KAAK;IACrD;IACA;IACA;IACA;EACF;;EAEA;EACA;EACA,IAAI9B,OAAO,CAACwD,KAAK,CAACpB,QAAQ,CAAC,EAAE8D,OAAO,IAAIlG,OAAO,CAACwD,KAAK,CAACpB,QAAQ,CAAC,CAACmB,MAAM,EAAE;IACtE,OAAOvD,OAAO,CAACwD,KAAK,CAACpB,QAAQ,CAAC,CAAC8D,OAAO;EACxC;EAEA,MAAMnE,IAAI,GAAGM,iBAAE,CAACC,YAAY,CAACF,QAAQ,EAAE,MAAM,CAAC;EAC9C,OAAO0B,UAAU,CAAC/B,IAAI,EAAEK,QAAQ,EAAE,CAAC,CAAC,EAAEQ,MAAM,CAAC;AAC/C","ignoreList":[]}
{
"name": "@expo/require-utils",
"version": "55.0.1",
"version": "55.0.2",
"description": "Reusable require and Node resolution utilities library for Expo",

@@ -39,3 +39,5 @@ "license": "MIT",

"dependencies": {
"@babel/code-frame": "^7.20.0"
"@babel/code-frame": "^7.20.0",
"@babel/core": "^7.25.2",
"@babel/plugin-transform-modules-commonjs": "^7.24.8"
},

@@ -45,2 +47,3 @@ "devDependencies": {

"expo-module-scripts": "^55.0.2",
"memfs": "^3.2.0",
"typescript": "^5.9.2"

@@ -51,3 +54,3 @@ },

},
"gitHead": "22e2ad4afba05b91f833f8cf07a36637748a1f70"
"gitHead": "b183e5cbd95eb6ee54a878291c7077d8d63e4850"
}