Pibd-21_Alekseev_I.S._Inter.../IP/node_modules/call-bind/callBound.js
VanyaAlekseev ccc3e790bb lab2
2023-12-03 16:59:28 +04:00

16 lines
413 B
JavaScript

'use strict';
var GetIntrinsic = require('get-intrinsic');
var callBind = require('./');
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
module.exports = function callBoundIntrinsic(name, allowMissing) {
var intrinsic = GetIntrinsic(name, !!allowMissing);
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
return callBind(intrinsic);
}
return intrinsic;
};