MCPcopy Create free account
hub / github.com/babel/babel / isModuleSpecifier

Function isModuleSpecifier

packages/babel-types/src/validators/generated/index.ts:4605–4624  ·  view source on GitHub ↗
(
  node: t.Node | null | undefined,
  opts?: Opts | null,
)

Source from the content-addressed store, hash-verified

4603 opts?: Opts | null,
4604): node is t.ModuleSpecifier & Opts;
4605export function isModuleSpecifier<Opts extends Options<t.ModuleSpecifier>>(
4606 node: t.Node | null | undefined,
4607 opts?: Opts | null,
4608): boolean {
4609 if (!node) return false;
4610
4611 switch (node.type) {
4612 case "ExportSpecifier":
4613 case "ImportDefaultSpecifier":
4614 case "ImportNamespaceSpecifier":
4615 case "ImportSpecifier":
4616 case "ExportNamespaceSpecifier":
4617 case "ExportDefaultSpecifier":
4618 break;
4619 default:
4620 return false;
4621 }
4622
4623 return opts == null || shallowEqual(node, opts);
4624}
4625export function isPrivate(node: t.Node | null | undefined): node is t.Private;
4626export function isPrivate<Opts extends Options<t.Private>>(
4627 node: t.Node | null | undefined,

Callers 1

gatherNodePartsFunction · 0.90

Calls 1

shallowEqualFunction · 0.85

Tested by

no test coverage detected