Просмотр исходного кода

bootstrap returns single seep if that's the only one

Evan You 12 лет назад
Родитель
Сommit
f5995a5641
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/main.js

+ 1 - 1
src/main.js

@@ -71,7 +71,7 @@ api.bootstrap = function (opts) {
     while (el = document.querySelector(ctrlSlt) || document.querySelector(dataSlt)) {
     while (el = document.querySelector(ctrlSlt) || document.querySelector(dataSlt)) {
         seeds.push(new Seed(el))
         seeds.push(new Seed(el))
     }
     }
-    return seeds
+    return seeds.length > 1 ? seeds : seeds[0]
 }
 }
 
 
 module.exports = api
 module.exports = api