项目原始demo,不改动
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。
 
 
 
 

17 行
425 B

  1. 'use strict';
  2. var inspect = require('util').inspect;
  3. module.exports = function isResolvable(moduleId, options) {
  4. if (typeof moduleId !== 'string') {
  5. throw new TypeError(inspect(moduleId) + ' is not a string. Expected a valid Node.js module identifier (<string>), for example \'eslint\', \'./index.js\', \'./lib\'.');
  6. }
  7. try {
  8. require.resolve(moduleId, options);
  9. return true;
  10. } catch (err) {
  11. return false;
  12. }
  13. };