From c1da2ed6674b98fed1d7ca3bbe6f21f336862aae Mon Sep 17 00:00:00 2001 From: Pearce Date: Sat, 11 Mar 2023 12:54:17 -0800 Subject: [PATCH] Replace deprecated method with recommended replacements --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 92bae38..2360251 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import _ from 'lodash' -import { isModuleDeclaration } from '@babel/types' +import { isImportDeclaration, isExportDeclaration } from '@babel/types' import config from './config' import importModule from './importModule' @@ -72,7 +72,7 @@ export default function lodash({ types }) { let isModule = false for (const node of file.ast.program.body) { - if (isModuleDeclaration(node)) { + if (isImportDeclaration(node) || isExportDeclaration(node)) { isModule = true break }