MCPcopy Create free account
hub / github.com/reactjs/react-docgen / constructor

Method constructor

packages/react-docgen/src/FileState.ts:41–58  ·  view source on GitHub ↗
(
    options: TransformOptions,
    { code, ast, importer }: { code: string; ast: File; importer: Importer },
  )

Source from the content-addressed store, hash-verified

39 };
40
41 constructor(
42 options: TransformOptions,
43 { code, ast, importer }: { code: string; ast: File; importer: Importer },
44 ) {
45 this.opts = options;
46 this.code = code;
47 this.ast = ast;
48 this.#importer = importer;
49
50 this.path = NodePath.get({
51 hub: this.hub,
52 parentPath: null,
53 parent: this.ast,
54 container: this.ast,
55 key: 'program',
56 }).setContext() as NodePath<Program>;
57 this.scope = this.path.scope;
58 }
59
60 /**
61 * Try to resolve and import the ImportPath with the `name`

Callers

nothing calls this directly

Calls 1

getMethod · 0.80

Tested by

no test coverage detected