Permalink
Browse files

Remove silly magic, always return an array, even when single

Fixes #44

Currently the recess() method returns a single object if you only call it with one file and an array of objects if you call it with multiple. This is bad practice and in this case it should always return an array, even with only one item.
  • Loading branch information...
1 parent a4a41ab commit 87cb3ce309703a71e5f40d5154bb03823c0003d3 @sindresorhus sindresorhus committed Sep 11, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 lib/index.js
  2. +2 −2 test/types/compile.js
View
@@ -59,7 +59,7 @@ module.exports = function (paths, options, callback) {
err = err.length ? err[0] : null
//callback
- callback && callback(err, instances.length > 1 ? instances : instances[0])
+ callback && callback(err, instances)
}
// start processing paths
@@ -12,9 +12,9 @@ fs.readdirSync('test/fixtures').forEach(function (file, index) {
RECESS('test/fixtures/' + file, { compile: true, inlineImages: true }, function (err, fat) {
file = file.replace(/less$/, 'css')
assert.ok(err == null)
- assert.ok(fat.output[0] == fs.readFileSync('test/compiled/' + file, 'utf-8'))
+ assert.ok(fat[0].output[0] == fs.readFileSync('test/compiled/' + file, 'utf-8'))
})
})
-console.log("✓ compiling".green)
+console.log("✓ compiling".green)

0 comments on commit 87cb3ce

Please sign in to comment.