main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
607 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 2 | var isPrototypeOf = require('../../internals/object-is-prototype-of');
|
---|
| 3 | var arrayMethod = require('../array/virtual/at');
|
---|
| 4 | var stringMethod = require('../string/virtual/at');
|
---|
| 5 |
|
---|
| 6 | var ArrayPrototype = Array.prototype;
|
---|
| 7 | var StringPrototype = String.prototype;
|
---|
| 8 |
|
---|
| 9 | module.exports = function (it) {
|
---|
| 10 | var own = it.at;
|
---|
| 11 | if (it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.at)) return arrayMethod;
|
---|
| 12 | if (typeof it == 'string' || it === StringPrototype || (isPrototypeOf(StringPrototype, it) && own === StringPrototype.at)) {
|
---|
| 13 | return stringMethod;
|
---|
| 14 | } return own;
|
---|
| 15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.