版博士V2.0程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

14 lignes
260 B

  1. function normalizer(config) {
  2. if (typeof config === 'string') {
  3. return { module: config };
  4. }
  5. return config;
  6. }
  7. module.exports = function (config) {
  8. if (Array.isArray(config)) {
  9. return config.map(normalizer);
  10. }
  11. return normalizer(config);
  12. };