Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Aug 21, 2024
1 parent 217486a commit d103a57
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions libs/langchain-scripts/src/build_v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,7 @@ function listEntrypoints(packageJson: Record<string, any>) {
const checkAllowSideEffects = async (entrypoint: string): Promise<boolean> => {
let entrypointContent: Buffer | undefined;
try {
entrypointContent = await fs.promises.readFile(
`./dist/${entrypoint}.js`
);
entrypointContent = await fs.promises.readFile(`./dist/${entrypoint}.js`);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (e: any) {
if (e.message.includes("ENOENT")) {
Expand Down Expand Up @@ -541,8 +539,11 @@ async function checkTreeShaking(config: LangChainConfig) {
let hasUnexpectedSideEffects = sideEffects.length > 0;
if (hasUnexpectedSideEffects) {
// Map the entrypoint back to the actual file entrypoint using the LangChainConfig file
const actualEntrypoint = config.entrypoints[entrypoint.replace(/^\.\/|\.js$/g, "")];
hasUnexpectedSideEffects = !(await checkAllowSideEffects(actualEntrypoint));
const actualEntrypoint =
config.entrypoints[entrypoint.replace(/^\.\/|\.js$/g, "")];
hasUnexpectedSideEffects = !(await checkAllowSideEffects(
actualEntrypoint
));
}
reportMap.set(entrypoint, {
log: sideEffects,
Expand Down

0 comments on commit d103a57

Please sign in to comment.