odin-javascript-exercises/node_modules/is-builtin-module/index.js
2017-12-15 12:56:14 -06:00

10 lines
225 B
JavaScript

'use strict';
var builtinModules = require('builtin-modules');
module.exports = function (str) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}
return builtinModules.indexOf(str) !== -1;
};