diff --git a/packages/external-helpers/lib/external-helpers.js b/packages/external-helpers/lib/external-helpers.js index 004952f2c50..d35559e4424 100644 --- a/packages/external-helpers/lib/external-helpers.js +++ b/packages/external-helpers/lib/external-helpers.js @@ -85,3 +85,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'); + } +}