From ce72b71f3f94f649551176878676923b3bdac028 Mon Sep 17 00:00:00 2001 From: Adam Mcgrath Date: Tue, 25 Jul 2023 11:23:35 +0100 Subject: [PATCH] Fix edge tests --- __mocks__/lodash/isPlainObject.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 __mocks__/lodash/isPlainObject.js diff --git a/__mocks__/lodash/isPlainObject.js b/__mocks__/lodash/isPlainObject.js new file mode 100644 index 000000000..ac4fb3ffb --- /dev/null +++ b/__mocks__/lodash/isPlainObject.js @@ -0,0 +1,12 @@ +'use strict'; + +// From https://github.com/sindresorhus/is-plain-obj/blob/v2.1.0/index.js +// As this one is more permissive and works on Edge runtime +module.exports = (value) => { + if (Object.prototype.toString.call(value) !== '[object Object]') { + return false; + } + + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.prototype; +};