Spaces:
Running
Running
File size: 687 Bytes
1719261 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
'use strict';
var GetIntrinsic = require('get-intrinsic');
var callBindBasic = require('call-bind-apply-helpers');
/** @type {(thisArg: string, searchString: string, position?: number) => number} */
var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
/** @type {import('.')} */
module.exports = function callBoundIntrinsic(name, allowMissing) {
/* eslint no-extra-parens: 0 */
var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
return callBindBasic(/** @type {const} */ ([intrinsic]));
}
return intrinsic;
};
|