1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-09-02 11:42:53 +02:00

Use optional argument in memoize-util benchmark

This commit is contained in:
Soreine
2016-11-02 17:23:30 +01:00
parent 85ebf7fffa
commit a4460354c6
2 changed files with 3 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ const { default: memoize } = require('../../../lib/utils/memoize')
module.exports = { module.exports = {
setup(state) { setup(state) {
let obj = { let obj = {
fibonacci(n) { fibonacci(n = 20) {
if (n === 0 || n === 1) { if (n === 0 || n === 1) {
return n return n
} else { } else {
@@ -17,6 +17,6 @@ module.exports = {
}, },
run(obj) { run(obj) {
obj.fibonacci(20) obj.fibonacci()
} }
} }

View File

@@ -179,6 +179,7 @@ const Node = {
/** /**
* Recursively filter all descendant nodes with `iterator`, depth-first. * Recursively filter all descendant nodes with `iterator`, depth-first.
* It is different from `filterDescendants` in regard of the order of results.
* *
* @param {Function} iterator * @param {Function} iterator
* @return {List} nodes * @return {List} nodes