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:
479 bytes
|
Line | |
---|
1 | var arrayAt = require('../array/virtual/at');
|
---|
2 | var stringAt = require('../string/virtual/at');
|
---|
3 |
|
---|
4 | var ArrayPrototype = Array.prototype;
|
---|
5 | var StringPrototype = String.prototype;
|
---|
6 |
|
---|
7 | module.exports = function (it) {
|
---|
8 | var own = it.at;
|
---|
9 | if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.at)) return arrayAt;
|
---|
10 | if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.at)) {
|
---|
11 | return stringAt;
|
---|
12 | } return own;
|
---|
13 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.