mirror of
https://github.com/cp6/my-idlers.git
synced 2024-11-16 23:42:32 +01:00
fd22b0bf58
V2 (Laravel re-make)
16 lines
413 B
JavaScript
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;
|
|
};
|