massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / is-forced.js
1 var fails = require('../internals/fails');
2 var isCallable = require('../internals/is-callable');
3
4 var replacement = /#|\.prototype\./;
5
6 var isForced = function (feature, detection) {
7   var value = data[normalize(feature)];
8   return value == POLYFILL ? true
9     : value == NATIVE ? false
10     : isCallable(detection) ? fails(detection)
11     : !!detection;
12 };
13
14 var normalize = isForced.normalize = function (string) {
15   return String(string).replace(replacement, '.').toLowerCase();
16 };
17
18 var data = isForced.data = {};
19 var NATIVE = isForced.NATIVE = 'N';
20 var POLYFILL = isForced.POLYFILL = 'P';
21
22 module.exports = isForced;