用工小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
667 B

2 months ago
  1. 'use strict';
  2. var GetIntrinsic = require('get-intrinsic');
  3. var callBindBasic = require('call-bind-apply-helpers');
  4. /** @type {(thisArg: string, searchString: string, position?: number) => number} */
  5. var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
  6. /** @type {import('.')} */
  7. module.exports = function callBoundIntrinsic(name, allowMissing) {
  8. // eslint-disable-next-line no-extra-parens
  9. var intrinsic = /** @type {Parameters<typeof callBindBasic>[0][0]} */ (GetIntrinsic(name, !!allowMissing));
  10. if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
  11. return callBindBasic([intrinsic]);
  12. }
  13. return intrinsic;
  14. };