Skip to content

Commit

Permalink
Workaround issue with hasOwnProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverJAsh committed Apr 15, 2021
1 parent 6a38637 commit 8718afe
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ export const isLeft = <E, A>(ma: Either<E, A>): ma is Left<E> => ma._tag === 'Le
// Record
// -------------------------------------------------------------------------------------

/** @internal */
export const hasOwnProperty = Object.prototype.hasOwnProperty
const _hasOwnProperty = Object.prototype.hasOwnProperty

/**
* This wrapper is needed to workaround https://github.com/gcanti/fp-ts/issues/1249.
*
* @internal
*/
export function hasOwnProperty(this: any, k: string, r?: object) {
/* istanbul ignore next */
return _hasOwnProperty.call(r === undefined ? this : r, k)
}

// -------------------------------------------------------------------------------------
// NonEmptyArray
Expand Down

0 comments on commit 8718afe

Please sign in to comment.