MCPcopy Create free account
hub / github.com/observablehq/framework / isImportMetaResolve

Function isImportMetaResolve

src/javascript/imports.ts:110–120  ·  view source on GitHub ↗
(node: CallExpression)

Source from the content-addressed store, hash-verified

108}
109
110export function isImportMetaResolve(node: CallExpression): boolean {
111 return (
112 node.callee.type === "MemberExpression" &&
113 node.callee.object.type === "MetaProperty" &&
114 node.callee.object.meta.name === "import" &&
115 node.callee.object.property.name === "meta" &&
116 node.callee.property.type === "Identifier" &&
117 node.callee.property.name === "resolve" &&
118 node.arguments.length > 0
119 );
120}
121
122export function isJavaScript(path: string): boolean {
123 return /\.(m|c)?js(\?|$)/i.test(path);

Callers 5

rewriteImportMetaResolveFunction · 0.85
findImportMetaResolveFunction · 0.85
transpileModuleFunction · 0.85
CallExpressionFunction · 0.85
findImportMetaResolveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected