|
1 | 1 | /* eslint-disable no-use-before-define */
|
2 |
| -import { isEmpty, without, pickBy, omitBy, uniq, includes, keys } from "lodash"; |
| 2 | +import { isEmpty, pickBy, omitBy, uniq, keys } from "lodash"; |
3 | 3 | import type { EventMixinCalculatedValues } from "./add-events";
|
4 | 4 | import { isFunction } from "./helpers";
|
5 | 5 |
|
@@ -50,7 +50,7 @@ export function getEvents(
|
50 | 50 | const targetEvents = events.reduce((memo, event) => {
|
51 | 51 | if (event.target !== undefined) {
|
52 | 52 | const matchesTarget = Array.isArray(event.target)
|
53 |
| - ? includes(event.target, target) |
| 53 | + ? event.target.includes(target) |
54 | 54 | : `${event.target}` === `${target}`;
|
55 | 55 | return matchesTarget ? memo.concat(event) : memo;
|
56 | 56 | }
|
@@ -157,8 +157,8 @@ export function getScopedEvents(
|
157 | 157 | }
|
158 | 158 | if (eventReturn.eventKey === "all") {
|
159 | 159 | return newBaseProps[childName]
|
160 |
| - ? without(keys(newBaseProps[childName]), "parent") |
161 |
| - : without(keys(newBaseProps), "parent"); |
| 160 | + ? keys(newBaseProps[childName]).filter((value) => value !== "parent") |
| 161 | + : keys(newBaseProps).filter((value) => value !== "parent"); |
162 | 162 | } else if (eventReturn.eventKey === undefined && eventKey === "parent") {
|
163 | 163 | return newBaseProps[childName]
|
164 | 164 | ? keys(newBaseProps[childName])
|
@@ -233,7 +233,9 @@ export function getScopedEvents(
|
233 | 233 |
|
234 | 234 | // returns an entire mutated state for all children
|
235 | 235 | const allChildNames =
|
236 |
| - childNames === "all" ? without(keys(newBaseProps), "parent") : childNames; |
| 236 | + childNames === "all" |
| 237 | + ? keys(newBaseProps).filter((value) => value !== "parent") |
| 238 | + : childNames; |
237 | 239 | return Array.isArray(allChildNames)
|
238 | 240 | ? allChildNames.reduce((memo, childName) => {
|
239 | 241 | return Object.assign(memo, getReturnByChild(childName));
|
@@ -438,7 +440,7 @@ export function getExternalMutation(
|
438 | 440 | } else if (Array.isArray(mutation[type])) {
|
439 | 441 | // coerce arrays to strings before matching
|
440 | 442 | const stringArray = mutation[type].map((m) => `${m}`);
|
441 |
| - return includes(stringArray, identifier[type]); |
| 443 | + return stringArray.includes(identifier[type]); |
442 | 444 | }
|
443 | 445 | return false;
|
444 | 446 | };
|
|
0 commit comments