UNPKG

disposablestack

Version:

An ESnext spec-compliant `DisposableStack`, `AsyncDisposableStack`, `Symbol.dispose`, and `Symbol.asyncDispose` shim/polyfill/replacement that works as far down as ES3.

15 lines (12 loc) 441 B
'use strict'; var $Object = Object; module.exports = function isDisposeCapabilityRecord(x) { return x && typeof x === 'object' && ( typeof x['[[ResourceValue]]'] === 'undefined' || ($Object(x['[[ResourceValue]]']) === x['[[ResourceValue]]']) ) && (x['[[Hint]]'] === 'SYNC-DISPOSE' || x['[[Hint]]'] === 'ASYNC-DISPOSE') && (typeof x['[[DisposeMethod]]'] === 'function' || typeof x['[[DisposeMethod]]'] === 'undefined'); };