mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-09-01 19:22:35 +02:00
Use optional argument in memoize-util benchmark
This commit is contained in:
@@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user