diff --git a/packages/external-helpers/lib/external-helpers.js b/packages/external-helpers/lib/external-helpers.js index 55150bfbe12..918f73a475d 100644 --- a/packages/external-helpers/lib/external-helpers.js +++ b/packages/external-helpers/lib/external-helpers.js @@ -111,3 +111,9 @@ export function possibleConstructorReturn(self, call) { } return assertThisInitialized(self); } + +export function objectDestructuringEmpty(obj) { + if (DEBUG && (obj === null || obj === undefined)) { + throw new TypeError('Cannot destructure undefined'); + } +}