Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
573 bytes
|
Line | |
---|
1 | var fails = require('../internals/fails');
|
---|
2 |
|
---|
3 | var replacement = /#|\.prototype\./;
|
---|
4 |
|
---|
5 | var isForced = function (feature, detection) {
|
---|
6 | var value = data[normalize(feature)];
|
---|
7 | return value == POLYFILL ? true
|
---|
8 | : value == NATIVE ? false
|
---|
9 | : typeof detection == 'function' ? fails(detection)
|
---|
10 | : !!detection;
|
---|
11 | };
|
---|
12 |
|
---|
13 | var normalize = isForced.normalize = function (string) {
|
---|
14 | return String(string).replace(replacement, '.').toLowerCase();
|
---|
15 | };
|
---|
16 |
|
---|
17 | var data = isForced.data = {};
|
---|
18 | var NATIVE = isForced.NATIVE = 'N';
|
---|
19 | var POLYFILL = isForced.POLYFILL = 'P';
|
---|
20 |
|
---|
21 | module.exports = isForced;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.