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) • 423 B
JavaScript
;
var GetIntrinsic = require('get-intrinsic');
var oDP = GetIntrinsic('%Object.defineProperty%', true);
var getPolyfill = require('./polyfill');
module.exports = function shimSearch() {
var polyfill = getPolyfill();
if (polyfill && polyfill !== Symbol.search) {
oDP(Symbol, 'search', {
configurable: false,
enumerable: false,
value: polyfill,
writable: false
});
}
return polyfill;
};