main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
667 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var GetIntrinsic = require('get-intrinsic');
|
---|
4 |
|
---|
5 | var callBindBasic = require('call-bind-apply-helpers');
|
---|
6 |
|
---|
7 | /** @type {(thisArg: string, searchString: string, position?: number) => number} */
|
---|
8 | var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
|
---|
9 |
|
---|
10 | /** @type {import('.')} */
|
---|
11 | module.exports = function callBoundIntrinsic(name, allowMissing) {
|
---|
12 | // eslint-disable-next-line no-extra-parens
|
---|
13 | var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic(name, !!allowMissing));
|
---|
14 | if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
---|
15 | return callBindBasic([intrinsic]);
|
---|
16 | }
|
---|
17 | return intrinsic;
|
---|
18 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.