diff --git a/README.md b/README.md index d65b01f..ac4ac87 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,8 @@ Options: ## OrderBy +Order elements in Array by name of property, default is 'asc', a '-' of the name is 'desc'. + Basic Usage: ``` diff --git a/test/orderBy.js b/test/orderBy.js index 7852e78..72c2850 100644 --- a/test/orderBy.js +++ b/test/orderBy.js @@ -14,11 +14,11 @@ describe('OrderBy', function () { ] const data = orderBy(options, [ - { index: 0 }, - { index: 1 }, - { index: 2 }, { index: 3 }, - { index: 4 } + { index: 1 }, + { index: 0 }, + { index: 4 }, + { index: 2 } ]) assert.equal(data[0].index, 4) @@ -31,11 +31,11 @@ describe('OrderBy', function () { ] const data = orderBy(options, [ - { index: 0 }, - { index: 1 }, - { index: 2 }, { index: 3 }, - { index: 4 } + { index: 1 }, + { index: 0 }, + { index: 4 }, + { index: 2 } ]) assert.equal(data[0].index, 0)