From fbb503396bfda85e255a2adb3711c44ff1544c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20W=C3=A4rting?= Date: Thu, 30 Sep 2021 15:07:23 +0200 Subject: [PATCH] fix: null check on hasInstance (#137) --- esm.min.js | 2 +- test/test-esm.js | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/esm.min.js b/esm.min.js index 06d235a..745ca29 100644 --- a/esm.min.js +++ b/esm.min.js @@ -18,7 +18,7 @@ export const FormData = class FormData { constructor(...a){if(a.length)throw new TypeError(`Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.`)} get [t]() {return 'FormData'} [i](){return this.entries()} -static [h](o) {return typeof o==='object'&&o[t]==='FormData'&&!m.some(m=>typeof o[m]!='function')} +static [h](o) {return o&&typeof o==='object'&&o[t]==='FormData'&&!m.some(m=>typeof o[m]!='function')} append(...a){x('append',arguments,2);this.#d.push(f(...a))} delete(a){x('delete',arguments,1);a+='';this.#d=this.#d.filter(([b])=>b!==a)} get(a){x('get',arguments,1);a+='';for(var b=this.#d,l=b.length,c=0;c