版博士V2.0程序
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
461 B

  1. module.exports = function (opts) {
  2. opts = opts || {};
  3. var configName = opts.configName;
  4. var extensions = opts.extensions;
  5. if (!configName) {
  6. throw new Error('Please specify a configName.');
  7. }
  8. if (configName instanceof RegExp) {
  9. return [configName];
  10. }
  11. if (!Array.isArray(extensions)) {
  12. throw new Error('Please provide an array of valid extensions.');
  13. }
  14. return extensions.map(function (ext) {
  15. return configName + ext;
  16. });
  17. };