From cfaa162fd964d5fdd489909dd81c55301d2fac73 Mon Sep 17 00:00:00 2001 From: Dan Bryant Date: Tue, 21 Feb 2023 16:20:43 -0800 Subject: [PATCH 1/2] migrate to isImportOrExportDeclaration --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 92bae38..ee9abc1 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import _ from 'lodash' -import { isModuleDeclaration } from '@babel/types' +import { isImportOrExportDeclaration } 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 (isImportOrExportDeclaration(node)) { isModule = true break } From 1b0915d7fc4d0e79b2056027de086996d7fc4cdc Mon Sep 17 00:00:00 2001 From: Dan Bryant Date: Wed, 22 Feb 2023 13:36:16 -0800 Subject: [PATCH 2/2] bum babel/types as per request: https://github.com/lodash/babel-plugin-lodash/pull/260#issuecomment-1440349057 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index adb1028..02d35e9 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "@babel/helper-module-imports": "^7.0.0", - "@babel/types": "^7.0.0", + "@babel/types": "^7.21.0", "glob": "^7.1.1", "lodash": "^4.17.10", "require-package-name": "^2.0.1"