Const defaultApi
defaultApi: object & object = Object.assign(makeApi(defaultRuntimeState, {fakeFs: dynamicFsLayer,pnpapiResolution: defaultPnpapiResolution,}), {/*** Can be used to generate a different API than the default one (for example* to map it on `/` rather than the local directory path, or to use a* different FS layer than the default one).*/makeApi: ({basePath = undefined,fakeFs = dynamicFsLayer,pnpapiResolution = defaultPnpapiResolution,...rest}: Partial<MakeApiOptions> & {basePath?: NativePath}) => {const apiRuntimeState = typeof basePath !== `undefined`? $$SETUP_STATE(hydrateRuntimeState, basePath): defaultRuntimeState;return makeApi(apiRuntimeState, {fakeFs,pnpapiResolution,...rest,});},/*** Will inject the specified API into the environment, monkey-patching FS. Is* automatically called when the hook is loaded through `--require`.*/setup: (api?: PnpApi) => {applyPatch(api || defaultApi, {fakeFs: defaultFsLayer,manager,});// Now that the `fs` module is patched we can swap the `baseFs` to// a NodeFS with a live `fs` binding to pick up changes to the `fs`// module allowing users to patch itdynamicFsLayer.baseFs = new NodeFS(fs);},})
Returns the module that should be used to resolve require calls. It's usually the direct parent, except if we're inside an eval expression.