diff options
author | 迷渡 <justjavac@gmail.com> | 2019-09-03 15:10:05 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-09-03 03:10:05 -0400 |
commit | 9533a030f34097d5ae91c0fd9009578b3932bbea (patch) | |
tree | db4fa9f7474cecbc08048eca8e7c26a87b80d61e /multipart/formfile.ts | |
parent | dd6db011e3a93f508f49ce1de84962a4ca23c587 (diff) |
Avoid prototype builtin `hasOwnProperty` (denoland/deno_std#577)
Original: https://github.com/denoland/deno_std/commit/d36bff3fbe22a3585d23213e3f4c9f58756c032b
Diffstat (limited to 'multipart/formfile.ts')
-rw-r--r-- | multipart/formfile.ts | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/multipart/formfile.ts b/multipart/formfile.ts index 592f4e529..a0e721a15 100644 --- a/multipart/formfile.ts +++ b/multipart/formfile.ts @@ -1,4 +1,5 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. +import { hasOwnProperty } from "../util/has_own_property.ts"; /** FormFile object */ export interface FormFile { @@ -19,9 +20,5 @@ export interface FormFile { /** Type guard for FormFile */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function isFormFile(x: any): x is FormFile { - return ( - typeof x === "object" && - x.hasOwnProperty("filename") && - x.hasOwnProperty("type") - ); + return hasOwnProperty(x, "filename") && hasOwnProperty(x, "type"); } |