From b04e7d150db05dad7adf426f5c3fc27295accd48 Mon Sep 17 00:00:00 2001 From: "nathan.schwarz@epitech.eu" Date: Tue, 5 Sep 2017 12:13:38 +0200 Subject: [PATCH 01/10] added the --key || key option --- README.md | 5 +++-- cmd.js | 19 +++++++++++++++++-- index.js | 23 ++++++++++++++++++----- package-lock.json | 37 +++++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 package-lock.json diff --git a/README.md b/README.md index 3f91b3a..160337d 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,9 @@ var copy = sortJson(object); CLI usage --------- `sort-json file.json` - -For now sort-json takes no other arguments, so the original file will be overwritten by a sorted JSON file, keeping the indentation of the original file. +or if you want to sort by key ("id" for example): +`sort-json file.json -k id` or `sort-json file.json --key id` +The original file will be overwritten by a sorted JSON file, keeping the indentation of the original file. tests ----- diff --git a/cmd.js b/cmd.js index 7a02bd7..06650a2 100755 --- a/cmd.js +++ b/cmd.js @@ -9,7 +9,22 @@ var detectIndent = require('detect-indent'); var sortJson = require('./'); // Get all the files -var files = process.argv.slice(2); +var files = process.argv.splice(2, 3); +var key = null; + +for (var x = 0; x < files.length; x++){ + if (files[x] === "-k" || files[x] === '--key'){ + if (files.length !== x + 2){ + console.log("error: no key was given, ignoring the flag"); + files.pop(); + break; + } else { + key = files.pop(); + files.pop(); + break; + } + } +} files.forEach(readEachFile); @@ -37,7 +52,7 @@ function readEachFile(fileName) { } // Sorting - var sortedObject = sortJson(json); + var sortedObject = sortJson(json, key); // Saving to file fs.writeFile(filePath, JSON.stringify(sortedObject, null, indent) + ((eol && eol.length === 2) ? eol[1] : ''), function(err) { diff --git a/index.js b/index.js index 0bd007d..11eb962 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,26 @@ module.exports = visit; -function visit(old) { +function visit(old, mainKey) { if (typeof(old) !== 'object' || old === null) { return old; } var copy = Array.isArray(old) ? [] : {}; - var keys = Object.keys(old).sort(); - keys.forEach(function(key) { - copy[key] = visit(old[key]); - }); + if (mainKey === null){ + var keys = Object.keys(old).sort(); + keys.forEach(function(key) { + copy[key] = visit(old[key], null); + }); + } else { + var type = typeof(old[0][mainKey]); + for (var x = 0; x < old.length; x++){ + old.sort(function(a, b){ + if (type !== 'number') + return (a[mainKey] < b[mainKey]); + else + return (a[mainKey] - b[mainKey]) + }); + } + return (old); + } return copy; } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..5d615e4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,37 @@ +{ + "name": "sort-json", + "version": "1.4.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "requires": { + "repeating": "2.0.1" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "1.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "1.0.2" + } + } + } +} From ef615bda38752b46604a8aea23cf4b8811d02582 Mon Sep 17 00:00:00 2001 From: "nathan.schwarz@epitech.eu" Date: Wed, 6 Sep 2017 12:46:44 +0200 Subject: [PATCH 02/10] fixed non working flag for strings --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index 11eb962..e5321a9 100644 --- a/index.js +++ b/index.js @@ -11,13 +11,9 @@ function visit(old, mainKey) { copy[key] = visit(old[key], null); }); } else { - var type = typeof(old[0][mainKey]); for (var x = 0; x < old.length; x++){ old.sort(function(a, b){ - if (type !== 'number') - return (a[mainKey] < b[mainKey]); - else - return (a[mainKey] - b[mainKey]) + return (a[mainKey] - b[mainKey]) }); } return (old); From ef6c7418405abb6ea1b93eae87d7488a784696f9 Mon Sep 17 00:00:00 2001 From: "nathan.schwarz@epitech.eu" Date: Wed, 6 Sep 2017 12:51:15 +0200 Subject: [PATCH 03/10] updated the README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 160337d..9d7cf95 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ usage ```js var sortJson = require('sort-json'); -var copy = sortJson(object); +var copy = sortJson(object, key); +and if there's no key +var copy = sortJson(object, null); ``` CLI usage From f62f1ee08a043600066a322b8da31552135bb13c Mon Sep 17 00:00:00 2001 From: "nathan.schwarz@epitech.eu" Date: Wed, 6 Sep 2017 12:53:00 +0200 Subject: [PATCH 04/10] updated the README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d7cf95..e773a60 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ usage var sortJson = require('sort-json'); var copy = sortJson(object, key); -and if there's no key +and if there is no key var copy = sortJson(object, null); ``` From 8b2668cfdf2add70f8fb86772fb87e36d338150f Mon Sep 17 00:00:00 2001 From: "nathan.schwarz@epitech.eu" Date: Wed, 6 Sep 2017 12:54:36 +0200 Subject: [PATCH 05/10] updated the package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c55030f..054dd28 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "type": "git", "url": "https://github.com/kesla/sort-json.git" }, - "author": "David Björklund ", + "authors": "David Björklund , Nathan Schwarz ", "license": "MIT", "bugs": { "url": "https://github.com/kesla/sort-json/issues" From 66a484f55fd063baf3978f5607466d760d97f961 Mon Sep 17 00:00:00 2001 From: Nathan Schwarz Date: Sat, 27 Jun 2020 13:17:45 +0200 Subject: [PATCH 06/10] added tests : sorting arrays is fully working --- LICENSE | 22 + README.md | 65 ++- app/cmd.js | 25 + app/index.js | 5 + app/overwrite.js | 73 +++ app/sortByKey.js | 61 ++ app/visit.js | 51 ++ index.js | 23 +- package.json | 20 +- tests/cmd.js | 114 ++++ tests/overwrite.js | 222 ++++++++ tests/visit.js | 57 +- yarn.lock | 1330 ++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 2014 insertions(+), 54 deletions(-) create mode 100644 LICENSE create mode 100755 app/cmd.js create mode 100644 app/index.js create mode 100644 app/overwrite.js create mode 100644 app/sortByKey.js create mode 100644 app/visit.js create mode 100644 tests/cmd.js create mode 100644 tests/overwrite.js create mode 100644 yarn.lock diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..33eac51 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2019 David Björklund + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/README.md b/README.md index e773a60..3409a3f 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,60 @@ -sort-json -========= +# sort-json [![Build Status](https://travis-ci.org/kesla/sort-json.svg?branch=master)](https://travis-ci.org/kesla/sort-json) It takes a JSON file and returns a copy of the same file, but with the sorted keys. -installation ------------- +## Installation ` [sudo] npm -g install sort-json` - -usage ------ +## Usage ```js -var sortJson = require('sort-json'); +const sortJson = require('sort-json'); + +const options = { ignoreCase: true, reverse: true, depth: 1}; +const copy = sortJson({ AA: 123, a: 1, b: 21 }, options); +// copy => { b: 21, AA: 123, a: 1 } -var copy = sortJson(object, key); -and if there is no key -var copy = sortJson(object, null); +sortJson.overwrite('some/absolute/path.json', options); +// sorts the json at absolute path and overwrites file, also returns sorted object + +sortJson.overwrite(['some/absolute/path1.json', 'some/absolute/path2.json'], options); +// sorts the json at absolute paths and overwrites files, also returns array of sorted objects ``` -CLI usage ---------- -`sort-json file.json` -or if you want to sort by key ("id" for example): -`sort-json file.json -k id` or `sort-json file.json --key id` -The original file will be overwritten by a sorted JSON file, keeping the indentation of the original file. +## CLI usage + +`sort-json filename [options]` +Sorts and overwrites .json or .rc files. + +_Example_ +`sort-json test.json --ignore-case` + + **Options** + +`--ignore-case, -i`\ +Ignore case when sorting. + +`--reverse, -r`\ +Reverse the ordering z -> a + +`--depth=DEPTH, -d`\ +The sorting _DEPTH_ on multidimensional objects. +Use a number greater then 0 for the _DEPTH_ value. + +`--indent-size=SIZE, --spaces=SIZE`\ +Formats the file content with an indentation of _SIZE_ spaces (default: detects the used indentation of the file). +Use a number greater then 0 for the _SIZE_ value. + +`--no-final-newline, -nn`\ +No final new line will be added to the end of the file. + + +## Upgrade to version 2.x + +sort-json 2.0.0 will create a different output when the source JSON file does not use an indent size of 2 spaces. +Use `--indent-size=2` to always create an output file with 2 spaces. -tests ------ +## Tests `npm test` diff --git a/app/cmd.js b/app/cmd.js new file mode 100755 index 0000000..549dbd0 --- /dev/null +++ b/app/cmd.js @@ -0,0 +1,25 @@ +#!/usr/bin/env node + +// Core dependencies +const path = require('path'); + +// NPM dependencies +const minimist = require('minimist'); +const sortJson = require('./'); + +const alias = { + key: ['key', 'k'], + DESC: ['DESC'], + depth: ['d'], + reverse: ['r'], + ignoreCase: ['ignore-case', 'i'], + indentSize: ['indent-size', 'spaces'], + noFinalNewLine: ['no-final-newline', 'nn'], +}; + +const argv = minimist(process.argv.slice(2), { alias }); + +// Get all the files +const files = argv._.filter(arg => arg.endsWith('.json') || arg.endsWith('.rc')); + +sortJson.overwrite(files.map(file => path.resolve(file)), argv); diff --git a/app/index.js b/app/index.js new file mode 100644 index 0000000..2658d39 --- /dev/null +++ b/app/index.js @@ -0,0 +1,5 @@ +const visit = require('./visit'); +const overwrite = require('./overwrite'); + +module.exports = visit; +module.exports.overwrite = overwrite; diff --git a/app/overwrite.js b/app/overwrite.js new file mode 100644 index 0000000..d17d615 --- /dev/null +++ b/app/overwrite.js @@ -0,0 +1,73 @@ +const fs = require('fs'); +const detectIndent = require('detect-indent'); +const detectNewline = require('detect-newline'); + +const visit = require('./visit'); +const sortByKey = require('./sortByKey') + +const DEFAULT_INDENT_SIZE = 2; + +/** + * Overwrite file with sorted json + * @param {String} path - absolutePath + * @param {Object} [options = {}] - optional params + * @returns {*} + */ +function overwriteFile(path, options = {}) { + let fileContent = null; + let newData = null; + + try { + fileContent = fs.readFileSync(path, 'utf8'); + newData = visit(JSON.parse(fileContent), options); + + const key = options.key || null; + const DESC = options.DESC || false; + if (key !== null) { + newData = sortByKey(newData, key, DESC) + } + + } catch (e) { + console.error('Failed to retrieve json object from file'); + throw e; + } + + let indent; + + if (options && options.indentSize) { + indent = options.indentSize; + } else { + indent = detectIndent(fileContent).indent || DEFAULT_INDENT_SIZE; + } + + const newLine = detectNewline(fileContent) || '\n'; + let newFileContent = JSON.stringify(newData, null, indent); + + if (!(options && options.noFinalNewLine)) { + // Append a new line at EOF + newFileContent += '\n'; + } + + if (newLine !== '\n') { + newFileContent = newFileContent.replace(/\n/g, newLine); + } + + fs.writeFileSync(path, newFileContent, 'utf8'); + return newData; +} + +/** + * Sorts the files json with the visit function and then overwrites the file with sorted json + * @see visit + * @param {String|Array} absolutePaths - String: Absolute path to json file to sort and overwrite + * Array: Absolute paths to json files to sort and overwrite + * @param {Object} [options = {}] - Optional parameters object, see visit for details + * @returns {*} - Whatever is returned by visit + */ +function overwrite(absolutePaths, options) { + const paths = Array.isArray(absolutePaths) ? absolutePaths : [absolutePaths]; + const results = paths.map(path => overwriteFile(path, options)); + return results.length > 1 ? results : results[0]; +} + +module.exports = overwrite; diff --git a/app/sortByKey.js b/app/sortByKey.js new file mode 100644 index 0000000..6074031 --- /dev/null +++ b/app/sortByKey.js @@ -0,0 +1,61 @@ +function getKeyValue(key, obj) { + const keyParts = key.split('.').filter(k => k.length); + return keyParts.reduce((r, i) => { + if (r[i] == null) { + r[i] = {}; + } + return r[i]; + }, obj); +} + +function asc_cmp(a, b) { + const type = typeof(a); + if (type === 'string') { + return a.localeCompare(b); + } else { + return a - b; + } +} + +function desc_cmp(a, b) { + return asc_cmp(a, b) * -1; +} + +function sortArray(arr, key, DESC) { + const cmp = DESC ? desc_cmp : asc_cmp; + return arr.sort((a, b) => { + const values = [ + getKeyValue(key, a), + getKeyValue(key, b) + ]; + return cmp(values[0], values[1]); + }) +} + +function sortbyKey(obj, key, DESC) { + const arraysToSort = key.split('$.').filter(k => k.length); + + if (arraysToSort.length === 0) { + const cmp = DESC ? desc_cmp : asc_cmp; + return obj.sort(cmp); + } + if (arraysToSort.length === 1) { + return sortArray(obj, arraysToSort[0], DESC); + } + + const isArray = Array.isArray(obj); + const nextKey = '$.' + arraysToSort.slice(1).join('$.'); + + if (isArray) { + obj.forEach((_obj) => { + let child = getKeyValue(arraysToSort[0], _obj); + child = sortbyKey(child, nextKey, DESC); + }); + } else { + let child = getKeyValue(arraysToSort[0], obj); + child = sortbyKey(child, nextKey, DESC); + } + return obj; +} + +module.exports = sortbyKey; diff --git a/app/visit.js b/app/visit.js new file mode 100644 index 0000000..a18c466 --- /dev/null +++ b/app/visit.js @@ -0,0 +1,51 @@ +/** + * Sorts the keys on objects + * @param {*} old - An object to sort the keys of, if not object just + * returns whatever was given + * @param {Object} [sortOptions = {}] - optional parameters + * @param [options.reverse = false] - When sorting keys, converts all keys to lowercase so + * that capitalization doesn't interfere with sort order + * @param [options.ignoreCase = false] - When sorting keys, converts all keys to + * @param [options.depth = Infinity] - Depth's level sorting keys on a + * multidimensional object + * @param [options.key] - it will sort arrays by the mentionned key (nested keys are separated by a ".", arrays by '$') + * @param [options.DESC] - to use with the key options: sort arrays by descending values instead of ascending + * + * @returns {*} - Object with sorted keys, if old wasn't an object + * returns whatever was passed + */ +function visit(old, options) { + const sortOptions = options || {}; + + const ignoreCase = sortOptions.ignoreCase || false; + const reverse = sortOptions.reverse || false; + const depth = sortOptions.depth || Infinity; + const level = sortOptions.level || 1; + const processing = level <= depth; + + if (typeof (old) !== 'object' || old === null) { + return old; + } + + const copy = Array.isArray(old) ? [] : {}; + let keys = Object.keys(old); + if (processing) { + keys = ignoreCase ? + keys.sort((left, right) => left.toLowerCase().localeCompare(right.toLowerCase())) : + keys.sort(); + } + + if (reverse) { + keys = keys.reverse(); + } + + keys.forEach((key) => { + const subSortOptions = Object.assign({}, sortOptions); + subSortOptions.level = level + 1; + copy[key] = visit(old[key], subSortOptions); + }); + + return copy; +} + +module.exports = visit; diff --git a/index.js b/index.js index e5321a9..94ab165 100644 --- a/index.js +++ b/index.js @@ -1,22 +1,3 @@ -module.exports = visit; +'use strict'; -function visit(old, mainKey) { - if (typeof(old) !== 'object' || old === null) { - return old; - } - var copy = Array.isArray(old) ? [] : {}; - if (mainKey === null){ - var keys = Object.keys(old).sort(); - keys.forEach(function(key) { - copy[key] = visit(old[key], null); - }); - } else { - for (var x = 0; x < old.length; x++){ - old.sort(function(a, b){ - return (a[mainKey] - b[mainKey]) - }); - } - return (old); - } - return copy; -} +module.exports = require('./app'); \ No newline at end of file diff --git a/package.json b/package.json index 054dd28..3e775dd 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,35 @@ { "name": "sort-json", - "version": "1.4.1", + "version": "2.0.0", "description": "Takes a json-file and return a copy of the same file, but sorted", "main": "index.js", "dependencies": { - "detect-indent": "^4.0.0" + "detect-indent": "^5.0.0", + "detect-newline": "^2.1.0", + "minimist": "^1.2.0" }, "bin": { - "sort-json": "./cmd.js" + "sort-json": "./app/cmd.js" }, "devDependencies": { "chai": "^3.5.0", "dirty-chai": "^1.2.2", - "eslint": "^3.8.1", + "eslint": "^4.18.2", "eslint-config-airbnb": "^12.0.0", - "eslint-plugin-import": "^2.0.1", + "eslint-plugin-import": "^1.16.0", "eslint-plugin-jsx-a11y": "^2.2.3", "eslint-plugin-react": "^6.4.1", - "mocha": "^3.1.2" + "mocha": "^5.2.0" }, "scripts": { - "test": "mocha --recursive tests", - "lint": "eslint tests" + "test": "mocha tests", + "lint": "eslint tests && eslint app" }, "repository": { "type": "git", "url": "https://github.com/kesla/sort-json.git" }, - "authors": "David Björklund , Nathan Schwarz ", + "author": "David Björklund ", "license": "MIT", "bugs": { "url": "https://github.com/kesla/sort-json/issues" diff --git a/tests/cmd.js b/tests/cmd.js new file mode 100644 index 0000000..d5b6c6c --- /dev/null +++ b/tests/cmd.js @@ -0,0 +1,114 @@ +/* eslint-disable */ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const cp = require('child_process'); +const chai = require('chai'); +const dirtyChai = require('dirty-chai'); + +const expect = chai.expect; +chai.use(dirtyChai); + +const tempFile = path.resolve(__dirname, './temp_file_test.json'); +const tempFile2 = path.resolve(__dirname, './temp_file_2_test.json'); + +afterEach(() => { + try { fs.unlinkSync(tempFile); fs.unlinkSync(tempFile2) } catch (e) {} +}); + +describe('cmd', () => { + it('sorts object by keys', () => { + after(() => { + try { fs.unlinkSync(tempFile); } catch (e) {} + }); + + const givenData = { foo: 123, bar: 456, baz: 789 }; + const expectedData = { bar: 456, baz: 789, foo: 123 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile}`); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object in reverse by keys if reverse enabled', () => { + const givenData = { abc: 123, def: 456, hij: 789 }; + const expectedData = { hij: 789, def: 456, abc: 123 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + fs.writeFileSync(tempFile2, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile} --reverse`); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile2} -r`); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile2, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys with depth not set', () => { + const givenData = { def: 456, abc: { b: 1, a: 2 }, hij: 789 }; + const expectedData = { abc: { a: 2, b: 1 }, def: 456, hij: 789 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile}`); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys with depth = 1', () => { + const givenData = { def: 456, abc: { b: 1, a: 2 }, hij: 789 }; + const expectedData = { abc: { b: 1, a: 2 }, def: 456, hij: 789 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + fs.writeFileSync(tempFile2, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile} -d=1`); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile2} --depth=1`); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile2, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys with depth = 2', () => { + const givenData = { def: 456, abc: { b: 1, a: 2 }, hij: 789 }; + const expectedData = { abc: { a: 2, b: 1 }, def: 456, hij: 789 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + fs.writeFileSync(tempFile2, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile} -d=2`); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile2} --depth=2`); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile2, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys and ignores case if ignoreCase enabled', () => { + const givenData = { foo: 123, bar: 456, baz: 789, Quax: 999, Foo2: 123 }; + const expectedData = { bar: 456, baz: 789, foo: 123, Foo2: 123, Quax: 999 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + fs.writeFileSync(tempFile2, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile} --ignore-case`); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile2} -i`); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile2, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys and uses given indent size', () => { + const givenData = { foo: 123, bar: 456 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + cp.execSync(`node ${path.resolve(__dirname, '../app/cmd')} ${tempFile} --indent-size=3`); + + // parse then stringify to remove white space issues + const expectedData = { bar: 456, foo: 123}; + const expectedFileContent = JSON.stringify(expectedData, null, 3) + '\n'; + expect(fs.readFileSync(tempFile, 'utf8')).to.equal(expectedFileContent); + }); +}); diff --git a/tests/overwrite.js b/tests/overwrite.js new file mode 100644 index 0000000..5d538b3 --- /dev/null +++ b/tests/overwrite.js @@ -0,0 +1,222 @@ +/* eslint-disable */ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const chai = require('chai'); +const dirtyChai = require('dirty-chai'); +const sortJson = require('../'); + +const expect = chai.expect; +chai.use(dirtyChai); + +const tempFile = path.resolve(__dirname, './temp_file_test.json'); +const tempFile2 = path.resolve(__dirname, './temp_file_2_test.json'); + +afterEach(() => { + try { fs.unlinkSync(tempFile); fs.unlinkSync(tempFile2) } catch (e) {} +}); + +describe('overwrite', () => { + it('sorts file by keys', () => { + const givenData = { foo: 123, bar: 456, baz: 789 }; + const expectedData = { bar: 456, baz: 789, foo: 123 }; + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + sortJson.overwrite(tempFile); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts files by keys', () => { + const givenData = { foo: 123, bar: 456, baz: 789 }; + const expectedData = { bar: 456, baz: 789, foo: 123 }; + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + fs.writeFileSync(tempFile2, JSON.stringify(givenData), 'utf8'); + sortJson.overwrite([tempFile, tempFile2]); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile2, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts file in reverse by keys if reverse enabled', () => { + const givenData = { abc: 123, def: 456, hij: 789 }; + const expectedData = { hij: 789, def: 456, abc: 123 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + sortJson.overwrite(tempFile, { reverse: true }); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts file by keys and ignores case if ignoreCase enabled', () => { + const givenData = { foo: 123, bar: 456, baz: 789, Quax: 999, Foo2: 123 }; + const expectedData = { bar: 456, baz: 789, foo: 123, Foo2: 123, Quax: 999 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData), 'utf8'); + sortJson.overwrite(tempFile, { ignoreCase: true }); + + // parse then stringify to remove white space issues + expect(JSON.stringify(JSON.parse(fs.readFileSync(tempFile, 'utf8')))).to.equal(JSON.stringify(expectedData)); + }); + + it('persists the indentation when modifying the file', () => { + const givenData = { foo: 123 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile); + + const result = fs.readFileSync(tempFile, 'utf8'); + expect(result).to.equal('{\n "foo": 123\n}\n'); + }); + + it('persists the \\n end-of-line marker when modifying the file', () => { + const givenData = '{\n "foo": 123,\n "bar": 456\n}\n'; + + fs.writeFileSync(tempFile, givenData, 'utf8'); + sortJson.overwrite(tempFile); + + const result = fs.readFileSync(tempFile, 'utf8'); + expect(result).to.equal('{\n "bar": 456,\n "foo": 123\n}\n'); + }); + + it('persists the \\r\\n end-of-line marker when modifying the file', () => { + const givenData = '{\r\n "foo": 123,\r\n "bar": 456\r\n}\r\n'; + + fs.writeFileSync(tempFile, givenData, 'utf8'); + sortJson.overwrite(tempFile); + + const result = fs.readFileSync(tempFile, 'utf8'); + expect(result).to.equal('{\r\n "bar": 456,\r\n "foo": 123\r\n}\r\n'); + }); + + it('does not insert an end-of-line marker if noFinalNewLine is enabled', () => { + const givenData = { foo: 123 }; + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { noFinalNewLine: true }); + + const result = fs.readFileSync(tempFile, 'utf8'); + expect(result).to.equal('{\n "foo": 123\n}'); + }); + it('sorts an array of objects in ascending order with the specified key', () => { + + const givenData = [{ _id: 'chips' }, { _id: 'arm' }, { _id: 'very good trip' }]; + const expectedData = [ { _id: 'arm' }, { _id: 'chips' }, { _id: 'very good trip' }]; + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + + sortJson.overwrite(tempFile, { key: '$._id' }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); + it('sorts an array of objects in descending order with the specified key', () => { + + const givenData = [ + { _id: 'arm' }, + { _id: 'chips' }, + { _id: 'very good trip' } + ]; + const expectedData = [ + { _id: 'very good trip' }, + { _id: 'chips' }, + { _id: 'arm' } + ]; + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { key: '$._id', DESC: true }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); + it('sorts a nested array in an array of objects in ascending order with the specified key', () => { + + const givenData = [ + { + _id: [ + { nested: 'chips' }, + { nested: 'very good trip' }, + { nested: 'arm' } + ] + } + ]; + const expectedData = [ + { + _id: [ + { nested: 'arm' }, + { nested: 'chips' }, + { nested: 'very good trip' }, + ] + } + ]; + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { key: '$._id.$.nested', DESC: false }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); + it('sorts an array of objects in an object in ascending order with the specified key', () => { + + const givenData = { + lola: 'test', + a: 'test', + _id: [ + { nested: 'chips' }, + { nested: 'very good trip' }, + { nested: 'arm' } + ] + } + const expectedData = { + _id: [ + { nested: 'arm' }, + { nested: 'chips' }, + { nested: 'very good trip' }, + ], + a: 'test', + lola: 'test' + } + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { key: '_id.$.nested', DESC: false }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); + it('sorts an array of numbers in ascending order', () => { + + const givenData = [ 10, 9, 6, 5, 2, 1, 3 ] + const expectedData = [ 1, 2, 3, 5, 6, 9, 10 ] + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { key: '$.', DESC: false }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); + it('sorts an array of numbers in descending order', () => { + + const givenData = [ 10, 9, 6, 5, 2, 1, 3 ] + const expectedData = [ 10, 9, 6, 5, 3, 2, 1 ] + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { key: '$.', DESC: true }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); + it('sorts an array of strings in ascending order', () => { + + const givenData = [ 'world', 'hello', 'we', 'are', 'your', 'friends' ] + const expectedData = [ 'are', 'friends', 'hello', 'we', 'world', 'your' ] + + fs.writeFileSync(tempFile, JSON.stringify(givenData, null, 4), 'utf8'); + sortJson.overwrite(tempFile, { key: '$.', DESC: false }); + + const result = JSON.parse(fs.readFileSync(tempFile, 'utf8')); + expect(result).deep.equal(expectedData); + }); +}); diff --git a/tests/visit.js b/tests/visit.js index ad94a84..5d72e23 100644 --- a/tests/visit.js +++ b/tests/visit.js @@ -1,10 +1,18 @@ +/* eslint-disable */ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const cp = require('child_process'); const chai = require('chai'); const dirtyChai = require('dirty-chai'); -const visit = require('../index'); +const visit = require('../'); const expect = chai.expect; chai.use(dirtyChai); +const tempFile = path.resolve(__dirname, './temp_file_test.json'); + describe('visit', () => { it('returns undefined for undefined', () => { expect(visit(undefined)).to.be.undefined(); @@ -23,26 +31,65 @@ describe('visit', () => { expect(JSON.stringify(visit(givenData))).to.equal(JSON.stringify(expectedData)); }); + it('sorts object in reverse by keys if reverse enabled', () => { + const opts = { reverse: true }; + const givenData = { abc: 123, def: 456, hij: 789 }; + const expectedData = { hij: 789, def: 456, abc: 123 }; + + expect(JSON.stringify(visit(givenData, opts))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys with depth not set', () => { + const givenData = { def: 456, abc: { b: 1, a: 2 }, hij: 789 }; + const expectedData = { abc: { a: 2, b: 1 }, def: 456, hij: 789 }; + + expect(JSON.stringify(visit(givenData))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys with depth = 1', () => { + const opts = { depth: 1 }; + const givenData = { def: 456, abc: { b: 1, a: 2 }, hij: 789 }; + const expectedData = { abc: { b: 1, a: 2 }, def: 456, hij: 789 }; + + expect(JSON.stringify(visit(givenData, opts))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys with depth = 2', () => { + const opts = { depth: 2 }; + const givenData = { def: 456, abc: { b: 1, a: 2 }, hij: 789 }; + const expectedData = { abc: { a: 2, b: 1 }, def: 456, hij: 789 }; + + expect(JSON.stringify(visit(givenData, opts))).to.equal(JSON.stringify(expectedData)); + }); + + it('sorts object by keys and ignores case if ignoreCase enabled', () => { + const opts = { ignoreCase: true }; + const givenData = { foo: 123, bar: 456, baz: 789, Quax: 999, Foo2: 123 }; + const expectedData = { bar: 456, baz: 789, foo: 123, Foo2: 123, Quax: 999 }; + + expect(JSON.stringify(visit(givenData, opts))).to.equal(JSON.stringify(expectedData)); + }); + it('sorts nested object', () => { const givenData = { foo: [1, 2, 5, 2], bar: { foo: 3, bar: 'lorem ipsum', - baz: [1, { foo2: 444 }], + baz: [1, { foo2: 444 }] }, foo2: '', - bar2: null, + bar2: null }; const expectedData = { bar: { bar: 'lorem ipsum', baz: [1, { foo2: 444 }], - foo: 3, + foo: 3 }, bar2: null, foo: [1, 2, 5, 2], - foo2: '', + foo2: '' }; expect(JSON.stringify(visit(givenData))).to.equal(JSON.stringify(expectedData)); diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..941cb1a --- /dev/null +++ b/yarn.lock @@ -0,0 +1,1330 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +acorn-jsx@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" + integrity sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s= + dependencies: + acorn "^3.0.4" + +acorn@^3.0.4: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + integrity sha1-ReN/s56No/JbruP/U2niu18iAXo= + +acorn@^5.5.0: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +ajv-keywords@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-2.1.1.tgz#617997fc5f60576894c435f940d819e135b80762" + integrity sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I= + +ajv@^5.2.3, ajv@^5.3.0: + version "5.5.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" + integrity sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU= + dependencies: + co "^4.6.0" + fast-deep-equal "^1.0.0" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.3.0" + +ansi-escapes@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +array.prototype.find@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7" + integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.13.0" + +assertion-error@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +babel-code-frame@^6.22.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +builtin-modules@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= + +caller-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" + integrity sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8= + dependencies: + callsites "^0.2.0" + +callsites@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" + integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= + +chai@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/chai/-/chai-3.5.0.tgz#4d02637b067fe958bdbfdd3a40ec56fef7373247" + integrity sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc= + dependencies: + assertion-error "^1.0.1" + deep-eql "^0.1.3" + type-detect "^1.0.0" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.1.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + integrity sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I= + +circular-json@^0.3.1: + version "0.3.3" + resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" + integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +commander@2.15.1: + version "2.15.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" + integrity sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +concat-stream@^1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" + integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== + dependencies: + buffer-from "^1.0.0" + inherits "^2.0.3" + readable-stream "^2.2.2" + typedarray "^0.0.6" + +contains-path@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" + integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + integrity sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk= + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + +d@1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +damerau-levenshtein@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.5.tgz#780cf7144eb2e8dbd1c3bb83ae31100ccc31a414" + integrity sha512-CBCRqFnpu715iPmw1KrdOrzRqbdFwQTwAWyyyYS42+iAgHCuXZ+/TdMgQkUENPomxEz9z1BEzuQU2Xw0kUuAgA== + +debug@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g== + dependencies: + ms "2.0.0" + +debug@^2.2.0: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.1.0: + version "3.2.6" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" + integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ== + dependencies: + ms "^2.1.1" + +deep-eql@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-0.1.3.tgz#ef558acab8de25206cd713906d74e56930eb69f2" + integrity sha1-71WKyrjeJSBs1xOQbXTlaTDrafI= + dependencies: + type-detect "0.1.1" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + +diff@3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" + integrity sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA== + +dirty-chai@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/dirty-chai/-/dirty-chai-1.2.2.tgz#78495e619635f7fe44219aa4c837849bf183142e" + integrity sha1-eEleYZY19/5EIZqkyDeEm/GDFC4= + +doctrine@1.3.x: + version "1.3.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.3.0.tgz#13e75682b55518424276f7c173783456ef913d26" + integrity sha1-E+dWgrVVGEJCdvfBc3g0Vu+RPSY= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^1.2.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" + integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo= + dependencies: + esutils "^2.0.2" + isarray "^1.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +es-abstract@^1.13.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +es5-ext@^0.10.35, es5-ext@^0.10.50, es5-ext@~0.10.14: + version "0.10.50" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.50.tgz#6d0e23a0abdb27018e5ac4fd09b412bc5517a778" + integrity sha512-KMzZTPBkeQV/JcSQhI5/z6d9VWJ3EnQ194USTUwIYZ2ZbpN8+SGXQKt1h68EX44+qt+Fzr8DO17vnxrw7c3agw== + dependencies: + es6-iterator "~2.0.3" + es6-symbol "~3.1.1" + next-tick "^1.0.0" + +es6-iterator@~2.0.1, es6-iterator@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha1-p96IkUGgWpSwhUQDstCg+/qY87c= + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-map@^0.1.3: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" + integrity sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA= + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-set "~0.1.5" + es6-symbol "~3.1.1" + event-emitter "~0.3.5" + +es6-set@^0.1.4, es6-set@~0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" + integrity sha1-0rPsXU2ADO2BjbU40ol02wpzzLE= + dependencies: + d "1" + es5-ext "~0.10.14" + es6-iterator "~2.0.1" + es6-symbol "3.1.1" + event-emitter "~0.3.5" + +es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" + integrity sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc= + dependencies: + d "1" + es5-ext "~0.10.14" + +escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-config-airbnb-base@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-8.0.0.tgz#c5e958a469ab8af76aff068b43d784e5afe74ca7" + integrity sha1-xelYpGmrivdq/waLQ9eE5a/nTKc= + +eslint-config-airbnb@^12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-12.0.0.tgz#ab282b756a25f03d04ac264c24d673a08a803270" + integrity sha1-qygrdWol8D0ErCZMJNZzoIqAMnA= + dependencies: + eslint-config-airbnb-base "^8.0.0" + +eslint-import-resolver-node@^0.2.0: + version "0.2.3" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" + integrity sha1-Wt2BBujJKNssuiMrzZ76hG49oWw= + dependencies: + debug "^2.2.0" + object-assign "^4.0.1" + resolve "^1.1.6" + +eslint-plugin-import@^1.16.0: + version "1.16.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-1.16.0.tgz#b2fa07ebcc53504d0f2a4477582ec8bff1871b9f" + integrity sha1-svoH68xTUE0PKkR3WC7Iv/GHG58= + dependencies: + builtin-modules "^1.1.1" + contains-path "^0.1.0" + debug "^2.2.0" + doctrine "1.3.x" + es6-map "^0.1.3" + es6-set "^0.1.4" + eslint-import-resolver-node "^0.2.0" + has "^1.0.1" + lodash.cond "^4.3.0" + lodash.endswith "^4.0.1" + lodash.find "^4.3.0" + lodash.findindex "^4.3.0" + minimatch "^3.0.3" + object-assign "^4.0.1" + pkg-dir "^1.0.0" + pkg-up "^1.0.0" + +eslint-plugin-jsx-a11y@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-2.2.3.tgz#4e35cb71b8a7db702ac415c806eb8e8d9ea6c65d" + integrity sha1-TjXLcbin23AqxBXIBuuOjZ6mxl0= + dependencies: + damerau-levenshtein "^1.0.0" + jsx-ast-utils "^1.0.0" + object-assign "^4.0.1" + +eslint-plugin-react@^6.4.1: + version "6.10.3" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78" + integrity sha1-xUNb6wZ3ThLH2y9qut3L+QDNP3g= + dependencies: + array.prototype.find "^2.0.1" + doctrine "^1.2.2" + has "^1.0.1" + jsx-ast-utils "^1.3.4" + object.assign "^4.0.4" + +eslint-scope@^3.7.1: + version "3.7.3" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.3.tgz#bb507200d3d17f60247636160b4826284b108535" + integrity sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-visitor-keys@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== + +eslint@^4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.18.2.tgz#0f81267ad1012e7d2051e186a9004cc2267b8d45" + integrity sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw== + dependencies: + ajv "^5.3.0" + babel-code-frame "^6.22.0" + chalk "^2.1.0" + concat-stream "^1.6.0" + cross-spawn "^5.1.0" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^3.7.1" + eslint-visitor-keys "^1.0.0" + espree "^3.5.2" + esquery "^1.0.0" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.0.1" + ignore "^3.3.3" + imurmurhash "^0.1.4" + inquirer "^3.0.6" + is-resolvable "^1.0.0" + js-yaml "^3.9.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.4" + minimatch "^3.0.2" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" + strip-json-comments "~2.0.1" + table "4.0.2" + text-table "~0.2.0" + +espree@^3.5.2: + version "3.5.4" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" + integrity sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A== + dependencies: + acorn "^5.5.0" + acorn-jsx "^3.0.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +event-emitter@~0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk= + dependencies: + d "1" + es5-ext "~0.10.14" + +external-editor@^2.0.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" + integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + +fast-deep-equal@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" + integrity sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-2.0.0.tgz#c392990c3e684783d838b8c84a45d8a048458361" + integrity sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E= + dependencies: + flat-cache "^1.2.1" + object-assign "^4.0.1" + +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + integrity sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8= + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + +flat-cache@^1.2.1: + version "1.3.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.4.tgz#2c2ef77525cc2929007dfffa1dd314aa9c9dee6f" + integrity sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg== + dependencies: + circular-json "^0.3.1" + graceful-fs "^4.1.2" + rimraf "~2.6.2" + write "^0.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +glob@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + integrity sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.2, glob@^7.1.3: + version "7.1.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.5.tgz#6714c69bee20f3c3e64c4dd905553e532b40cdc0" + integrity sha512-J9dlskqUXK1OeTOYBEn5s8aMukWMwWfs+rPTn/jn50Ux4MNXVhubL1wu/j2t+H4NVI+cXEcCaYellqaPVGXNqQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.0.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +graceful-fs@^4.1.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.0.tgz#8d8fdc73977cb04104721cb53666c1ca64cd328b" + integrity sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg== + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + +has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +he@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" + integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0= + +iconv-lite@^0.4.17: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^3.3.3: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inquirer@^3.0.6: + version "3.3.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.3.0.tgz#9dd2f2ad765dcab1ff0443b491442a20ba227dc9" + integrity sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ== + dependencies: + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.1.0" + strip-ansi "^4.0.0" + through "^2.3.6" + +is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + +is-resolvable@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" + integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +isarray@^1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@^3.9.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-schema-traverse@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" + integrity sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A= + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +jsx-ast-utils@^1.0.0, jsx-ast-utils@^1.3.4: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" + integrity sha1-OGchPo3Xm/Ho8jAMDPwe+xgsDfE= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash.cond@^4.3.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" + integrity sha1-9HGh2khr5g9quVXRcRVSPdHSVdU= + +lodash.endswith@^4.0.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/lodash.endswith/-/lodash.endswith-4.2.1.tgz#fed59ac1738ed3e236edd7064ec456448b37bc09" + integrity sha1-/tWawXOO0+I27dcGTsRWRIs3vAk= + +lodash.find@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1" + integrity sha1-ywcE1Hq3F4n/oN6Ll92Sb7iLE7E= + +lodash.findindex@^4.3.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.findindex/-/lodash.findindex-4.6.0.tgz#a3245dee61fb9b6e0624b535125624bb69c11106" + integrity sha1-oyRd7mH7m24GJLU1ElYku2nBEQY= + +lodash@^4.17.4, lodash@^4.3.0: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + +lru-cache@^4.0.1: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +mkdirp@0.5.1, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +mocha@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6" + integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ== + dependencies: + browser-stdout "1.3.1" + commander "2.15.1" + debug "3.1.0" + diff "3.5.0" + escape-string-regexp "1.0.5" + glob "7.1.2" + growl "1.10.5" + he "1.1.1" + minimatch "3.0.4" + mkdirp "0.5.1" + supports-color "5.4.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +next-tick@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" + integrity sha1-yobR/ogoFpsBICCOPchCS524NCw= + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-keys@^1.0.11, object-keys@^1.0.12: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.0.4: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + integrity sha1-D+tsZPD8UY2adU3V77YscCJ2H0s= + dependencies: + pinkie-promise "^2.0.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-is-inside@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" + integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o= + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= + +pkg-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" + integrity sha1-ektQio1bstYp1EcFb/TpyTFM89Q= + dependencies: + find-up "^1.0.0" + +pkg-up@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" + integrity sha1-Pgj7RhUlxEIWJKM7n35tCvWwWiY= + dependencies: + find-up "^1.0.0" + +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" + integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM= + +readable-stream@^2.2.2: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +require-uncached@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" + integrity sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM= + dependencies: + caller-path "^0.1.0" + resolve-from "^1.0.0" + +resolve-from@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" + integrity sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY= + +resolve@^1.1.6: + version "1.11.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.1.tgz#ea10d8110376982fef578df8fc30b9ac30a07a3e" + integrity sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw== + dependencies: + path-parse "^1.0.6" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +rimraf@~2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + integrity sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74= + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + integrity sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ= + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^5.3.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + integrity sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg== + dependencies: + is-fullwidth-code-point "^2.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +string-width@^2.1.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" + integrity sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w== + dependencies: + has-flag "^3.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +table@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" + integrity sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA== + dependencies: + ajv "^5.2.3" + ajv-keywords "^2.1.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" + +text-table@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +type-detect@0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-0.1.1.tgz#0ba5ec2a885640e470ea4e8505971900dac58822" + integrity sha1-C6XsKohWQORw6k6FBZcZANrFiCI= + +type-detect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-1.0.0.tgz#762217cc06db258ec48908a1298e8b95121e8ea2" + integrity sha1-diIXzAbbJY7EiQihKY6LlRIejqI= + +type@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/type/-/type-1.0.1.tgz#084c9a17fcc9151a2cdb1459905c2e45e4bb7d61" + integrity sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw== + +typedarray@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" + integrity sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c= + dependencies: + mkdirp "^0.5.1" + +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + integrity sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI= From 8873d9c093c443b6915e9e1bc3a46949862e1524 Mon Sep 17 00:00:00 2001 From: Nathan Schwarz Date: Sat, 27 Jun 2020 13:44:28 +0200 Subject: [PATCH 07/10] added documentation to README --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 3409a3f..271a4f7 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,36 @@ Use a number greater then 0 for the _SIZE_ value. `--no-final-newline, -nn`\ No final new line will be added to the end of the file. +`--key '$._id', -k '$._id'`\ +Will sort an array wether it's nested in an object or even in an other array (using mongoDB like operators) : + +the Key must be formated this way : + +`$` : is an array. +`.key`: is a properity. + +for example: + +`$.foo.bar.$` : will sort all the arrays contained in every bar of foo in the main array : + +` +[ + { + foo: { + bar: [ this array will be sorted ] + } + }, + { + foo: { + bar: [ this array will be sorted too ] + } + } +] +` + + +`--DESC'`\ +Reverse the ordering of an array (to use with `--key` option). ## Upgrade to version 2.x From 8a27a8bf6bb68e1547b6ddb7dab64a144aee4231 Mon Sep 17 00:00:00 2001 From: Nathan Schwarz Date: Sat, 27 Jun 2020 13:45:45 +0200 Subject: [PATCH 08/10] added documentation to README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 271a4f7..7ec1cf5 100644 --- a/README.md +++ b/README.md @@ -62,11 +62,11 @@ for example: `$.foo.bar.$` : will sort all the arrays contained in every bar of foo in the main array : ` -[ - { - foo: { - bar: [ this array will be sorted ] - } +[\ + {\ + foo: {\ + bar: [ this array will be sorted ]\ + }\ }, { foo: { From a8b3a830f5d30773b6655e72034f858ee963949d Mon Sep 17 00:00:00 2001 From: Nathan Schwarz Date: Sat, 27 Jun 2020 13:51:01 +0200 Subject: [PATCH 09/10] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 7ec1cf5..cacdf03 100644 --- a/README.md +++ b/README.md @@ -61,12 +61,12 @@ for example: `$.foo.bar.$` : will sort all the arrays contained in every bar of foo in the main array : -` -[\ - {\ - foo: {\ - bar: [ this array will be sorted ]\ - }\ +``` +[ + { + foo: { + bar: [ this array will be sorted ] + } }, { foo: { @@ -74,7 +74,7 @@ for example: } } ] -` +``` `--DESC'`\ From 2aa92ef25a85d0f4ff03e18d745e630d37e678bf Mon Sep 17 00:00:00 2001 From: Nathan Schwarz Date: Sat, 27 Jun 2020 13:52:28 +0200 Subject: [PATCH 10/10] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cacdf03..91919c1 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Will sort an array wether it's nested in an object or even in an other array (us the Key must be formated this way : -`$` : is an array. +`$` : is an array.\ `.key`: is a properity. for example: