UNPKG

well-known-symbols

Version:

An ESnext spec-compliant shim/polyfill/replacement for all Well-Known Symbols that works in any environment with Symbols.

23 lines (16 loc) 420 B
'use strict'; var GetIntrinsic = require('get-intrinsic'); var oDP = GetIntrinsic('%Object.defineProperty%', true); var getPolyfill = require('./polyfill'); module.exports = function shimMatch() { var polyfill = getPolyfill(); if (polyfill && polyfill !== Symbol.match) { oDP(Symbol, 'match', { configurable: false, enumerable: false, value: polyfill, writable: false }); } return polyfill; };