Updating package.json to include Mocha.
This commit is contained in:
parent
54da8c6b65
commit
cfb2c3c08b
|
@ -12,7 +12,8 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^2.0.0",
|
"chai": "^2.0.0",
|
||||||
"mocha": "^2.1.0",
|
"mocha": "^2.1.0",
|
||||||
"coffeelint": "1.9.*"
|
"coffeelint": "1.9.*",
|
||||||
|
"mocha-jenkins-reporter": "^0.1.7"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "make test",
|
"test": "make test",
|
||||||
|
|
|
@ -15,7 +15,6 @@ reduce = (lst, iteratee, memo, context) ->
|
||||||
null
|
null
|
||||||
memo
|
memo
|
||||||
|
|
||||||
|
|
||||||
map = (lst, iteratee, context, count = 0) ->
|
map = (lst, iteratee, context, count = 0) ->
|
||||||
return nil if nilp lst
|
return nil if nilp lst
|
||||||
product = iteratee.call(context, (car lst), count, lst)
|
product = iteratee.call(context, (car lst), count, lst)
|
||||||
|
@ -25,18 +24,20 @@ map = (lst, iteratee, context, count = 0) ->
|
||||||
|
|
||||||
rmap = (lst, iteratee, context, count = 0) ->
|
rmap = (lst, iteratee, context, count = 0) ->
|
||||||
return nil if nilp lst
|
return nil if nilp lst
|
||||||
product = (if (nilp cdr lst) then nil else
|
rest = (if (nilp cdr lst) then nil else
|
||||||
map((cdr lst), iteratee, context, count + 1))
|
map((cdr lst), iteratee, context, count + 1))
|
||||||
cons product, iteratee.call(context, (car lst), count, lst)
|
product = iteratee.call(context, (car lst), count, lst)
|
||||||
|
cons rest, product
|
||||||
|
|
||||||
|
reverse = (lst) -> rmap lst, (i) -> i
|
||||||
|
|
||||||
filter = (lst, iteratee, context) ->
|
filter = (lst, iteratee, context) ->
|
||||||
return nil if nilp lst
|
return nil if nilp lst
|
||||||
if iteratee.call(context, (car lst), lst)
|
if iteratee.call(context, (car lst), lst)
|
||||||
cons (car lst), filter (cdr lst)
|
cons (car lst), filter (cdr lst), iteratee, context
|
||||||
else
|
else
|
||||||
filter (cdr list)
|
filter (cdr list), iteratee, context
|
||||||
|
|
||||||
reverse = (lst) -> rmap lst, (i) -> i
|
|
||||||
|
|
||||||
module.exports =
|
module.exports =
|
||||||
reduce: reduce
|
reduce: reduce
|
||||||
|
|
Loading…
Reference in New Issue