Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
533 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var arrayIncludes = require('../array/virtual/includes');
|
---|
| 2 | var stringIncludes = require('../string/virtual/includes');
|
---|
| 3 |
|
---|
| 4 | var ArrayPrototype = Array.prototype;
|
---|
| 5 | var StringPrototype = String.prototype;
|
---|
| 6 |
|
---|
| 7 | module.exports = function (it) {
|
---|
| 8 | var own = it.includes;
|
---|
| 9 | if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.includes)) return arrayIncludes;
|
---|
| 10 | if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) {
|
---|
| 11 | return stringIncludes;
|
---|
| 12 | } return own;
|
---|
| 13 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.