From 78cf07767a9242ba318d8f3a0b281f27afe992ba Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Fri, 19 Mar 2021 10:50:52 -0400 Subject: [PATCH] Remove `lodash/has` (#13023) --- lib/third-party-libs.js.flow | 4 ---- packages/babel-helper-define-map/package.json | 3 +-- packages/babel-helper-define-map/src/index.js | 3 ++- yarn.lock | 1 - 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/third-party-libs.js.flow b/lib/third-party-libs.js.flow index fb405b854c..6c1c06f1d4 100644 --- a/lib/third-party-libs.js.flow +++ b/lib/third-party-libs.js.flow @@ -22,10 +22,6 @@ declare module "json5" { }; } -declare module "lodash/defaults" { - declare export default (T, Object) => T; -} - declare module "lodash/clone" { declare export default (obj: T) => T; } diff --git a/packages/babel-helper-define-map/package.json b/packages/babel-helper-define-map/package.json index 832448bc2e..8e51f2c565 100644 --- a/packages/babel-helper-define-map/package.json +++ b/packages/babel-helper-define-map/package.json @@ -15,7 +15,6 @@ "main": "lib/index.js", "dependencies": { "@babel/helper-function-name": "workspace:^7.12.13", - "@babel/types": "workspace:^7.12.13", - "lodash": "^4.17.19" + "@babel/types": "workspace:^7.12.13" } } diff --git a/packages/babel-helper-define-map/src/index.js b/packages/babel-helper-define-map/src/index.js index ce8322f6ec..290a50c202 100644 --- a/packages/babel-helper-define-map/src/index.js +++ b/packages/babel-helper-define-map/src/index.js @@ -1,5 +1,4 @@ import nameFunction from "@babel/helper-function-name"; -import has from "lodash/has"; import * as t from "@babel/types"; function toKind(node: Object) { @@ -12,6 +11,8 @@ function toKind(node: Object) { return "value"; } +const has = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + export function push( mutatorMap: Object, node: Object, diff --git a/yarn.lock b/yarn.lock index 426d5af549..f503848d1a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -490,7 +490,6 @@ __metadata: dependencies: "@babel/helper-function-name": "workspace:^7.12.13" "@babel/types": "workspace:^7.12.13" - lodash: ^4.17.19 languageName: unknown linkType: soft