From d527bd0ede9e0e4be1043ac24c1481c0822441db Mon Sep 17 00:00:00 2001 From: Luca Ban Date: Mon, 5 Mar 2018 14:14:07 +0900 Subject: [PATCH 1/2] better readability --- .verb.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.verb.md b/.verb.md index 9b5df34..c6594ef 100644 --- a/.verb.md +++ b/.verb.md @@ -5,14 +5,16 @@ Sort an array by the given object property: ```js var arraySort = require('{%= name %}'); -arraySort([{foo: 'y'}, {foo: 'z'}, {foo: 'x'}], 'foo'); +var arr = [{foo: 'y'}, {foo: 'z'}, {foo: 'x'}]; +arraySort(arr, 'foo'); //=> [{foo: 'x'}, {foo: 'y'}, {foo: 'z'}] ``` **Reverse order** ```js -arraySort([{foo: 'y'}, {foo: 'z'}, {foo: 'x'}], 'foo', {reverse: true}); +var arr = [{foo: 'y'}, {foo: 'z'}, {foo: 'x'}]; +arraySort(arr, 'foo', {reverse: true}); //=> [{foo: 'z'}, {foo: 'y'}, {foo: 'x'}] ``` From 0adaf54823612f861006657fc820814aedda3800 Mon Sep 17 00:00:00 2001 From: Luca Ban Date: Tue, 6 Mar 2018 00:19:28 +0900 Subject: [PATCH 2/2] added ES6 import method to README --- .verb.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.verb.md b/.verb.md index c6594ef..13143a4 100644 --- a/.verb.md +++ b/.verb.md @@ -4,6 +4,8 @@ Sort an array by the given object property: ```js var arraySort = require('{%= name %}'); +// or for ES6 imports: +import arraySort from 'array-sort' var arr = [{foo: 'y'}, {foo: 'z'}, {foo: 'x'}]; arraySort(arr, 'foo');