{"version":3,"file":"ESMxCJSHelpers.mjs","names":[],"sources":["../../../src/utils/ESMxCJSHelpers.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport { getPackageJsonPath } from './getPackageJsonPath';\n\nexport const isESModule = typeof import.meta.url === 'string';\n\n/**\n * Require relative to the user project\n *\n * Note: Can resolve package that are installed in the user project, ex `'intlayer'`\n */\nexport const getProjectRequire = (startDir?: string): NodeJS.Require => {\n  // Can fail on VSCode extensions\n  const { packageJsonPath } = getPackageJsonPath(startDir);\n\n  return createRequire(packageJsonPath);\n};\n\n/**\n * Require relative to the @intlayer/config package\n *\n * Note: Can resolve package that are installed in the config package, ex `'@intlayer/types'`\n */\nexport const configESMxCJSRequire: NodeJS.Require = isESModule\n  ? createRequire(import.meta.url)\n  : require;\n"],"mappings":";;;;;AAGA,MAAa,aAAa,OAAO,OAAO,KAAK,QAAQ;;;;;;AAOrD,MAAa,qBAAqB,aAAsC;CAEtE,MAAM,EAAE,oBAAoB,mBAAmB,SAAS;AAExD,QAAO,cAAc,gBAAgB;;;;;;;AAQvC,MAAa,uBAAuC,aAChD,cAAc,OAAO,KAAK,IAAI"}