From 65e692bce648af1b757953879593ab120fdd5a84 Mon Sep 17 00:00:00 2001 From: Vladimir Gorej Date: Wed, 7 Jul 2021 12:23:04 +0200 Subject: [PATCH] feat: use globalThis to assign/access FormData BREAKING CHANGE: globalThis is a new standardized way how to access global object. This commit is a breaking change for older node.js and browser versions not supporting this standard. It allows us to use this libraries in different contexts: node.js, worker, window, frames. More info: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis --- lib/browser.js | 2 +- lib/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/browser.js b/lib/browser.js index 8b4c9fa..792d6dc 100644 --- a/lib/browser.js +++ b/lib/browser.js @@ -1 +1 @@ -module.exports = window.FormData +module.exports = globalThis.FormData diff --git a/lib/index.js b/lib/index.js index fd2c197..e505b09 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1 +1 @@ -global.FormData = module.exports = require('form-data') +globalThis.FormData = module.exports = require('form-data')