├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc ├── .gitignore ├── .npmignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── benchmark.js ├── demos ├── apply │ ├── index.html │ └── script.js ├── buildRevertPatch │ ├── index.html │ └── script.js ├── diff │ ├── index.html │ └── script.js ├── pack │ ├── index.html │ └── script.js ├── script.js └── style.css ├── index.js ├── lib ├── add.js ├── apply.js ├── buildRevertPatch.js ├── compile.js ├── concat.js ├── copy.js ├── diff.js ├── get.js ├── has.js ├── move.js ├── pack.js ├── patch.js ├── remove.js ├── replace.js ├── revert.js ├── test.js ├── unpack.js ├── valid.js └── walk.js ├── package.json ├── test ├── .eslintrc ├── RFC.js ├── add.js ├── concat.js ├── copy.js ├── diff.js ├── diff.json ├── get.js ├── has.js ├── json-patch-test-suite.js ├── move.js ├── pack.js ├── remove.js └── replace.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"] 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | end_of_line = lf 7 | insert_final_newline = true 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | indent_style = space 11 | indent_size = 2 12 | charset = utf-8 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | JSON8Patch.js 2 | demos/ 3 | lib/compile.js 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | node: true 3 | 4 | rules: 5 | # Possible Errors 6 | no-console: 2 7 | valid-jsdoc: [2, {requireReturn: false, requireReturnDescription: false}] 8 | 9 | # Best Practices 10 | consistent-return: 0 11 | curly: 0 12 | block-scoped-var: 2 13 | no-else-return: 2 14 | no-process-env: 2 15 | no-self-compare: 2 16 | no-throw-literal: 2 17 | no-void: 2 18 | radix: 2 19 | wrap-iife: [2, outside] 20 | 21 | # Strict Mode 22 | strict: 2 23 | 24 | # Variables 25 | no-shadow: 0 26 | no-use-before-define: [2, nofunc] 27 | 28 | # Node.js 29 | no-process-exit: 0 30 | handle-callback-err: [2, err] 31 | no-new-require: 2 32 | no-path-concat: 2 33 | 34 | # Stylistic Issues 35 | quotes: 0 36 | camelcase: 0 37 | indent: [2, 2] 38 | no-lonely-if: 2 39 | no-floating-decimal: 2 40 | comma-dangle: [2, always-multiline] 41 | brace-style: [2, stroustrup] 42 | comma-style: [2, last] 43 | consistent-this: [0, that] 44 | max-nested-callbacks: [2, 3] 45 | no-multiple-empty-lines: [2, {max: 1}] 46 | no-nested-ternary: 2 47 | semi: [2, never] 48 | semi-spacing: 0 49 | operator-assignment: [2, always] 50 | padded-blocks: [2, never] 51 | space-before-function-parentheses: [2, never] 52 | space-after-keywords: [2, always] 53 | space-before-blocks: [2, always] 54 | space-in-brackets: [2, never] 55 | space-in-parens: [2, never] 56 | space-unary-ops: [2, {words: true, nonwords: false}] 57 | spaced-line-comment: [2, always] 58 | wrap-regex: 2 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | !.babelrc 2 | !.editorconfig 3 | !.eslintignore 4 | !.eslintrc 5 | !.gitignore 6 | !.npmignore 7 | !.travis.yml 8 | 9 | JSON8Patch.js 10 | node_modules/ 11 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | test/ 2 | 3 | .babelrc 4 | .editorconfig 5 | .eslintignore 6 | .eslintrc 7 | .gitignore 8 | .travis.yml 9 | 10 | CONTRIBUTING.md 11 | LICENSE 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: node_js 4 | 5 | node_js: 6 | - '0.10' 7 | - '0.12' 8 | - '4' 9 | - '5' 10 | - '6' 11 | 12 | before_install: 13 | - npm install mocha browserify 14 | 15 | script: 16 | - npm test 17 | - npm run benchmark 18 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | CONTRIBUTING 2 | ============ 3 | 4 | JSON8 is written in ES5, tests are written in ES6. 5 | 6 | 1. ```npm install browserify mocha``` 7 | 2. Edit the files, make sure to adopt the same coding style 8 | 3. Add unit tests for your modifications 9 | 4. Run ```npm test``` to execute unit tests and check syntax 10 | 5. Submit a pull request 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Sonny Piers 2 | 3 | Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. 4 | 5 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | IMPORTANT 2 | ========= 3 | 4 | This package moved to a monorepo. 5 | https://github.com/sonnyp/JSON8/tree/master/packages/patch 6 | 7 | ------ 8 | 9 | 10 | JSON8 Patch 11 | =========== 12 | 13 | [![build status](https://img.shields.io/travis/JSON8/patch.svg?style=flat-square)](https://travis-ci.org/JSON8/patch/branches) 14 | 15 | JSON Patch [RFC 6902](http://tools.ietf.org/html/rfc6902) (and diff) implementation for JavaScript. 16 | 17 | See [jsonpatch.com](http://jsonpatch.com) for more information about JSON Patch. 18 | 19 | JSON8 Patch passes the entire [json-patch-tests](https://github.com/json-patch/json-patch-tests) suite; see [Tests](#tests) 20 | 21 | * [Comparison](#comparison) 22 | * [Getting started](#getting-started) 23 | * [Methods](#methods) 24 | * [apply](#apply) 25 | * [patch](#patch) 26 | * [revert](#revert) 27 | * [buildRevertPatch](#buildrevertpatch) 28 | * [diff](#diff) 29 | * [valid](#valid) 30 | * [concat](#concat) 31 | * [Operations](#operations) 32 | * [add](#add) 33 | * [remove](#remove) 34 | * [replace](#replace) 35 | * [move](#move) 36 | * [copy](#copy) 37 | * [test](#test) 38 | * [Extra operations](#extra-operations) 39 | * [get](#get) 40 | * [has](#has) 41 | * [Patch size](#patch-size) 42 | * [pack](#pack) 43 | * [unpack](#unpack) 44 | * [Tests](#tests) 45 | * [Contributing](#contributing) 46 | 47 | # Comparison 48 | 49 | |module | root[0](#root) | atomic[1](#atomic) | mutates[2](#mutates)| 50 | |-----------------------------------------------------------------|--------------------------|-------------------------------|--------------------------------| 51 | |**json8-patch** | ☑ | ☑ | ☑ | 52 | |[jsonpatch](https://github.com/dharmafly/jsonpatch.js) | ☑ | ☐ | ☑ | 53 | |[jiff](https://github.com/cujojs/jiff) | ☑ | ☐ | ☑ | 54 | |[json-patch](https://github.com/bruth/jsonpatch-js) | ☐ | ☐ | ☑ | 55 | |[fast-json-patch](https://github.com/Starcounter-Jack/JSON-Patch)| ☐ | ☐ | ☑  | 56 | 57 | # Getting started 58 | 59 | ```npm install json8-patch``` 60 | 61 | ---- 62 | 63 | ```javascript 64 | var ooPatch = require('json8-patch'); 65 | ``` 66 | 67 | or 68 | 69 | ```xml 70 | 71 | ``` 72 | ```javascript 73 | var ooPatch = window.JSON8Patch 74 | ``` 75 | 76 | For performance concerns JSON8 Patch may mutate target document; if you want it to use its own copy use: 77 | 78 | ```javascript 79 | var oo = require('json8') 80 | var myDocument = {foo: 'bar'} 81 | var doc = oo.clone(myDocument) 82 | ``` 83 | 84 | See [clone](https://github.com/JSON8/JSON8#ooclone). 85 | 86 | JSON8 Patch never mutates patches. 87 | 88 | [↑](#json8-pointer) 89 | 90 | # Methods 91 | 92 | ## apply 93 | 94 | [demo/playground](https://json8.github.io/patch/demos/apply/) 95 | 96 | ```javascript 97 | doc = ooPatch.apply(doc, patch).doc; 98 | ``` 99 | 100 | ```ooPatch.apply``` (and other ooPatch methods) returns an object with a doc property because per specification a patch can replace the original root document. 101 | 102 | The operation is atomic, if any of the patch operation fails, the document will be restored to its original state and an error will be thrown. 103 | 104 | [↑](#json8-patch) 105 | 106 | ## patch 107 | 108 | Alias for [apply](#apply) method. 109 | 110 | [↑](#json8-patch) 111 | 112 | ## revert 113 | 114 | If the [patch](#patch) or [apply](#apply) method is called with a third argument ```{reversible: true}``` it will return an additional value in the form of a ```revert``` property. 115 | 116 | The revert object can be used to revert a patch on a document. 117 | 118 | ```javascript 119 | // apply the patch with the reversible option 120 | var applyResult = ooPatch.apply(doc, patch, {reversible: true}); 121 | doc = applyResult.doc 122 | 123 | // revert the patch 124 | doc = ooPatch.revert(doc, applyResult.revert).doc; 125 | // doc is strictly identical to the original 126 | ``` 127 | 128 | See also [buildRevertPatch](#buildrevertpatch) which offers more flexibility. 129 | 130 | [↑](#json8-patch) 131 | 132 | ## buildRevertPatch 133 | 134 | [demo/playground](https://json8.github.io/patch/demos/buildRevertPatch/) 135 | 136 | Builds a valid JSON Patch from the result of a reversible apply operation. 137 | You can then use this patch with [apply](#apply) method to revert a previously applied patch. 138 | 139 | ```javascript 140 | // apply the patch 141 | var applyResult = ooPatch.apply(doc, patch, {reversible: true}); 142 | doc = applyResult.doc 143 | 144 | // revert the patch 145 | var revertPatch = ooPatch.buildRevertPatch(applyResult.revert) // this is a valid JSON Patch 146 | doc = ooPatch.apply(doc, revertPatch).doc 147 | // doc is strictly identical to the original 148 | ``` 149 | 150 | Because `buildRevertPatch + apply` offers more flexibility over `revert` it is preferred. 151 | 152 | * use [pack/unpack](#patch-size) with the result of `buildRevertPatch` making it ideal for storage or transport 153 | * reverse a revert (and so on...) with `{reversible: true}` 154 | * [diff](#diff) between reverts 155 | * merge multiple reverts into one 156 | * rebase reverts 157 | 158 | [↑](#json8-patch) 159 | 160 | ## diff 161 | 162 | [demo/playground](https://json8.github.io/patch/demos/diff/) 163 | 164 | Returns a diff in the form of a JSON Patch for 2 JSON values. 165 | 166 | ```javascript 167 | ooPatch.diff(true, false) 168 | // [{"op": "replace", "path": "", "value": "false"}] 169 | 170 | ooPatch.diff([], []) 171 | // [] 172 | 173 | ooPatch.diff({}, {"foo": "bar"}) 174 | // [{"op": "add", "path": "/foo", "value": "bar"}] 175 | ``` 176 | 177 | [↑](#json8-patch) 178 | 179 | ## valid 180 | 181 | Returns ```true``` if the patch is valid, ```false``` otherwise. 182 | 183 | This method _only_ check for JSON Patch semantic. 184 | If you need to verify the patch is JSON valid, use [oo.valid](https://github.com/JSON8/JSON8#oovalid) 185 | 186 | ```javascript 187 | ooPatch.valid({}) // false 188 | ooPatch.valid([{}] // false 189 | ooPatch.valid([{op: "foo", path: null, value: undefined}]) // false 190 | ooPatch.valid([{op: "add", path: "/foo"}]) // false 191 | 192 | ooPatch.valid([]) // true 193 | ooPatch.valid([{op: "add", path: "/foo", value: "bar"}]) // true 194 | ``` 195 | 196 | [↑](#json8-patch) 197 | 198 | ## concat 199 | 200 | Concats multiple patches into one. 201 | 202 | ```javascript 203 | var patch1 = [{op: "add", value: "bar", path: "/foo"}] 204 | var patch2 = [{op: "remove", path: "/foo"}] 205 | var patch = ooPatch.concat(patch1, patch2) 206 | 207 | // patch is 208 | [ 209 | {op: "add", value: "bar", path: "/foo"}, 210 | {op: "remove", path: "/foo"} 211 | ] 212 | ``` 213 | 214 | [↑](#json8-patch) 215 | 216 | ## Operations 217 | 218 | ```add```, ```copy```, ```replace```, ```move```, ```remove```, ```test``` operations return an object of the form ```{doc: document, previous: value}``` 219 | 220 | * ```doc``` is the patched document 221 | * ```previous``` is the previous/replaced value 222 | 223 | ### add 224 | ```javascript 225 | doc = ooPatch.add(doc, '/foo', 'foo').doc; 226 | ``` 227 | 228 | [↑](#json8-patch) 229 | 230 | ### remove 231 | ```javascript 232 | doc = ooPatch.remove(doc, '/foo').doc; 233 | ``` 234 | 235 | [↑](#json8-patch) 236 | 237 | ### replace 238 | ```javascript 239 | doc = ooPatch.replace(doc, '/foo', 'foo').doc; 240 | ``` 241 | 242 | [↑](#json8-patch) 243 | 244 | ### move 245 | ```javascript 246 | doc = ooPatch.move(doc, '/foo', '/bar').doc; 247 | ``` 248 | 249 | [↑](#json8-patch) 250 | 251 | ### copy 252 | ```javascript 253 | doc = ooPatch.copy(doc, '/foo', '/bar').doc; 254 | ``` 255 | 256 | [↑](#json8-patch) 257 | 258 | ### test 259 | ```javascript 260 | doc = ooPatch.test(doc, '/foo', 'bar').doc; 261 | ``` 262 | 263 | [↑](#json8-patch) 264 | 265 | ## Extra operations 266 | 267 | Those are not part of the standard and are only provided for convenience. 268 | 269 | ### get 270 | ```javascript 271 | ooPatch.get(doc, '/foo'); 272 | // returns value at /foo 273 | ``` 274 | 275 | [↑](#json8-patch) 276 | 277 | ### has 278 | ```javascript 279 | ooPatch.has(doc, '/foo'); 280 | // returns true if there is a value at /foo 281 | ``` 282 | 283 | [↑](#json8-patch) 284 | 285 | ## Patch size 286 | 287 | Per specification patches are pretty verbose. JSON8 provides [pack](#patch) and [unpack](#unpack) methods to reduce the size of patches and save memory/space/bandwidth. 288 | 289 | Size (in bytes) comparaison for the following patch file 290 | 291 | ```json 292 | [ 293 | {"op": "add", "path": "/a/b/c", "value": ["foo", "bar"]}, 294 | {"op": "remove", "path": "/a/b/c"}, 295 | {"op": "replace", "path": "/a/b/c", "value": 42}, 296 | {"op": "move", "from": "/a/b/c", "path": "/a/b/d"}, 297 | {"op": "copy", "from": "/a/b/c", "path": "/a/b/e"}, 298 | {"op": "test", "path": "/a/b/c", "value": "foo"} 299 | ] 300 | ``` 301 | 302 | | format | size (in bytes) | 303 | |:-------------:|:---------------:| 304 | | unpacked | 313 | 305 | | unpacked gzip | 148 | 306 | | packed | 151 | 307 | | packed gzip | 99 | 308 | 309 | In pratice I'd recommand to use pack/unpack if 310 | 311 | * data compression cannot be used on the transport of the patch 312 | * keeping a large amount of patches in memory/on disk 313 | 314 | [↑](#json8-patch) 315 | 316 | ### pack 317 | 318 | [demo/playground](https://json8.github.io/patch/demos/pack/) 319 | 320 | ```javascript 321 | var patch = [ 322 | {"op": "add", "path": "/a/b/c", "value": ["foo", "bar"]}, 323 | {"op": "remove", "path": "/a/b/c"}, 324 | {"op": "replace", "path": "/a/b/c", "value": 42}, 325 | {"op": "move", "from": "/a/b/c", "path": "/a/b/d"}, 326 | {"op": "copy", "from": "/a/b/c", "path": "/a/b/e"}, 327 | {"op": "test", "path": "/a/b/c", "value": "foo"} 328 | ]; 329 | 330 | var packed = ooPatch.pack(patch); 331 | ``` 332 | 333 | Here is what packed looks like 334 | 335 | ```json 336 | [ 337 | [0, "/a/b/c", ["foo", "bar"]], 338 | [1, "/a/b/c"], 339 | [2, "/a/b/c", 42], 340 | [3, "/a/b/d", "/a/b/c"], 341 | [4, "/a/b/e", "/a/b/c"], 342 | [5, "/a/b/c", "foo"], 343 | ] 344 | ``` 345 | 346 | [↑](#json8-patch) 347 | 348 | ### unpack 349 | 350 | [demo/playground](https://json8.github.io/patch/demos/pack/) 351 | 352 | ```javascript 353 | var patch = ooPatch.unpack(packed); 354 | // [{...}, {...}, ...] 355 | ``` 356 | 357 | [↑](#json8-patch) 358 | 359 | ### 360 | 361 | # Tests 362 | 363 | ``` 364 | npm install mocha browserify 365 | npm test 366 | ``` 367 | 368 | [↑](#json8-patch) 369 | 370 | # Contributing 371 | 372 | See [CONTRIBUTING.md](https://github.com/JSON8/patch/blob/master/CONTRIBUTING.md) 373 | 374 | [↑](#json8-patch) 375 | 376 | ##### Footnotes 377 | 378 | ###### root 379 | 380 | Refers to the library ability to replace/remove root (/) on your target. 381 | 382 | Lack of this ability makes the library unable to comply with the specification and will result in unknown/inconsistent states for your target documents. 383 | 384 | ```json 385 | [ 386 | {"op": "replace", "path": "/", "value": "{}"}, 387 | {"op": "remove", "path": "/"} 388 | ] 389 | ``` 390 | 391 | ###### atomic 392 | 393 | Refers to the library ability to revert successful patch operations after a failure on the mutated target. 394 | 395 | Lack of this ability makes the library unable to comply with the specification and will result in unknown/inconsistent states for your target documents. 396 | 397 | https://tools.ietf.org/html/rfc6902#section-5 398 | 399 | ###### mutates 400 | 401 | Refers to the ability of the library to mutates the target document. 402 | 403 | It is best to choose a library which mutate the target document because it leaves you with the choice of creating a shallow copy first. 404 | 405 | * [JSON8 clone](https://www.npmjs.com/package/json8#ooclone) 406 | * [lodash clone](https://www.npmjs.com/package/lodash.clone) 407 | * [underscore clone](http://underscorejs.org/#clone) 408 | * ... 409 | 410 | [↑](#json8-patch) 411 | -------------------------------------------------------------------------------- /benchmark.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /* eslint-disable no-console */ 4 | 5 | var benchmark = require('benchmark') 6 | var ooPatch = require('./index') 7 | var jsonpatch = require('jsonpatch') // https://github.com/dharmafly/jsonpatch.js 8 | var json_patch = require('json-patch') // https://github.com/bruth/jsonpatch-js 9 | var jiff = require('jiff') // https://github.com/cujojs/jiff 10 | var fastjsonpatch = require('fast-json-patch') // https://github.com/Starcounter-Jack/JSON-Patch 11 | 12 | var doc = { 13 | "foo": [1, 2, 3, 4], 14 | "baz": [{ 15 | "qux": "hello", 16 | }], 17 | } 18 | 19 | var patch = [{ 20 | "op": "replace", 21 | "path": "/baz/0/qux", 22 | "value": "world", 23 | }] 24 | 25 | benchmark.Suite('apply patch') // eslint-disable-line 26 | .add('github: json8/patch - npm: json8-patch', function() { 27 | ooPatch.apply(doc, patch) 28 | }) 29 | .add('github: dharmafly/jsonpatch.js / npm: jsonpatch', function() { 30 | jsonpatch.apply_patch(doc, patch) 31 | }) 32 | .add('github: bruth/jsonpatch-js / npm: json_patch', function() { 33 | json_patch.apply(doc, patch) 34 | }) 35 | .add('github: cujojs/jiff / npm: jiff', function() { 36 | jiff.patch(patch, doc) 37 | }) 38 | .add('github: Starcounter-Jack/JSON-Patch / npm: fast-json-patch', function() { 39 | fastjsonpatch.apply(doc, patch) 40 | }) 41 | .on('cycle', function(event) { 42 | console.log(event.target.toString()) 43 | }) 44 | .on('complete', function() { 45 | console.log('Fastest is ' + this.filter('fastest').map('name')) 46 | }) 47 | .run() 48 | -------------------------------------------------------------------------------- /demos/apply/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | JSON8 Patch apply demo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |

This is a live editor. Editting input or patch will update output instantly.

38 | 39 |
40 |

input

41 | 42 |
45 |

patch

46 | 47 |
50 |

output

51 | 52 |
53 | 54 |
55 |
56 |         
57 | output = ooPatch.apply(input, patch}).doc
58 |       
59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /demos/apply/script.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict' 3 | 4 | var ooPatch = JSON8Patch 5 | 6 | var sections = [ 7 | { 8 | id: 'target', 9 | value: { 10 | "firstName": "John", 11 | "lastName": "Smith", 12 | "age": 25, 13 | "address": { 14 | "streetAddress": "21 2nd Street", 15 | "city": "New York", 16 | "state": "NY", 17 | "postalCode": "10021" 18 | }, 19 | "phoneNumber": [ 20 | { 21 | "type": "home", 22 | "number": "212 555-1234" 23 | }, 24 | { 25 | "type": "fax", 26 | "number": "646 555-4567" 27 | } 28 | ], 29 | "gender": { 30 | "type": "male" 31 | } 32 | } 33 | }, 34 | { 35 | id: 'patch', 36 | value: [ 37 | {"path": "/age", "op": "replace", "value": 26}, 38 | {"path": "/phoneNumber/1", "op": "remove"} 39 | ] 40 | }, 41 | { 42 | id: 'result' 43 | } 44 | ] 45 | 46 | var editors = {} 47 | 48 | document.addEventListener('DOMContentLoaded', function () { 49 | sections.forEach(function (section) { 50 | var input = section.textarea = document.querySelector('#' + section.id + ' textarea') 51 | 52 | if (section.value) { 53 | input.value = JSON.stringify(section.value, null, 2) 54 | } 55 | 56 | editors[section.id] = section.editor = CodeMirror.fromTextArea(section.textarea, { 57 | lineNumbers: true, 58 | mode: section.value ? "application/json" : "text/plain", 59 | gutters: ["CodeMirror-lint-markers", "CodeMirror-foldgutter"], 60 | lint: true, 61 | matchBrackets: true, 62 | autoCloseBrackets: true, 63 | foldGutter: true, 64 | readOnly: section.id === 'result' 65 | }) 66 | }) 67 | 68 | function run () { 69 | var target 70 | var patch 71 | 72 | try { 73 | target = JSON.parse(editors['target'].getValue()) 74 | } catch (e) { 75 | editors['result'].setOption('mode', 'text/plain'); 76 | editors['result'].setValue('target is not valid JSON\n\n' + e) 77 | return 78 | } 79 | 80 | try { 81 | patch = JSON.parse(editors['patch'].getValue()) 82 | } catch (e) { 83 | editors['result'].setOption('mode', 'text/plain'); 84 | editors['result'].setValue('patch is not valid JSON\n\n' + e) 85 | return 86 | } 87 | 88 | var applyResult 89 | 90 | try { 91 | applyResult = ooPatch.apply(target, patch) 92 | } catch (e) { 93 | editors['result'].setOption('mode', 'text/plain'); 94 | editors['result'].setValue('patch is not valid\n\n' + e) 95 | return 96 | } 97 | 98 | editors['result'].setOption('mode', 'application/json'); 99 | editors['result'].setValue(JSON.stringify(applyResult.doc, null, 2)) 100 | } 101 | 102 | [editors['target'], editors['patch']].forEach(function (editor) { 103 | editor.on('change', function () { 104 | run() 105 | }) 106 | }) 107 | 108 | run() 109 | }) 110 | }()) 111 | -------------------------------------------------------------------------------- /demos/buildRevertPatch/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | JSON8 Patch buildRevertPatch demo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 |

This is a live editor. Editting input or patch will update revert instantly.

39 | 40 |
41 |

input

42 | 43 |
46 |

patch

47 | 48 |
51 |

revert

52 | 53 |
54 | 55 |
56 |
57 |         
58 | var applyResult = ooPatch.apply(input, patch, {reversible: true})
59 | revert = ooPatch.buildRevertPatch(applyResult.revert)
60 |       
61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /demos/buildRevertPatch/script.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict' 3 | 4 | var ooPatch = JSON8Patch 5 | 6 | var sections = [ 7 | { 8 | id: 'target', 9 | value: { 10 | "firstName": "John", 11 | "lastName": "Smith", 12 | "age": 25, 13 | "address": { 14 | "streetAddress": "21 2nd Street", 15 | "city": "New York", 16 | "state": "NY", 17 | "postalCode": "10021" 18 | }, 19 | "phoneNumber": [ 20 | { 21 | "type": "home", 22 | "number": "212 555-1234" 23 | }, 24 | { 25 | "type": "fax", 26 | "number": "646 555-4567" 27 | } 28 | ], 29 | "gender": { 30 | "type": "male" 31 | } 32 | } 33 | }, 34 | { 35 | id: 'patch', 36 | value: [ 37 | {"path": "/age", "op": "replace", "value": 26}, 38 | {"path": "/phoneNumber/1", "op": "remove"} 39 | ] 40 | }, 41 | { 42 | id: 'result' 43 | } 44 | ] 45 | 46 | var editors = {} 47 | 48 | document.addEventListener('DOMContentLoaded', function () { 49 | // CodeMirror.fromTextArea(document.getElementById('example'), { 50 | // mode: 'application/javascript' 51 | // }) 52 | 53 | sections.forEach(function (section) { 54 | var input = section.textarea = document.querySelector('#' + section.id + ' textarea') 55 | 56 | if (section.value) { 57 | input.value = JSON.stringify(section.value, null, 2) 58 | } 59 | 60 | editors[section.id] = section.editor = CodeMirror.fromTextArea(section.textarea, { 61 | lineNumbers: true, 62 | mode: section.value ? "application/json" : "text/plain", 63 | gutters: ["CodeMirror-lint-markers", "CodeMirror-foldgutter"], 64 | lint: true, 65 | matchBrackets: true, 66 | autoCloseBrackets: true, 67 | foldGutter: true, 68 | readOnly: section.id === 'result' 69 | }) 70 | }) 71 | 72 | function run () { 73 | var target 74 | var patch 75 | 76 | try { 77 | target = JSON.parse(editors['target'].getValue()) 78 | } catch (e) { 79 | editors['result'].setOption('mode', 'text/plain'); 80 | editors['result'].setValue('target is not valid JSON\n\n' + e) 81 | return 82 | } 83 | 84 | try { 85 | patch = JSON.parse(editors['patch'].getValue()) 86 | } catch (e) { 87 | editors['result'].setOption('mode', 'text/plain'); 88 | editors['result'].setValue('patch is not valid JSON\n\n' + e) 89 | return 90 | } 91 | 92 | var applyResult 93 | 94 | try { 95 | applyResult = ooPatch.apply(target, patch, {reversible: true}) 96 | } catch (e) { 97 | editors['result'].setOption('mode', 'text/plain'); 98 | editors['result'].setValue('patch is not valid\n\n' + e) 99 | return 100 | } 101 | 102 | editors['result'].setOption('mode', 'application/json'); 103 | editors['result'].setValue(JSON.stringify(ooPatch.buildRevertPatch(applyResult.revert), null, 2)) 104 | } 105 | 106 | [editors['target'], editors['patch']].forEach(function (editor) { 107 | editor.on('change', function () { 108 | run() 109 | }) 110 | }) 111 | 112 | run() 113 | }) 114 | }()) 115 | -------------------------------------------------------------------------------- /demos/diff/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | JSON8 Patch diff demo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |

This is a live editor. Editing original or edited updates patch instantly.

38 | 39 |
40 |

original

41 | 42 |
45 |

edited

46 | 47 |
50 |

patch

51 | 52 |
53 | 54 |
55 |
56 |         
57 |   patch = ooPatch.diff(original, edited)
58 |       
59 |
60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /demos/diff/script.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict' 3 | 4 | var ooPatch = JSON8Patch 5 | 6 | var sections = [ 7 | { 8 | id: 'input', 9 | value: { 10 | "firstName": "John", 11 | "lastName": "Smith", 12 | "age": 25, 13 | "address": { 14 | "streetAddress": "21 2nd Street", 15 | "city": "New York", 16 | "state": "NY", 17 | "postalCode": "10021" 18 | }, 19 | "phoneNumber": [ 20 | { 21 | "type": "home", 22 | "number": "212 555-1234" 23 | }, 24 | { 25 | "type": "fax", 26 | "number": "646 555-4567" 27 | } 28 | ], 29 | "gender": { 30 | "type": "male" 31 | } 32 | } 33 | }, 34 | { 35 | id: 'patch' 36 | }, 37 | { 38 | id: 'output', 39 | value: { 40 | "firstName": "John", 41 | "lastName": "Smith", 42 | "age": 25, 43 | "address": { 44 | "streetAddress": "21 2nd Street", 45 | "city": "New York", 46 | "state": "NY", 47 | "postalCode": "10021" 48 | }, 49 | "gender": { 50 | "type": "male" 51 | } 52 | } 53 | } 54 | ] 55 | 56 | var editors = {} 57 | 58 | document.addEventListener('DOMContentLoaded', function () { 59 | sections.forEach(function (section) { 60 | var input = section.textarea = document.querySelector('#' + section.id + ' textarea') 61 | 62 | if (section.value) { 63 | input.value = JSON.stringify(section.value, null, 2) 64 | } 65 | 66 | editors[section.id] = section.editor = CodeMirror.fromTextArea(section.textarea, { 67 | lineNumbers: true, 68 | mode: section.value ? "application/json" : "text/plain", 69 | gutters: ["CodeMirror-lint-markers", "CodeMirror-foldgutter"], 70 | lint: true, 71 | matchBrackets: true, 72 | autoCloseBrackets: true, 73 | foldGutter: true, 74 | readOnly: section.id === 'patch' 75 | }) 76 | }) 77 | 78 | function run () { 79 | var input 80 | var output 81 | 82 | try { 83 | input = JSON.parse(editors['input'].getValue()) 84 | } catch (e) { 85 | editors['patch'].setOption('mode', 'text/plain'); 86 | editors['patch'].setValue('original is not valid JSON\n\n' + e) 87 | return 88 | } 89 | 90 | try { 91 | output = JSON.parse(editors['output'].getValue()) 92 | } catch (e) { 93 | editors['patch'].setOption('mode', 'text/plain'); 94 | editors['patch'].setValue('edited is not valid JSON\n\n' + e) 95 | return 96 | } 97 | 98 | var diffResult 99 | 100 | try { 101 | diffResult = ooPatch.diff(input, output) 102 | } catch (e) { 103 | editors['patch'].setOption('mode', 'text/plain'); 104 | editors['patch'].setValue('patch is not valid\n\n' + e) 105 | return 106 | } 107 | 108 | editors['patch'].setOption('mode', 'application/json'); 109 | editors['patch'].setValue(JSON.stringify(diffResult, null, 2)) 110 | } 111 | 112 | [editors['input'], editors['output']].forEach(function (editor) { 113 | editor.on('change', run) 114 | }) 115 | 116 | run() 117 | }) 118 | }()) 119 | -------------------------------------------------------------------------------- /demos/pack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | JSON8 Patch pack demo 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |

This is a live editor. Editting patch updates packed and unpacked instantly. 38 | 39 |

40 |

patch

41 | 42 | size: bytes (w/o whitespaces) 43 |
46 |

packed

47 | 48 | size: bytes (w/o whitespaces) 49 |
52 |

unpacked

53 | 54 | size: bytes (w/o whitespaces) 55 |
56 | 57 |
58 |
59 |         
60 | packed = ooPatch.pack(patch)
61 | unpacked = ooPatch.unpack(packed)
62 |       
63 |
64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /demos/pack/script.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict' 3 | 4 | var ooPatch = JSON8Patch 5 | 6 | var sections = [ 7 | { 8 | id: 'input', 9 | value: [ 10 | {"op": "add", "path": "/a/b/c", "value": ["foo", "bar"]}, 11 | {"op": "remove", "path": "/a/b/c"}, 12 | {"op": "replace", "path": "/a/b/c", "value": 42}, 13 | {"op": "move", "from": "/a/b/c", "path": "/a/b/d"}, 14 | {"op": "copy", "from": "/a/b/c", "path": "/a/b/e"}, 15 | {"op": "test", "path": "/a/b/c", "value": "foo"} 16 | ] 17 | }, 18 | { 19 | id: 'output' 20 | }, 21 | { 22 | id: 'unpacked' 23 | } 24 | ] 25 | 26 | var editors = {} 27 | 28 | // returns the byte length of an utf8 string 29 | function byteLength(str) { 30 | var s = str.length; 31 | for (var i=str.length-1; i>=0; i--) { 32 | var code = str.charCodeAt(i); 33 | if (code > 0x7f && code <= 0x7ff) s++; 34 | else if (code > 0x7ff && code <= 0xffff) s+=2; 35 | if (code >= 0xDC00 && code <= 0xDFFF) i--; //trail surrogate 36 | } 37 | return s; 38 | } 39 | 40 | document.addEventListener('DOMContentLoaded', function () { 41 | sections.forEach(function (section) { 42 | var input = section.textarea = document.querySelector('#' + section.id + ' textarea') 43 | 44 | if (section.value) { 45 | input.value = JSON.stringify(section.value, null, 2) 46 | } 47 | 48 | editors[section.id] = section.editor = CodeMirror.fromTextArea(section.textarea, { 49 | lineNumbers: true, 50 | mode: section.value ? "application/json" : "text/plain", 51 | gutters: ["CodeMirror-lint-markers", "CodeMirror-foldgutter"], 52 | lint: true, 53 | matchBrackets: true, 54 | autoCloseBrackets: true, 55 | foldGutter: true, 56 | readOnly: section.id === 'result' 57 | }) 58 | }) 59 | 60 | function run () { 61 | var input 62 | 63 | try { 64 | input = JSON.parse(editors['input'].getValue()) 65 | } catch (e) { 66 | editors['output'].setOption('mode', 'text/plain'); 67 | editors['output'].setValue('target is not valid JSON\n\n' + e) 68 | return 69 | } 70 | 71 | var packResult 72 | 73 | try { 74 | packResult = ooPatch.pack(input) 75 | } catch (e) { 76 | editors['output'].setOption('mode', 'text/plain'); 77 | editors['output'].setValue('patch is not valid\n\n' + e) 78 | return 79 | } 80 | 81 | editors['output'].setOption('mode', 'application/json'); 82 | editors['output'].setValue(JSON.stringify(packResult, null, 2)) 83 | 84 | var unpackResult 85 | try { 86 | unpackResult = ooPatch.unpack(JSON.parse(editors.output.getValue())) 87 | } catch (e) { 88 | return 89 | } 90 | editors.unpacked.setOption('mode', 'application/json') 91 | editors['unpacked'].setValue(JSON.stringify(unpackResult, null, 2)) 92 | 93 | 94 | document.querySelector('#input .size').textContent = byteLength(JSON.stringify(JSON.parse(editors['input'].getValue()))) 95 | document.querySelector('#output .size').textContent = byteLength(JSON.stringify(JSON.parse(editors['output'].getValue()))) 96 | document.querySelector('#unpacked .size').textContent = byteLength(JSON.stringify(JSON.parse(editors['unpacked'].getValue()))) 97 | } 98 | 99 | editors['input'].on('change', function () { 100 | run() 101 | }) 102 | 103 | run() 104 | }) 105 | }()) 106 | -------------------------------------------------------------------------------- /demos/script.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | 'use strict' 3 | 4 | // small hack to highlight token target in code example 5 | 6 | var highlighted = [] 7 | 8 | function highlight (el) { 9 | el.classList.add('highlight') 10 | highlighted.push(el) 11 | } 12 | 13 | function unhighlightAll () { 14 | highlighted.forEach(function (el) {el.classList.remove('highlight')}) 15 | highlighted = [] 16 | } 17 | 18 | document.addEventListener('click', function (e) { 19 | var target = e.target.dataset.target 20 | if (!target) return unhighlightAll() 21 | unhighlightAll() 22 | highlight(e.target) 23 | highlight(document.getElementById(target)) 24 | }) 25 | 26 | }()) 27 | -------------------------------------------------------------------------------- /demos/style.css: -------------------------------------------------------------------------------- 1 | .CodeMirror { 2 | border: 1px solid black; 3 | /*width: 500px;*/ 4 | width: 100%; 5 | height: 500px; 6 | } 7 | 8 | .json8 { 9 | display: inline-block; 10 | width: calc(100% / 3); 11 | } 12 | 13 | .json8 > h1 { 14 | text-align: center; 15 | } 16 | 17 | .highlight { 18 | background-color: #ffa; 19 | } 20 | 21 | [data-target] { 22 | text-decoration: underline; 23 | cursor: pointer; 24 | } 25 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var apply = require('./lib/apply') 4 | 5 | module.exports.diff = require('./lib/diff') 6 | module.exports.valid = require('./lib/valid') 7 | 8 | // Patching 9 | module.exports.patch = apply 10 | module.exports.apply = apply 11 | 12 | // Reverting 13 | module.exports.revert = require('./lib/revert') 14 | module.exports.buildRevertPatch = require('./lib/buildRevertPatch') 15 | 16 | // Operations 17 | module.exports.add = require('./lib/add') 18 | module.exports.copy = require('./lib/copy') 19 | module.exports.move = require('./lib/move') 20 | module.exports.remove = require('./lib/remove') 21 | module.exports.replace = require('./lib/replace') 22 | module.exports.test = require('./lib/test') 23 | 24 | // Extra operations 25 | module.exports.get = require('./lib/get') 26 | module.exports.has = require('./lib/has') 27 | 28 | // Packing 29 | module.exports.pack = require('./lib/pack') 30 | module.exports.unpack = require('./lib/unpack') 31 | 32 | // Utilities 33 | module.exports.concat = require('./lib/concat') 34 | -------------------------------------------------------------------------------- /lib/add.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ooPointer = require('json8-pointer') 4 | var decode = ooPointer.decode 5 | var walk = require('./walk') 6 | 7 | /** 8 | * @typedef OperationResult 9 | * @type Object 10 | * @property {Any} doc - The patched document 11 | * @property {Array} previous - The previous/replaced value if any 12 | */ 13 | 14 | /** 15 | * Add the value to the specified JSON Pointer location 16 | * http://tools.ietf.org/html/rfc6902#section-4.1 17 | * 18 | * @param {Any} doc - JSON document to set the value to 19 | * @param {Path} path - JSON Pointer string or tokens path 20 | * @param {Any} value - value to add 21 | * @return {OperationResult} 22 | */ 23 | module.exports = function add(doc, path, value) { 24 | var tokens = decode(path) 25 | 26 | // replaces the document 27 | if (tokens.length === 0) 28 | return {doc: value, previous: doc} 29 | 30 | var r = walk(doc, tokens) 31 | var token = r[0] 32 | var parent = r[1] 33 | 34 | var previous 35 | var idx 36 | 37 | if (Array.isArray(parent)) { 38 | if (token === '-') { 39 | parent.push(value) 40 | idx = parent.length - 1 41 | } 42 | else 43 | parent.splice(token, 0, value) 44 | } 45 | else { 46 | previous = parent[token] 47 | parent[token] = value 48 | } 49 | 50 | return {doc: doc, previous: previous, idx: idx} 51 | } 52 | -------------------------------------------------------------------------------- /lib/apply.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var decode = require('json8-pointer').decode 4 | var buildRevertPatch = require('./buildRevertPatch') 5 | 6 | var operations = Object.create(null) 7 | operations.add = require('./add') 8 | operations.copy = require('./copy') 9 | operations.move = require('./move') 10 | operations.remove = require('./remove') 11 | operations.replace = require('./replace') 12 | operations.test = require('./test') 13 | 14 | /** 15 | * @typedef PatchResult 16 | * @type Object 17 | * @property {Any} doc - The patched document 18 | * @property {Array} revert - An array to be used with revert or buildRevertPatch methods 19 | */ 20 | 21 | /** 22 | * Apply a single JSON Patch operation object to a JSON document 23 | * @param {Any} doc - JSON document to apply the patch to 24 | * @param {Object} patch - JSON Patch operation object 25 | * @return {Any} 26 | */ 27 | function run(doc, patch) { 28 | if (typeof patch.path === 'string') 29 | var pathTokens = decode(patch.path) 30 | if (typeof patch.from === 'string') 31 | var fromTokens = decode(patch.from) 32 | 33 | switch (patch.op) { 34 | case 'add': 35 | case 'replace': 36 | case 'test': 37 | if (patch.value === undefined) 38 | throw new Error('Missing value parameter') 39 | return operations[patch.op](doc, pathTokens, patch.value) 40 | 41 | case 'move': 42 | case 'copy': 43 | return operations[patch.op](doc, fromTokens, pathTokens) 44 | 45 | case 'remove': 46 | return operations[patch.op](doc, pathTokens) 47 | } 48 | 49 | throw new Error(patch.op + ' isn\'t a valid operation') 50 | } 51 | 52 | /** 53 | * Apply a JSON Patch to a JSON document 54 | * @param {Any} doc - JSON document to apply the patch to 55 | * @param {Array} patch - JSON Patch array 56 | * @param {Object} options - options 57 | * @param {Boolean} options.reversible - return an array to revert 58 | * @return {PatchResult} 59 | */ 60 | function apply(doc, patch, options) { 61 | if (!Array.isArray(patch)) 62 | throw new Error('Invalid argument, patch must be an array') 63 | 64 | var done = [] 65 | 66 | for (var i = 0, len = patch.length; i < len; i++) { 67 | var p = patch[i] 68 | var r 69 | 70 | try { 71 | r = run(doc, p) 72 | } 73 | catch (err) { // restore document 74 | // does not use ./revert.js because it is a circular dependency 75 | var revertPatch = buildRevertPatch(done) 76 | apply(doc, revertPatch) 77 | throw err 78 | } 79 | 80 | doc = r.doc 81 | done.push([p, r.previous, r.idx]) 82 | } 83 | 84 | var result = {doc: doc} 85 | 86 | if (options && typeof options === 'object' && options.reversible === true) 87 | result.revert = done 88 | 89 | return result 90 | } 91 | 92 | module.exports = apply 93 | -------------------------------------------------------------------------------- /lib/buildRevertPatch.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ooPointer = require('json8-pointer') 4 | var encode = ooPointer.encode 5 | var decode = ooPointer.decode 6 | 7 | /** 8 | * Return the reverse operation to a JSON Patch operation 9 | * @param {Object} patch - JSON Patch operation object 10 | * @param {Any} previous - previous value for add and replace operations 11 | * @param {Number} idx - index of the item for array 12 | * @return {Object} 13 | */ 14 | function reverse(patch, previous, idx) { 15 | var op = patch.op 16 | var path = patch.path 17 | 18 | if (op === 'copy' || (op === 'add' && previous === undefined)) { 19 | if (idx === undefined) 20 | return {"op": "remove", "path": path} 21 | 22 | // for item pushed to array with - 23 | var tokens = decode(path) 24 | tokens[tokens.length - 1] = idx.toString() 25 | return {"op": "remove", "path": encode(tokens)} 26 | } 27 | if (op === 'replace') 28 | return {"op": "replace", "path": path, "value": previous} 29 | if (op === 'move') 30 | return {"op": "move", "path": patch.from, "from": path} 31 | if (op === 'add' || op === 'remove') 32 | return {"op": "add", "path": path, "value": previous} 33 | if (op === 'test') 34 | return {"op": "test", "path": path, "value": patch.value} 35 | } 36 | 37 | /** 38 | * Builds and returns a valid JSON Patch from a revert value 39 | * @param {Array} revert - revert value from the apply or patch method with {reversible: true} 40 | * @return {Array} patches - JSON Patch 41 | */ 42 | module.exports = function buildRevertPatch(revert) { 43 | var patch = [] 44 | 45 | for (var i = 0, len = revert.length; i < len; i++) { 46 | var item = revert[i] 47 | patch.unshift(reverse(item[0], item[1], item[2])) 48 | } 49 | 50 | return patch 51 | } 52 | -------------------------------------------------------------------------------- /lib/compile.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var decode = require('json8-pointer/lib/decode') 4 | 5 | var patch = [ 6 | {"op": "add", "path": "/a/b/c", "value": ["foo", "bar"]}, 7 | {"op": "remove", "path": "/a/b/c"}, 8 | {"op": "replace", "path": "/a/b/c", "value": 42}, 9 | {"op": "move", "from": "/a/b/c", "path": "/a/b/d"}, 10 | {"op": "copy", "from": "/a/b/c", "path": "/a/b/e"}, 11 | {"op": "test", "path": "/a/b/c", "value": "foo"} 12 | ] 13 | 14 | 15 | var doc = {a: {b: "foo"}} 16 | 17 | function pathToStatement (path) { 18 | var tokens = decode(path) 19 | var statement = tokens.shift() 20 | tokens.forEach(function (token) { 21 | statement += '["' + token + '"]' 22 | }) 23 | return statement 24 | } 25 | 26 | // "compile" lol https://github.com/bruth/jsonpatch-js/blob/master/jsonpatch.coffee#L377 27 | 28 | function compile (patch) { 29 | var code = '' 30 | patch.forEach(function(op) { 31 | var o = '' 32 | switch (op.op) { 33 | case 'remove': 34 | o += 'delete ' + pathToStatement(op.path) 35 | break 36 | case 'add': 37 | o += pathToStatement(op.path) + ' = ' + JSON.stringify(op.value) 38 | break 39 | case 'replace': 40 | o += pathToStatement(op.path) + ' = ' + JSON.stringify(op.value) 41 | break 42 | case 'move': 43 | var from = pathToStatement(op.from) 44 | o += pathToStatement(op.path) + ' = ' + from + ';\n' 45 | o += 'delete ' + from 46 | break 47 | case 'copy': 48 | o += pathToStatement(op.path) + ' = ' + from 49 | break 50 | case 'test': 51 | o += 'if (!oo.equal(' + pathToStatement(op.path) + ', ' + JSON.stringify(op.value) + ') throw new Error()' 52 | break 53 | } 54 | code += o + ';\n' 55 | }) 56 | return code 57 | } 58 | 59 | 60 | console.log(compile(patch)) 61 | -------------------------------------------------------------------------------- /lib/concat.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | /** 4 | * concat (or merge) multiple patches into one 5 | * @returns {Array} 6 | */ 7 | module.exports = function concat(/* patch0, patch1, ... */) { 8 | return [].concat.apply([], arguments) 9 | } 10 | -------------------------------------------------------------------------------- /lib/copy.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var get = require('./get') 4 | var add = require('./add') 5 | 6 | /** 7 | * @typedef OperationResult 8 | * @type Object 9 | * @property {Any} doc - The patched document 10 | * @property {Array} previous - The previous/replaced value if any 11 | */ 12 | 13 | /** 14 | * Copy the value at the specified JSON Pointer location to an other location 15 | * http://tools.ietf.org/html/rfc6902#section-4.5 16 | * 17 | * @param {Object|Array} doc - JSON document to copy the value from and to 18 | * @param {String|Array} path - JSON Pointer string or tokens path 19 | * @param {String} dest - JSON Pointer string destination of the value 20 | * @return {OperationResult} 21 | */ 22 | module.exports = function copy(doc, path, dest) { 23 | var obj = get(doc, path) 24 | return add(doc, dest, obj) 25 | } 26 | -------------------------------------------------------------------------------- /lib/diff.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var encode = require('json8-pointer').encode 4 | var equal = require('json8/lib/equal') 5 | var type = require('json8/lib/type') 6 | var ARRAY = 'array' 7 | var OBJECT = 'object' 8 | 9 | module.exports = function diff(a, b, pre) { 10 | var patches = [] 11 | var prefix = pre || [] 12 | 13 | var at = type(a) 14 | var bt = type(b) 15 | 16 | if (bt !== at) { 17 | if (at === undefined) 18 | patches.push({"op": "add", "path": encode(prefix), "value": b}) 19 | else 20 | patches.push({"op": "replace", "path": encode(prefix), "value": b}) 21 | return patches 22 | } 23 | else if (bt !== ARRAY && bt !== OBJECT) { 24 | if (!equal(a, b)) 25 | patches.push({"op": "replace", "path": encode(prefix), "value": b}) 26 | return patches 27 | } 28 | 29 | if (a === b) 30 | return patches 31 | 32 | // both are arrays 33 | if (Array.isArray(b)) { 34 | // FIXME let's be smarter about array diffing 35 | if (a.length === 0 && b.length === 0) 36 | return patches 37 | if (equal(a, b)) 38 | return patches 39 | patches.push({"op": "replace", "path": encode(prefix), "value": b}) 40 | } 41 | // both are objects 42 | else if (bt === OBJECT) { 43 | var i, l, keys, k 44 | keys = Object.keys(b) 45 | for (i = 0, l = keys.length; i < l; i++) { 46 | k = keys[i] 47 | patches = patches.concat(diff(a[k], b[k], prefix.concat([k]))) 48 | } 49 | 50 | keys = Object.keys(a) 51 | for (i = 0, l = keys.length; i < l; i++) { 52 | k = keys[i] 53 | if (b[k] !== undefined) 54 | continue 55 | patches.push({"op": "remove", "path": encode(prefix.concat([k]))}) 56 | } 57 | } 58 | 59 | return patches 60 | } 61 | -------------------------------------------------------------------------------- /lib/get.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ooPointer = require('json8-pointer') 4 | var walk = require('./walk') 5 | var decode = ooPointer.decode 6 | 7 | /** 8 | * @typedef OperationResult 9 | * @type Object 10 | * @property {Any} doc - The patched document 11 | * @property {Array} previous - The previous/replaced value if any 12 | */ 13 | 14 | /** 15 | * Get the value at the JSON Pointer location 16 | * 17 | * @param {Object|Array} doc - JSON document 18 | * @param {String|Array} path - JSON Pointer string or tokens path 19 | * @return {Any} - value at the JSON Pointer location 20 | */ 21 | module.exports = function get(doc, path) { 22 | var tokens = decode(path) 23 | 24 | // returns the document 25 | if (tokens.length === 0) 26 | return doc 27 | 28 | var r = walk(doc, tokens) 29 | var token = r[0] 30 | var parent = r[1] 31 | 32 | return parent[token] 33 | } 34 | -------------------------------------------------------------------------------- /lib/has.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ooPointer = require('json8-pointer') 4 | var walk = require('./walk') 5 | var decode = ooPointer.decode 6 | 7 | /** 8 | * @typedef OperationResult 9 | * @type Object 10 | * @property {Any} doc - The patched document 11 | * @property {Array} previous - The previous/replaced value if any 12 | */ 13 | 14 | /** 15 | * Check if the document as the property at the specified JSON Pointer location 16 | * 17 | * @param {Object|Array} doc - JSON document 18 | * @param {String|Array} path - JSON Pointer string or tokens path 19 | * @return {Bool} 20 | */ 21 | module.exports = function has(doc, path) { 22 | var tokens = decode(path) 23 | 24 | // returns the document 25 | if (tokens.length === 0) 26 | return true 27 | 28 | var r = walk(doc, tokens) 29 | var token = r[0] 30 | var parent = r[1] 31 | 32 | return token in parent 33 | } 34 | -------------------------------------------------------------------------------- /lib/move.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var remove = require('./remove') 4 | var add = require('./add') 5 | 6 | /** 7 | * @typedef OperationResult 8 | * @type Object 9 | * @property {Any} doc - The patched document 10 | * @property {Array} previous - The previous/replaced value if any 11 | */ 12 | 13 | /** 14 | * Move the value at the specified JSON Pointer location to an other location 15 | * http://tools.ietf.org/html/rfc6902#section-4.4 16 | * 17 | * @param {Object|Array} doc - JSON document to move the value from and to 18 | * @param {String|Array} path - JSON Pointer string or tokens path 19 | * @param {String} dest - JSON Pointer string destination of the value 20 | * @return {OperationResult} 21 | */ 22 | module.exports = function move(doc, path, dest) { 23 | var r = remove(doc, path) 24 | return add(doc, dest, r.previous) 25 | } 26 | -------------------------------------------------------------------------------- /lib/pack.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ops = Object.create(null) 4 | ops.add = 0 5 | ops.remove = 1 6 | ops.replace = 2 7 | ops.move = 3 8 | ops.copy = 4 9 | ops.test = 5 10 | 11 | module.exports = function pack(patch) { 12 | var packed = [] 13 | 14 | for (var i = 0, l = patch.length; i < l; i++) { 15 | var p = patch[i] 16 | var a = ops[p.op] 17 | var op = [a, p.path] 18 | // add, replace, test 19 | if (a === 0 || a === 2 || a === 5) 20 | op.push(p.value) 21 | // move copy 22 | else if (a !== 1) { 23 | op.push(p.from) 24 | } 25 | 26 | packed.push(op) 27 | } 28 | 29 | return packed 30 | } 31 | -------------------------------------------------------------------------------- /lib/patch.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = require('./apply') 4 | -------------------------------------------------------------------------------- /lib/remove.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ooPointer = require('json8-pointer') 4 | var decode = ooPointer.decode 5 | var walk = require('./walk') 6 | 7 | /** 8 | * @typedef OperationResult 9 | * @type Object 10 | * @property {Any} doc - The patched document 11 | * @property {Array} previous - The previous/replaced value if any 12 | */ 13 | 14 | /** 15 | * Remove the value at the JSON Pointer location 16 | * http://tools.ietf.org/html/rfc6902#section-4.2 17 | * 18 | * @param {Any} doc - JSON document to search into 19 | * @param {String|Array} path - JSON Pointer string or tokens patch 20 | * @return {OperationResult} 21 | */ 22 | module.exports = function remove(doc, path) { 23 | var tokens = decode(path) 24 | 25 | // removes the document 26 | if (tokens.length === 0) 27 | return {doc: undefined, previous: doc} 28 | 29 | var r = walk(doc, tokens) 30 | var token = r[0] 31 | var parent = r[1] 32 | 33 | var previous = parent[token] 34 | if (previous === undefined) 35 | throw new Error('Location not found') 36 | 37 | if (Array.isArray(parent)) 38 | parent.splice(token, 1) 39 | else 40 | delete parent[token] 41 | 42 | return {doc: doc, previous: previous} 43 | } 44 | -------------------------------------------------------------------------------- /lib/replace.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ooPointer = require('json8-pointer') 4 | var decode = ooPointer.decode 5 | var walk = require('./walk') 6 | 7 | /** 8 | * @typedef OperationResult 9 | * @type Object 10 | * @property {Any} doc - The patched document 11 | * @property {Array} previous - The previous/replaced value if any 12 | */ 13 | 14 | /** 15 | * Replace the value at the JSON Pointer location 16 | * http://tools.ietf.org/html/rfc6902#section-4.3 17 | * 18 | * @param {Any} doc - JSON document 19 | * @param {String|Array} path - JSON Pointer string or tokens patch 20 | * @param {String} value - JSON object to replace with 21 | * @return {OperationResult} 22 | */ 23 | module.exports = function replace(doc, path, value) { 24 | var tokens = decode(path) 25 | 26 | // replaces the document 27 | if (tokens.length === 0) 28 | return {doc: value, previous: doc} 29 | 30 | var r = walk(doc, tokens) 31 | var token = r[0] 32 | var parent = r[1] 33 | 34 | var previous = parent[token] 35 | if (previous === undefined) 36 | throw new Error('Location not found') 37 | 38 | parent[token] = value 39 | 40 | return {doc: doc, previous: previous} 41 | } 42 | -------------------------------------------------------------------------------- /lib/revert.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var buildRevertPatch = require('./buildRevertPatch') 4 | var apply = require('./apply') 5 | 6 | /** 7 | * @typedef RevertResult 8 | * @type Object 9 | * @property {Any} doc - The patched document 10 | */ 11 | 12 | /** 13 | * Revert apply a JSON Patch 14 | * @param {Any} doc - JSON document to which the patch was applied to 15 | * @param {Array} items - value of revert property from apply method result 16 | * @return {PatchResult} 17 | */ 18 | module.exports = function revert(doc, items) { 19 | var patch = buildRevertPatch(items) 20 | return apply(doc, patch) 21 | } 22 | -------------------------------------------------------------------------------- /lib/test.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var get = require('./get') 4 | var equal = require('json8/lib/equal') 5 | 6 | /** 7 | * @typedef OperationResult 8 | * @type Object 9 | * @property {Any} doc - The patched document 10 | * @property {Array} previous - The previous/replaced value if any 11 | */ 12 | 13 | /** 14 | * Test that the value at the specified JSON Pointer location is equal to the specified value 15 | * http://tools.ietf.org/html/rfc6902#section-4.6 16 | * 17 | * @param {Object|Array} doc - JSON document to copy the value from and to 18 | * @param {String|Array} path - JSON Pointer string or tokens path 19 | * @param {String} value - the value to compare with 20 | * @return {OperationResult} 21 | */ 22 | module.exports = function test(doc, path, value) { 23 | var obj = get(doc, path) 24 | if (!equal(obj, value)) 25 | throw new Error('Test failed') 26 | 27 | return {doc: doc} 28 | } 29 | -------------------------------------------------------------------------------- /lib/unpack.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var ops = Object.create(null) 4 | ops[0] = 'add' 5 | ops[1] = 'remove' 6 | ops[2] = 'replace' 7 | ops[3] = 'move' 8 | ops[4] = 'copy' 9 | ops[5] = 'test' 10 | 11 | module.exports = function unpack(packed) { 12 | var unpacked = [] 13 | 14 | for (var i = 0, l = packed.length; i < l; i++) { 15 | var p = packed[i] 16 | var ap = p[0] 17 | var a = ops[ap] 18 | var op = {op: a, path: p[1]} 19 | 20 | // add, replace, test 21 | if (ap === 0 || ap === 2 || ap === 5) 22 | op.value = p[2] 23 | // move, copy 24 | else if (ap !== 1) 25 | op.from = p[2] 26 | 27 | unpacked.push(op) 28 | } 29 | 30 | return unpacked 31 | } 32 | -------------------------------------------------------------------------------- /lib/valid.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = function valid(patch) { 4 | if (!Array.isArray(patch)) 5 | return false 6 | 7 | for (var i = 0, l = patch.length; i < l; i++) { 8 | var op = patch[i] 9 | 10 | if (typeof op !== 'object' || op === null || Array.isArray(op)) 11 | return false 12 | 13 | if (typeof op.path !== 'string') 14 | return false 15 | 16 | var operation = op.op 17 | if (typeof op.op !== 'string') 18 | return false 19 | 20 | switch (operation) { 21 | case 'add': 22 | case 'replace': 23 | case 'test': 24 | if (op.value === undefined) 25 | return false 26 | break 27 | case 'move': 28 | case 'copy': 29 | if (typeof op.from !== 'string') 30 | return false 31 | break 32 | case 'remove': 33 | break 34 | default: 35 | return false 36 | } 37 | } 38 | 39 | return true 40 | } 41 | -------------------------------------------------------------------------------- /lib/walk.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var validArrayToken = require('json8-pointer').validArrayToken 4 | var OBJECT = 'object' 5 | 6 | /** 7 | * Walk a JSON document with a tokens array 8 | * 9 | * @param {Object|Array} doc - JSON document 10 | * @param {Array} tokens - array of tokens 11 | * @return {Array} - [token, target] 12 | */ 13 | module.exports = function walk(doc, tokens) { 14 | var length = tokens.length 15 | 16 | var i = 0 17 | var target = doc 18 | var token 19 | 20 | while (i < length - 1) { 21 | token = tokens[i++] 22 | 23 | if (Array.isArray(target)) 24 | validArrayToken(token, target.length) 25 | else if (typeof target !== OBJECT || target === null) 26 | throw new Error('Cannot be walked') 27 | 28 | target = target[token] 29 | } 30 | 31 | token = tokens[i] 32 | 33 | if (Array.isArray(target)) 34 | validArrayToken(token, target.length) 35 | else if (typeof target !== OBJECT || target === null) 36 | throw new Error('Invalid target') 37 | 38 | return [token, target] 39 | } 40 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "json8-patch", 3 | "version": "0.4.1", 4 | "description": "JSON Patch implementation for JavaScript", 5 | "keywords": [ 6 | "JSON", 7 | "patch", 8 | "diff" 9 | ], 10 | "homepage": "https://github.com/JSON8/patch", 11 | "repository": "github:JSON8/patch", 12 | "bugs": "https://github.com/JSON8/patch/issues", 13 | "scripts": { 14 | "preversion": "npm run bundle && npm test", 15 | "bundle": "browserify -s JSON8Patch index.js -o JSON8Patch.js", 16 | "lint": "eslint .", 17 | "unit": "mocha --compilers js:babel-core/register --recursive test/", 18 | "benchmark": "node benchmark.js", 19 | "test": "npm run unit && npm run lint && npm run bundle" 20 | }, 21 | "author": "Sonny Piers ", 22 | "license": "ISC", 23 | "dependencies": { 24 | "json8": "^0.9.0", 25 | "json8-pointer": "^0.7.1" 26 | }, 27 | "devDependencies": { 28 | "babel-core": "^6.8.0", 29 | "babel-preset-es2015": "^6.3.13", 30 | "benchmark": "^2.1.0", 31 | "browserify": "^15.2.0", 32 | "eslint": "^0.24.1", 33 | "fast-json-patch": "^2.0.6", 34 | "jiff": "^0.7.3", 35 | "json-patch": "^0.7.0", 36 | "json-patch-test-suite": "^1.1.0", 37 | "jsonpatch": "^3.0.1", 38 | "mocha": "^5.0.0" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | env: 2 | mocha: true 3 | es6: true 4 | 5 | ecmaFeatures: 6 | modules: true 7 | 8 | rules: 9 | # ECMAScript 6 10 | no-var: 2 11 | object-shorthand: [2, always] 12 | prefer-const: 2 13 | 14 | #Style 15 | padded-blocks: 0 16 | max-nested-callbacks: 0 17 | -------------------------------------------------------------------------------- /test/RFC.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import apply from '../lib/apply' 5 | 6 | /* eslint comma-dangle: 0, space-in-brackets: 0 */ 7 | 8 | // https://tools.ietf.org/html/rfc6902#appendix-A 9 | describe('RFC Examples', () => { 10 | it('Adding an Object Member', () => { 11 | const doc = { "foo": "bar"} 12 | const patch = [ 13 | { "op": "add", "path": "/baz", "value": "qux" } 14 | ] 15 | const expected = { 16 | "baz": "qux", 17 | "foo": "bar" 18 | } 19 | assert.deepEqual(apply(doc, patch).doc, expected) 20 | }) 21 | 22 | it('Adding an Array Element', () => { 23 | const doc = { "foo": [ "bar", "baz" ] } 24 | const patch = [ 25 | { "op": "add", "path": "/foo/1", "value": "qux" } 26 | ] 27 | const expected = { "foo": [ "bar", "qux", "baz" ] } 28 | assert.deepEqual(apply(doc, patch).doc, expected) 29 | }) 30 | 31 | it('Removing an Object Member', () => { 32 | const doc = { 33 | "baz": "qux", 34 | "foo": "bar" 35 | } 36 | const patch = [ 37 | { "op": "remove", "path": "/baz" } 38 | ] 39 | const expected = { "foo": "bar" } 40 | assert.deepEqual(apply(doc, patch).doc, expected) 41 | }) 42 | 43 | it('Removing an Array Element', () => { 44 | const doc = { "foo": [ "bar", "qux", "baz" ] } 45 | const patch = [ 46 | { "op": "remove", "path": "/foo/1" } 47 | ] 48 | const expected = { "foo": [ "bar", "baz" ] } 49 | assert.deepEqual(apply(doc, patch).doc, expected) 50 | }) 51 | 52 | it('Removing an Array Element', () => { 53 | const doc = { 54 | "baz": "qux", 55 | "foo": "bar" 56 | } 57 | const patch = [ 58 | { "op": "replace", "path": "/baz", "value": "boo" } 59 | ] 60 | const expected = { 61 | "baz": "boo", 62 | "foo": "bar" 63 | } 64 | assert.deepEqual(apply(doc, patch).doc, expected) 65 | }) 66 | 67 | it('Moving a Value', () => { 68 | const doc = { 69 | "foo": { 70 | "bar": "baz", 71 | "waldo": "fred" 72 | }, 73 | "qux": { 74 | "corge": "grault" 75 | } 76 | } 77 | const patch = [ 78 | { "op": "move", "from": "/foo/waldo", "path": "/qux/thud" } 79 | ] 80 | const expected = { 81 | "foo": { 82 | "bar": "baz" 83 | }, 84 | "qux": { 85 | "corge": "grault", 86 | "thud": "fred" 87 | } 88 | } 89 | assert.deepEqual(apply(doc, patch).doc, expected) 90 | }) 91 | 92 | it('Moving an Array Element', () => { 93 | const doc = { "foo": [ "all", "grass", "cows", "eat" ] } 94 | const patch = [ 95 | { "op": "move", "from": "/foo/1", "path": "/foo/3" } 96 | ] 97 | const expected = { "foo": [ "all", "cows", "eat", "grass" ] } 98 | assert.deepEqual(apply(doc, patch).doc, expected) 99 | }) 100 | 101 | it('Testing a Value: Success', () => { 102 | const doc = { 103 | "baz": "qux", 104 | "foo": [ "a", 2, "c" ] 105 | } 106 | const patch = [ 107 | { "op": "test", "path": "/baz", "value": "qux" }, 108 | { "op": "test", "path": "/foo/1", "value": 2 } 109 | ] 110 | assert.doesNotThrow(() => { 111 | apply(doc, patch) 112 | }) 113 | }) 114 | 115 | it('Testing a Value: Error', () => { 116 | const doc = { "baz": "qux" } 117 | const patch = [ 118 | { "op": "test", "path": "/baz", "value": "bar" } 119 | ] 120 | assert.throws(() => { 121 | apply(doc, patch) 122 | }) 123 | }) 124 | 125 | it('Adding a Nested Member Object', () => { 126 | const doc = { "foo": "bar" } 127 | const patch = [ 128 | { "op": "add", "path": "/child", "value": { "grandchild": { } } } 129 | ] 130 | const expected = { 131 | "foo": "bar", 132 | "child": { 133 | "grandchild": { 134 | } 135 | } 136 | } 137 | assert.deepEqual(apply(doc, patch).doc, expected) 138 | }) 139 | 140 | it('Ignoring Unrecognized Elements', () => { 141 | const doc = { "foo": "bar" } 142 | const patch = [ 143 | { "op": "add", "path": "/baz", "value": "qux", "xyz": 123 } 144 | ] 145 | const expected = { 146 | "foo": "bar", 147 | "baz": "qux" 148 | } 149 | assert.deepEqual(apply(doc, patch).doc, expected) 150 | }) 151 | 152 | it('Adding to a Nonexistent Target', () => { 153 | const doc = { "foo": "bar" } 154 | const patch = [ 155 | { "op": "add", "path": "/baz/bat", "value": "qux" } 156 | ] 157 | assert.throws(() => { 158 | apply(doc, patch) 159 | }) 160 | }) 161 | 162 | // cannot be tested https://tools.ietf.org/html/rfc6902#appendix-A.13 163 | it('Invalid JSON Patch Document', () => { 164 | const patch = [ // eslint-disable-line no-unused-vars 165 | { "op": "add", "path": "/baz", "value": "qux", "op": "remove" } // eslint-disable-line no-dupe-keys 166 | ] 167 | }) 168 | 169 | it('Escape Ordering', () => { 170 | const doc = { 171 | "/": 9, 172 | "~1": 10 173 | } 174 | const patch = [ 175 | {"op": "test", "path": "/~01", "value": 10} 176 | ] 177 | const expected = { 178 | "/": 9, 179 | "~1": 10 180 | } 181 | assert.deepEqual(apply(doc, patch).doc, expected) 182 | }) 183 | 184 | it('Comparing Strings and Numbers', () => { 185 | const doc = { 186 | "/": 9, 187 | "~1": 10 188 | } 189 | const patch = [ 190 | {"op": "test", "path": "/~01", "value": "10"} 191 | ] 192 | assert.throws(() => { 193 | apply(doc, patch) 194 | }) 195 | }) 196 | 197 | it('Adding an Array Value', () => { 198 | const doc = { "foo": ["bar"] } 199 | const patch = [ 200 | { "op": "add", "path": "/foo/-", "value": ["abc", "def"] } 201 | ] 202 | const expected = { "foo": ["bar", ["abc", "def"]] } 203 | assert.deepEqual(apply(doc, patch).doc, expected) 204 | }) 205 | }) 206 | -------------------------------------------------------------------------------- /test/add.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _add from '../lib/add' 5 | 6 | describe('add', () => { 7 | 8 | let doc 9 | 10 | const add = function(path, obj) { 11 | return _add(doc, path, obj) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('sets the value if the parent exists and is valid', () => { 17 | doc = {} 18 | const obj = {bar: 'foo'} 19 | const r = add('/foo', {bar: 'foo'}) 20 | assert.deepEqual(r.doc.foo, obj) 21 | }) 22 | 23 | it('throws an error if the parent does not exists', () => { 24 | doc = {} 25 | assert.throws(() => { 26 | add('/foo/bar', {bar: 'foo'}) 27 | }, Error) 28 | }) 29 | 30 | it('throws an error if the parent is not valid', () => { 31 | doc = {foo: 'bar'} 32 | assert.throws(() => { 33 | add('/foo/bar', {bar: 'foo'}) 34 | }, Error) 35 | }) 36 | 37 | }) 38 | 39 | describe('array location', () => { 40 | 41 | it('adds the value if the parent exists and is valid', () => { 42 | doc = {'foo': ['bar']} 43 | const r = add('/foo/0', 'barfoo') 44 | assert.deepEqual(r.doc, {foo: ['barfoo', 'bar']}) 45 | }) 46 | 47 | it('throws an error if the parent does not exists', () => { 48 | doc = {'foo': []} 49 | assert.throws(() => { 50 | add('/foo/0/bar', 'foobar') 51 | }, Error) 52 | }) 53 | 54 | it('throws an error if the parent is not valid', () => { 55 | doc = {foo: true} 56 | assert.throws(() => { 57 | add('/foo/bar', {bar: 'foo'}) 58 | }, Error) 59 | }) 60 | 61 | }) 62 | 63 | }) 64 | -------------------------------------------------------------------------------- /test/concat.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import concat from '../lib/concat' 5 | 6 | describe('concat', () => { 7 | it('concats the patches into a bigger patch', () => { 8 | const patch0 = [{}] 9 | const patch1 = [{}] 10 | const patch2 = [{}] 11 | const patch = concat(patch0, patch1, patch2) 12 | assert.deepEqual(patch, [{}, {}, {}]) 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /test/copy.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _copy from '../lib/copy' 5 | 6 | describe('copy', () => { 7 | 8 | let doc 9 | 10 | const copy = function(path, dest) { 11 | return _copy(doc, path, dest) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('copy the primitive if the parent exists and is valid', () => { 17 | doc = {bar: 'foo'} 18 | copy('/bar', '/foo') 19 | assert.deepEqual(doc.bar, doc.foo) 20 | }) 21 | 22 | it('copy the structure if the parent exists and is valid', () => { 23 | doc = {bar: {}} 24 | copy('/bar', '/foo') 25 | assert.deepEqual(doc.bar, doc.foo) 26 | }) 27 | 28 | it('doesn\'t shallow copy objects', () => { 29 | doc = {bar: []} 30 | copy('/bar', '/foo') 31 | assert.deepEqual(doc.bar, doc.foo) 32 | }) 33 | 34 | it('throws an error if the parent does not exists', () => { 35 | doc = {} 36 | assert.throws(() => { 37 | copy('/foo/bar', '/bar/foo') 38 | }, Error) 39 | }) 40 | 41 | it('throws an error if the parent is not valid', () => { 42 | doc = {foo: 'bar'} 43 | assert.throws(() => { 44 | copy('/foo/bar', '/bar/foo') 45 | }, Error) 46 | }) 47 | 48 | }) 49 | 50 | describe('array location', () => { 51 | 52 | it('sets the value if the parent exists and is valid', () => { 53 | doc = {'foo': ['bar']} 54 | copy('/foo/0', '/foo/1') 55 | assert.deepEqual(doc.foo[0], doc.foo[1]) 56 | }) 57 | 58 | it('throws an error if the parent does not exists', () => { 59 | doc = {'foo': []} 60 | assert.throws(() => { 61 | copy('/foo/0/bar', '/foo/bar') 62 | }, Error) 63 | }) 64 | 65 | it('throws an error if the parent is not valid', () => { 66 | doc = {foo: true} 67 | assert.throws(() => { 68 | copy('/foo/bar', '/bar/foo') 69 | }, Error) 70 | }) 71 | 72 | }) 73 | 74 | }) 75 | -------------------------------------------------------------------------------- /test/diff.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import diff from '../lib/diff' 4 | import assert from 'assert' 5 | 6 | describe('diff', () => { 7 | 8 | const tests = require('./diff.json') 9 | 10 | tests.forEach(function(test) { 11 | 12 | const patch = diff(test.a, test.b) 13 | 14 | it(test.description, () => { 15 | 16 | assert.deepEqual(patch, test.patch) 17 | }) 18 | 19 | }) 20 | }) 21 | -------------------------------------------------------------------------------- /test/diff.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "description": "equal booleans, empty patch", 4 | "a": true, 5 | "b": true, 6 | "patch": [] 7 | }, 8 | 9 | { 10 | "description": "equal strings, empty patch", 11 | "a": "foo", 12 | "b": "foo", 13 | "patch": [] 14 | }, 15 | 16 | { 17 | "description": "equal null, empty patch", 18 | "a": null, 19 | "b": null, 20 | "patch": [] 21 | }, 22 | 23 | { 24 | "description": "equal empty arrays, empty patch", 25 | "a": [], 26 | "b": [], 27 | "patch": [] 28 | }, 29 | 30 | { 31 | "description": "equal non empty arrays, empty patch", 32 | "a": ["foo"], 33 | "b": ["foo"], 34 | "patch": [] 35 | }, 36 | 37 | 38 | { 39 | "description": "equal empty objects, empty patch", 40 | "a": {}, 41 | "b": {}, 42 | "patch": [] 43 | }, 44 | 45 | { 46 | "description": "equal non empty objects, empty patch", 47 | "a": {"foo": "bar"}, 48 | "b": {"foo": "bar"}, 49 | "patch": [] 50 | }, 51 | 52 | 53 | { 54 | "description": "equal numbers, empty patch", 55 | "a": 42, 56 | "b": 42, 57 | "patch": [] 58 | }, 59 | 60 | { 61 | "description": "replace true with false", 62 | "a": true, 63 | "b": false, 64 | "patch": [{"op": "replace", "path": "", "value": false}] 65 | }, 66 | 67 | { 68 | "description": "replace false with true", 69 | "a": false, 70 | "b": true, 71 | "patch": [{"op": "replace", "path": "", "value": true}] 72 | }, 73 | 74 | { 75 | "description": "replace string with string", 76 | "a": "foo", 77 | "b": "bar", 78 | "patch": [{"op": "replace", "path": "", "value": "bar"}] 79 | }, 80 | 81 | { 82 | "description": "replace number with number", 83 | "a": -0, 84 | "b": 0, 85 | "patch": [{"op": "replace", "path": "", "value": -0}] 86 | }, 87 | 88 | { 89 | "description": "replace array with array", 90 | "a": [], 91 | "b": ["foo"], 92 | "patch": [{"op": "replace", "path": "", "value": ["foo"]}] 93 | }, 94 | 95 | { 96 | "description": "replace primitive with array", 97 | "a": null, 98 | "b": [], 99 | "patch": [{"op": "replace", "path": "", "value": []}] 100 | }, 101 | 102 | { 103 | "description": "replace primitive with object", 104 | "a": null, 105 | "b": {}, 106 | "patch": [{"op": "replace", "path": "", "value": {}}] 107 | }, 108 | 109 | { 110 | "description": "replace object with primitive", 111 | "a": {}, 112 | "b": 42, 113 | "patch": [{"op": "replace", "path": "", "value": 42}] 114 | }, 115 | 116 | { 117 | "description": "replace array with primitive", 118 | "a": [], 119 | "b": "foobar", 120 | "patch": [{"op": "replace", "path": "", "value": "foobar"}] 121 | }, 122 | 123 | { 124 | "description": "object - 2 new properties", 125 | "a": {}, 126 | "b": {"foo": "bar", "bar": "foo"}, 127 | "patch": [ 128 | {"op": "add", "path": "/foo", "value": "bar"}, 129 | {"op": "add", "path": "/bar", "value": "foo"} 130 | ] 131 | }, 132 | 133 | { 134 | "description": "object - 2 removed properties", 135 | "a": {"foo": "bar", "bar": "foo"}, 136 | "b": {}, 137 | "patch": [ 138 | {"op": "remove", "path": "/foo"}, 139 | {"op": "remove", "path": "/bar"} 140 | ] 141 | }, 142 | 143 | { 144 | "description": "object - 1 property added 1 property removed", 145 | "a": {"foo": "bar"}, 146 | "b": {"bar": "foo"}, 147 | "patch": [ 148 | {"op": "add", "path": "/bar", "value": "foo"}, 149 | {"op": "remove", "path": "/foo"} 150 | ] 151 | }, 152 | 153 | { 154 | "description": "object - 1 property replaced", 155 | "a": {"foo": "bar"}, 156 | "b": {"foo": "foo"}, 157 | "patch": [ 158 | {"op": "replace", "path": "/foo", "value": "foo"} 159 | ] 160 | }, 161 | 162 | { 163 | "description": "object - 1 nested property replaced", 164 | "a": {"foo": {"foo": "bar"}}, 165 | "b": {"foo": {"foo": "foo"}}, 166 | "patch": [ 167 | {"op": "replace", "path": "/foo/foo", "value": "foo"} 168 | ] 169 | }, 170 | 171 | { 172 | "description": "object - 1 nested property added", 173 | "a": {"foo": {}}, 174 | "b": {"foo": {"foo": "foo"}}, 175 | "patch": [ 176 | {"op": "add", "path": "/foo/foo", "value": "foo"} 177 | ] 178 | }, 179 | 180 | { 181 | "description": "object - 1 nested property removed", 182 | "a": {"foo": {"foo": "foo"}}, 183 | "b": {"foo": {}}, 184 | "patch": [ 185 | {"op": "remove", "path": "/foo/foo"} 186 | ] 187 | }, 188 | 189 | { 190 | "description": "object - 1 nested (2) property added", 191 | "a": {}, 192 | "b": {"foo": {"foo": "foo"}}, 193 | "patch": [ 194 | {"op": "add", "path": "/foo", "value": {"foo": "foo"}} 195 | ] 196 | } 197 | 198 | ] 199 | -------------------------------------------------------------------------------- /test/get.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _get from '../lib/get' 5 | 6 | describe('get', () => { 7 | 8 | let doc 9 | 10 | const get = function(path) { 11 | return _get(doc, path) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('returns the value if the location exists', () => { 17 | doc = {'foo': 'bar'} 18 | const r = get('/foo') 19 | assert.strictEqual(r, 'bar') 20 | }) 21 | 22 | it('returns undefined if the location does not exists', () => { 23 | doc = {} 24 | const r = get('/foo') 25 | assert.strictEqual(r, undefined) 26 | }) 27 | 28 | it('throws an error if the path cannot be walked', () => { 29 | doc = {} 30 | assert.throws(() => { 31 | get('/foo/bar') 32 | }, Error) 33 | }) 34 | 35 | }) 36 | 37 | describe('array location', () => { 38 | 39 | it('returns the value if the location exists', () => { 40 | doc = {'foo': ['bar']} 41 | const r = get('/foo/0') 42 | assert.strictEqual(r, 'bar') 43 | }) 44 | 45 | it('returns undefined if the value does not exists', () => { 46 | doc = {'foo': []} 47 | const r = get('/foo/0') 48 | assert.strictEqual(r, undefined) 49 | }) 50 | 51 | it('throws an error if the path cannot be walked', () => { 52 | doc = {'foo': []} 53 | assert.throws(() => { 54 | get('/foo/0/bar') 55 | }, Error) 56 | }) 57 | 58 | }) 59 | 60 | }) 61 | -------------------------------------------------------------------------------- /test/has.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _has from '../lib/has' 5 | 6 | describe('has', () => { 7 | 8 | let doc 9 | 10 | const has = function(path) { 11 | return _has(doc, path) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('returns true if there is a value at the specified location', () => { 17 | doc = {'foo': 'bar'} 18 | const r = has('/foo') 19 | assert.strictEqual(r, true) 20 | }) 21 | 22 | it('returns false if there is no value at the specified location', () => { 23 | doc = {} 24 | const r = has('/foo') 25 | assert.strictEqual(r, false) 26 | }) 27 | 28 | it('throws an error if the path cannot be walked', () => { 29 | doc = {} 30 | assert.throws(() => { 31 | has('/foo/bar') 32 | }, Error) 33 | }) 34 | 35 | }) 36 | 37 | describe('array location', () => { 38 | 39 | it('returns true if there is a value at the specified location', () => { 40 | doc = {'foo': ['bar']} 41 | const r = has('/foo/0') 42 | assert.strictEqual(r, true) 43 | }) 44 | 45 | it('returns false if there is no value at the specified location', () => { 46 | doc = {'foo': []} 47 | const r = has('/foo/0') 48 | assert.strictEqual(r, false) 49 | }) 50 | 51 | it('throws an error if the path cannot be walked', () => { 52 | doc = {'foo': []} 53 | assert.throws(() => { 54 | has('/foo/0/bar') 55 | }, Error) 56 | }) 57 | 58 | }) 59 | 60 | }) 61 | -------------------------------------------------------------------------------- /test/json-patch-test-suite.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import {clone} from 'json8' 5 | import apply from '../lib/apply' 6 | import revert from '../lib/revert' 7 | import pack from '../lib/pack' 8 | import unpack from '../lib/unpack' 9 | import valid from '../lib/valid' 10 | import buildRevertPatch from '../lib/buildRevertPatch' 11 | 12 | let tests = require('json-patch-test-suite/tests.json') 13 | const spec_tests = require('json-patch-test-suite/spec_tests.json') 14 | 15 | tests = tests.concat(spec_tests) 16 | 17 | describe('json-patch-test-suite', () => { 18 | 19 | tests.forEach(test => { 20 | if (test.disabled) 21 | return 22 | 23 | describe(test.comment ? test.comment : 'no test description', () => { 24 | 25 | if (test.error) { 26 | it('throws an error', () => { 27 | const t = clone(test) 28 | assert.throws(() => { 29 | apply(t.doc, t.patch) 30 | }) 31 | }) 32 | 33 | it('reverts the document to its original state', () => { 34 | const t = clone(test) 35 | const original = clone(t.doc) 36 | assert.throws(function() { 37 | apply(t.doc, t.patch) 38 | }) 39 | assert.deepEqual(t.doc, original) 40 | }) 41 | } 42 | else if (test.expected) { 43 | it('applies the patch', () => { 44 | const t = clone(test) 45 | const r = apply(t.doc, t.patch) 46 | assert.deepEqual(r.doc, t.expected) 47 | }) 48 | 49 | it('reverts the patch ok with revert', () => { 50 | const t = clone(test) 51 | const original = t.doc 52 | const r = apply(t.doc, t.patch, {reversible: true}) 53 | assert.deepEqual(revert(r.doc, r.revert).doc, original) 54 | }) 55 | 56 | it('reverts the patch ok with buildRevertPatch and apply', () => { 57 | const t = clone(test) 58 | const original = t.doc 59 | const r = apply(t.doc, t.patch, {reversible: true}) 60 | const revertPatch = buildRevertPatch(r.revert) 61 | assert.deepEqual(apply(r.doc, revertPatch).doc, original) 62 | }) 63 | } 64 | else { 65 | it('does not throw an error', () => { 66 | const t = clone(test) 67 | assert.doesNotThrow(() => { 68 | apply(t.doc, t.patch) 69 | }) 70 | }) 71 | } 72 | 73 | if (test.expected && !test.error) { 74 | it('validation returns true', () => { 75 | const t = clone(test) 76 | assert.strictEqual(valid(t.patch), true) 77 | }) 78 | } 79 | 80 | if (test.patch && !test.error && JSON.stringify(test.patch).indexOf('spurious') === -1) { 81 | const ignore = ['Ignoring Unrecognized Elements'] 82 | if (test.comment && test.comment.indexOf(ignore[0]) !== -1) 83 | return 84 | 85 | it('packs and unpacks the patch ok', () => { 86 | const t = clone(test) 87 | const packed = pack(test.patch) 88 | assert.deepEqual(unpack(packed), t.patch) 89 | }) 90 | } 91 | 92 | }) 93 | }) 94 | }) 95 | -------------------------------------------------------------------------------- /test/move.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _move from '../lib/move' 5 | 6 | describe('move', () => { 7 | 8 | let doc 9 | 10 | const move = function(path, dest) { 11 | return _move(doc, path, dest) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('moves the object if the parent exists and is valid', () => { 17 | doc = {bar: 'foo'} 18 | move('/bar', '/foo') 19 | assert.equal(doc.bar, undefined) 20 | assert.deepEqual(doc.foo, 'foo') 21 | }) 22 | 23 | it('throws an error if the parent does not exists', () => { 24 | doc = {} 25 | assert.throws(() => { 26 | move('/foo/bar', '/bar/foo') 27 | }, Error) 28 | }) 29 | 30 | it('throws an error if the parent is not valid', () => { 31 | doc = {foo: 'bar'} 32 | assert.throws(() => { 33 | move('/foo/bar', '/bar/foo') 34 | }, Error) 35 | }) 36 | 37 | }) 38 | 39 | describe('array location', () => { 40 | 41 | it('sets the value if the parent exists and is valid', () => { 42 | doc = {'foo': ['bar']} 43 | move('/foo/0', '/hello') 44 | assert.equal(doc.foo[0], undefined) 45 | assert.equal(doc.hello, 'bar') 46 | }) 47 | 48 | it('throws an error if the parent does not exists', () => { 49 | doc = {'foo': []} 50 | assert.throws(() => { 51 | move('/foo/0/bar', '/foo/bar') 52 | }, Error) 53 | }) 54 | 55 | it('throws an error if the parent is not valid', () => { 56 | doc = {foo: true} 57 | assert.throws(() => { 58 | move('/foo/bar', '/bar/foo') 59 | }, Error) 60 | }) 61 | 62 | }) 63 | 64 | }) 65 | -------------------------------------------------------------------------------- /test/pack.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import pack from '../lib/pack' 5 | import unpack from '../lib/unpack' 6 | 7 | const patch = [ 8 | {"op": "add", "path": "/a/b/c", "value": ["foo", "bar"]}, 9 | {"op": "remove", "path": "/a/b/c"}, 10 | {"op": "replace", "path": "/a/b/c", "value": 42}, 11 | {"op": "move", "from": "/a/b/c", "path": "/a/b/d"}, 12 | {"op": "copy", "from": "/a/b/c", "path": "/a/b/e"}, 13 | {"op": "test", "path": "/a/b/c", "value": "foo"}, 14 | ] 15 | 16 | const packed = [ 17 | [0, "/a/b/c", ["foo", "bar"]], 18 | [1, "/a/b/c"], 19 | [2, "/a/b/c", 42], 20 | [3, "/a/b/d", "/a/b/c"], 21 | [4, "/a/b/e", "/a/b/c"], 22 | [5, "/a/b/c", "foo"], 23 | ] 24 | 25 | describe('pack', () => { 26 | it('packs correctly', () => { 27 | assert.deepEqual(pack(patch), packed) 28 | }) 29 | }) 30 | 31 | describe('unpack', () => { 32 | it('unpacks correctly', () => { 33 | assert.deepEqual(unpack(packed), patch) 34 | }) 35 | }) 36 | -------------------------------------------------------------------------------- /test/remove.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _remove from '../lib/remove' 5 | 6 | describe('remove', () => { 7 | 8 | let doc 9 | 10 | const remove = function(path) { 11 | return _remove(doc, path) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('removes and returns the value if the location exists', () => { 17 | doc = {foo: 'bar'} 18 | const r = remove('/foo') 19 | assert.strictEqual(Object.keys(r.doc).length, 0) 20 | assert.strictEqual(r.previous, 'bar') 21 | }) 22 | 23 | it('throws an error if the location does not exists', () => { 24 | doc = {} 25 | assert.throws(() => { 26 | remove('/foo') 27 | }, Error) 28 | }) 29 | 30 | it('throws an error if the path cannot be walked', () => { 31 | doc = {} 32 | assert.throws(() => { 33 | remove('/foo/bar') 34 | }, Error) 35 | }) 36 | 37 | }) 38 | 39 | describe('array location', () => { 40 | 41 | it('removes and returns the value if the location exists', () => { 42 | doc = ['bar'] 43 | const r = remove('/0') 44 | assert.strictEqual(r.doc.length, 0) 45 | assert.strictEqual(r.previous, 'bar') 46 | }) 47 | 48 | it('throws an error if the location does not exists', () => { 49 | doc = [] 50 | assert.throws(() => { 51 | remove('/0') 52 | }, Error) 53 | }) 54 | 55 | it('throws an error if the path cannot be walked', () => { 56 | doc = {} 57 | assert.throws(() => { 58 | remove('/foo/0') 59 | }, Error) 60 | }) 61 | 62 | }) 63 | 64 | }) 65 | -------------------------------------------------------------------------------- /test/replace.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import assert from 'assert' 4 | import _replace from '../lib/replace' 5 | 6 | describe('replace', () => { 7 | 8 | let doc 9 | 10 | const replace = function(path, obj) { 11 | return _replace(doc, path, obj) 12 | } 13 | 14 | describe('object location', () => { 15 | 16 | it('replaces the value if the parent exists and is valid', () => { 17 | doc = {'foo': 'hello'} 18 | const obj = {bar: 'foo'} 19 | const r = replace('/foo', {bar: 'foo'}) 20 | assert.deepEqual(r.doc.foo, obj) 21 | }) 22 | 23 | it('throws an error if the parent does not exists', () => { 24 | doc = {} 25 | assert.throws(() => { 26 | replace('/foo/bar', {bar: 'foo'}) 27 | }, Error) 28 | }) 29 | 30 | it('throws an error if the parent is not valid', () => { 31 | doc = {foo: 'bar'} 32 | assert.throws(() => { 33 | replace('/foo/bar', {bar: 'foo'}) 34 | }, Error) 35 | }) 36 | 37 | }) 38 | 39 | describe('array location', () => { 40 | 41 | it('replaces the value if the parent exists and is valid', () => { 42 | doc = {'foo': ['bar']} 43 | const r = replace('/foo/0', 'barfoo') 44 | assert.deepEqual(r.doc, {foo: ['barfoo']}) 45 | }) 46 | 47 | it('throws an error if the parent does not exists', () => { 48 | doc = {'foo': []} 49 | assert.throws(() => { 50 | replace('/foo/0/bar', 'foobar') 51 | }, Error) 52 | }) 53 | 54 | it('throws an error if the parent is not valid', () => { 55 | doc = {foo: true} 56 | assert.throws(() => { 57 | replace('/foo/bar', {bar: 'foo'}) 58 | }, Error) 59 | }) 60 | 61 | }) 62 | 63 | }) 64 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@browserify/acorn5-object-spread@^5.0.1": 6 | version "5.0.1" 7 | resolved "https://registry.yarnpkg.com/@browserify/acorn5-object-spread/-/acorn5-object-spread-5.0.1.tgz#92e9b37f97beac9ec429a3cc479ded380297540c" 8 | dependencies: 9 | acorn "^5.2.1" 10 | 11 | JSONStream@^1.0.3: 12 | version "1.3.2" 13 | resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.2.tgz#c102371b6ec3a7cf3b847ca00c20bb0fce4c6dea" 14 | dependencies: 15 | jsonparse "^1.2.0" 16 | through ">=2.2.7 <3" 17 | 18 | acorn@^4.0.3: 19 | version "4.0.13" 20 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" 21 | 22 | acorn@^5.2.1: 23 | version "5.3.0" 24 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.3.0.tgz#7446d39459c54fb49a80e6ee6478149b940ec822" 25 | 26 | ansi-regex@^1.0.0, ansi-regex@^1.1.1: 27 | version "1.1.1" 28 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-1.1.1.tgz#41c847194646375e6a1a5d10c3ca054ef9fc980d" 29 | 30 | ansi-regex@^2.0.0: 31 | version "2.1.1" 32 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 33 | 34 | ansi-styles@^2.2.1: 35 | version "2.2.1" 36 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" 37 | 38 | argparse@^1.0.7: 39 | version "1.0.9" 40 | resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" 41 | dependencies: 42 | sprintf-js "~1.0.2" 43 | 44 | array-filter@~0.0.0: 45 | version "0.0.1" 46 | resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec" 47 | 48 | array-map@~0.0.0: 49 | version "0.0.0" 50 | resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662" 51 | 52 | array-reduce@~0.0.0: 53 | version "0.0.0" 54 | resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b" 55 | 56 | asn1.js@^4.0.0: 57 | version "4.9.2" 58 | resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.2.tgz#8117ef4f7ed87cd8f89044b5bff97ac243a16c9a" 59 | dependencies: 60 | bn.js "^4.0.0" 61 | inherits "^2.0.1" 62 | minimalistic-assert "^1.0.0" 63 | 64 | assert@^1.4.0: 65 | version "1.4.1" 66 | resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" 67 | dependencies: 68 | util "0.10.3" 69 | 70 | astw@^2.0.0: 71 | version "2.2.0" 72 | resolved "https://registry.yarnpkg.com/astw/-/astw-2.2.0.tgz#7bd41784d32493987aeb239b6b4e1c57a873b917" 73 | dependencies: 74 | acorn "^4.0.3" 75 | 76 | babel-code-frame@^6.26.0: 77 | version "6.26.0" 78 | resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" 79 | dependencies: 80 | chalk "^1.1.3" 81 | esutils "^2.0.2" 82 | js-tokens "^3.0.2" 83 | 84 | babel-core@^6.26.0, babel-core@^6.8.0: 85 | version "6.26.0" 86 | resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" 87 | dependencies: 88 | babel-code-frame "^6.26.0" 89 | babel-generator "^6.26.0" 90 | babel-helpers "^6.24.1" 91 | babel-messages "^6.23.0" 92 | babel-register "^6.26.0" 93 | babel-runtime "^6.26.0" 94 | babel-template "^6.26.0" 95 | babel-traverse "^6.26.0" 96 | babel-types "^6.26.0" 97 | babylon "^6.18.0" 98 | convert-source-map "^1.5.0" 99 | debug "^2.6.8" 100 | json5 "^0.5.1" 101 | lodash "^4.17.4" 102 | minimatch "^3.0.4" 103 | path-is-absolute "^1.0.1" 104 | private "^0.1.7" 105 | slash "^1.0.0" 106 | source-map "^0.5.6" 107 | 108 | babel-generator@^6.26.0: 109 | version "6.26.0" 110 | resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" 111 | dependencies: 112 | babel-messages "^6.23.0" 113 | babel-runtime "^6.26.0" 114 | babel-types "^6.26.0" 115 | detect-indent "^4.0.0" 116 | jsesc "^1.3.0" 117 | lodash "^4.17.4" 118 | source-map "^0.5.6" 119 | trim-right "^1.0.1" 120 | 121 | babel-helper-call-delegate@^6.24.1: 122 | version "6.24.1" 123 | resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" 124 | dependencies: 125 | babel-helper-hoist-variables "^6.24.1" 126 | babel-runtime "^6.22.0" 127 | babel-traverse "^6.24.1" 128 | babel-types "^6.24.1" 129 | 130 | babel-helper-define-map@^6.24.1: 131 | version "6.26.0" 132 | resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" 133 | dependencies: 134 | babel-helper-function-name "^6.24.1" 135 | babel-runtime "^6.26.0" 136 | babel-types "^6.26.0" 137 | lodash "^4.17.4" 138 | 139 | babel-helper-function-name@^6.24.1: 140 | version "6.24.1" 141 | resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" 142 | dependencies: 143 | babel-helper-get-function-arity "^6.24.1" 144 | babel-runtime "^6.22.0" 145 | babel-template "^6.24.1" 146 | babel-traverse "^6.24.1" 147 | babel-types "^6.24.1" 148 | 149 | babel-helper-get-function-arity@^6.24.1: 150 | version "6.24.1" 151 | resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" 152 | dependencies: 153 | babel-runtime "^6.22.0" 154 | babel-types "^6.24.1" 155 | 156 | babel-helper-hoist-variables@^6.24.1: 157 | version "6.24.1" 158 | resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" 159 | dependencies: 160 | babel-runtime "^6.22.0" 161 | babel-types "^6.24.1" 162 | 163 | babel-helper-optimise-call-expression@^6.24.1: 164 | version "6.24.1" 165 | resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" 166 | dependencies: 167 | babel-runtime "^6.22.0" 168 | babel-types "^6.24.1" 169 | 170 | babel-helper-regex@^6.24.1: 171 | version "6.26.0" 172 | resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" 173 | dependencies: 174 | babel-runtime "^6.26.0" 175 | babel-types "^6.26.0" 176 | lodash "^4.17.4" 177 | 178 | babel-helper-replace-supers@^6.24.1: 179 | version "6.24.1" 180 | resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" 181 | dependencies: 182 | babel-helper-optimise-call-expression "^6.24.1" 183 | babel-messages "^6.23.0" 184 | babel-runtime "^6.22.0" 185 | babel-template "^6.24.1" 186 | babel-traverse "^6.24.1" 187 | babel-types "^6.24.1" 188 | 189 | babel-helpers@^6.24.1: 190 | version "6.24.1" 191 | resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" 192 | dependencies: 193 | babel-runtime "^6.22.0" 194 | babel-template "^6.24.1" 195 | 196 | babel-messages@^6.23.0: 197 | version "6.23.0" 198 | resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" 199 | dependencies: 200 | babel-runtime "^6.22.0" 201 | 202 | babel-plugin-check-es2015-constants@^6.22.0: 203 | version "6.22.0" 204 | resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" 205 | dependencies: 206 | babel-runtime "^6.22.0" 207 | 208 | babel-plugin-transform-es2015-arrow-functions@^6.22.0: 209 | version "6.22.0" 210 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" 211 | dependencies: 212 | babel-runtime "^6.22.0" 213 | 214 | babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: 215 | version "6.22.0" 216 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" 217 | dependencies: 218 | babel-runtime "^6.22.0" 219 | 220 | babel-plugin-transform-es2015-block-scoping@^6.24.1: 221 | version "6.26.0" 222 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" 223 | dependencies: 224 | babel-runtime "^6.26.0" 225 | babel-template "^6.26.0" 226 | babel-traverse "^6.26.0" 227 | babel-types "^6.26.0" 228 | lodash "^4.17.4" 229 | 230 | babel-plugin-transform-es2015-classes@^6.24.1: 231 | version "6.24.1" 232 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" 233 | dependencies: 234 | babel-helper-define-map "^6.24.1" 235 | babel-helper-function-name "^6.24.1" 236 | babel-helper-optimise-call-expression "^6.24.1" 237 | babel-helper-replace-supers "^6.24.1" 238 | babel-messages "^6.23.0" 239 | babel-runtime "^6.22.0" 240 | babel-template "^6.24.1" 241 | babel-traverse "^6.24.1" 242 | babel-types "^6.24.1" 243 | 244 | babel-plugin-transform-es2015-computed-properties@^6.24.1: 245 | version "6.24.1" 246 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" 247 | dependencies: 248 | babel-runtime "^6.22.0" 249 | babel-template "^6.24.1" 250 | 251 | babel-plugin-transform-es2015-destructuring@^6.22.0: 252 | version "6.23.0" 253 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" 254 | dependencies: 255 | babel-runtime "^6.22.0" 256 | 257 | babel-plugin-transform-es2015-duplicate-keys@^6.24.1: 258 | version "6.24.1" 259 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" 260 | dependencies: 261 | babel-runtime "^6.22.0" 262 | babel-types "^6.24.1" 263 | 264 | babel-plugin-transform-es2015-for-of@^6.22.0: 265 | version "6.23.0" 266 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" 267 | dependencies: 268 | babel-runtime "^6.22.0" 269 | 270 | babel-plugin-transform-es2015-function-name@^6.24.1: 271 | version "6.24.1" 272 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" 273 | dependencies: 274 | babel-helper-function-name "^6.24.1" 275 | babel-runtime "^6.22.0" 276 | babel-types "^6.24.1" 277 | 278 | babel-plugin-transform-es2015-literals@^6.22.0: 279 | version "6.22.0" 280 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" 281 | dependencies: 282 | babel-runtime "^6.22.0" 283 | 284 | babel-plugin-transform-es2015-modules-amd@^6.24.1: 285 | version "6.24.1" 286 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" 287 | dependencies: 288 | babel-plugin-transform-es2015-modules-commonjs "^6.24.1" 289 | babel-runtime "^6.22.0" 290 | babel-template "^6.24.1" 291 | 292 | babel-plugin-transform-es2015-modules-commonjs@^6.24.1: 293 | version "6.26.0" 294 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" 295 | dependencies: 296 | babel-plugin-transform-strict-mode "^6.24.1" 297 | babel-runtime "^6.26.0" 298 | babel-template "^6.26.0" 299 | babel-types "^6.26.0" 300 | 301 | babel-plugin-transform-es2015-modules-systemjs@^6.24.1: 302 | version "6.24.1" 303 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" 304 | dependencies: 305 | babel-helper-hoist-variables "^6.24.1" 306 | babel-runtime "^6.22.0" 307 | babel-template "^6.24.1" 308 | 309 | babel-plugin-transform-es2015-modules-umd@^6.24.1: 310 | version "6.24.1" 311 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" 312 | dependencies: 313 | babel-plugin-transform-es2015-modules-amd "^6.24.1" 314 | babel-runtime "^6.22.0" 315 | babel-template "^6.24.1" 316 | 317 | babel-plugin-transform-es2015-object-super@^6.24.1: 318 | version "6.24.1" 319 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" 320 | dependencies: 321 | babel-helper-replace-supers "^6.24.1" 322 | babel-runtime "^6.22.0" 323 | 324 | babel-plugin-transform-es2015-parameters@^6.24.1: 325 | version "6.24.1" 326 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" 327 | dependencies: 328 | babel-helper-call-delegate "^6.24.1" 329 | babel-helper-get-function-arity "^6.24.1" 330 | babel-runtime "^6.22.0" 331 | babel-template "^6.24.1" 332 | babel-traverse "^6.24.1" 333 | babel-types "^6.24.1" 334 | 335 | babel-plugin-transform-es2015-shorthand-properties@^6.24.1: 336 | version "6.24.1" 337 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" 338 | dependencies: 339 | babel-runtime "^6.22.0" 340 | babel-types "^6.24.1" 341 | 342 | babel-plugin-transform-es2015-spread@^6.22.0: 343 | version "6.22.0" 344 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" 345 | dependencies: 346 | babel-runtime "^6.22.0" 347 | 348 | babel-plugin-transform-es2015-sticky-regex@^6.24.1: 349 | version "6.24.1" 350 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" 351 | dependencies: 352 | babel-helper-regex "^6.24.1" 353 | babel-runtime "^6.22.0" 354 | babel-types "^6.24.1" 355 | 356 | babel-plugin-transform-es2015-template-literals@^6.22.0: 357 | version "6.22.0" 358 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" 359 | dependencies: 360 | babel-runtime "^6.22.0" 361 | 362 | babel-plugin-transform-es2015-typeof-symbol@^6.22.0: 363 | version "6.23.0" 364 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" 365 | dependencies: 366 | babel-runtime "^6.22.0" 367 | 368 | babel-plugin-transform-es2015-unicode-regex@^6.24.1: 369 | version "6.24.1" 370 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" 371 | dependencies: 372 | babel-helper-regex "^6.24.1" 373 | babel-runtime "^6.22.0" 374 | regexpu-core "^2.0.0" 375 | 376 | babel-plugin-transform-regenerator@^6.24.1: 377 | version "6.26.0" 378 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" 379 | dependencies: 380 | regenerator-transform "^0.10.0" 381 | 382 | babel-plugin-transform-strict-mode@^6.24.1: 383 | version "6.24.1" 384 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" 385 | dependencies: 386 | babel-runtime "^6.22.0" 387 | babel-types "^6.24.1" 388 | 389 | babel-preset-es2015@^6.3.13: 390 | version "6.24.1" 391 | resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" 392 | dependencies: 393 | babel-plugin-check-es2015-constants "^6.22.0" 394 | babel-plugin-transform-es2015-arrow-functions "^6.22.0" 395 | babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" 396 | babel-plugin-transform-es2015-block-scoping "^6.24.1" 397 | babel-plugin-transform-es2015-classes "^6.24.1" 398 | babel-plugin-transform-es2015-computed-properties "^6.24.1" 399 | babel-plugin-transform-es2015-destructuring "^6.22.0" 400 | babel-plugin-transform-es2015-duplicate-keys "^6.24.1" 401 | babel-plugin-transform-es2015-for-of "^6.22.0" 402 | babel-plugin-transform-es2015-function-name "^6.24.1" 403 | babel-plugin-transform-es2015-literals "^6.22.0" 404 | babel-plugin-transform-es2015-modules-amd "^6.24.1" 405 | babel-plugin-transform-es2015-modules-commonjs "^6.24.1" 406 | babel-plugin-transform-es2015-modules-systemjs "^6.24.1" 407 | babel-plugin-transform-es2015-modules-umd "^6.24.1" 408 | babel-plugin-transform-es2015-object-super "^6.24.1" 409 | babel-plugin-transform-es2015-parameters "^6.24.1" 410 | babel-plugin-transform-es2015-shorthand-properties "^6.24.1" 411 | babel-plugin-transform-es2015-spread "^6.22.0" 412 | babel-plugin-transform-es2015-sticky-regex "^6.24.1" 413 | babel-plugin-transform-es2015-template-literals "^6.22.0" 414 | babel-plugin-transform-es2015-typeof-symbol "^6.22.0" 415 | babel-plugin-transform-es2015-unicode-regex "^6.24.1" 416 | babel-plugin-transform-regenerator "^6.24.1" 417 | 418 | babel-register@^6.26.0: 419 | version "6.26.0" 420 | resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" 421 | dependencies: 422 | babel-core "^6.26.0" 423 | babel-runtime "^6.26.0" 424 | core-js "^2.5.0" 425 | home-or-tmp "^2.0.0" 426 | lodash "^4.17.4" 427 | mkdirp "^0.5.1" 428 | source-map-support "^0.4.15" 429 | 430 | babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: 431 | version "6.26.0" 432 | resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" 433 | dependencies: 434 | core-js "^2.4.0" 435 | regenerator-runtime "^0.11.0" 436 | 437 | babel-template@^6.24.1, babel-template@^6.26.0: 438 | version "6.26.0" 439 | resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" 440 | dependencies: 441 | babel-runtime "^6.26.0" 442 | babel-traverse "^6.26.0" 443 | babel-types "^6.26.0" 444 | babylon "^6.18.0" 445 | lodash "^4.17.4" 446 | 447 | babel-traverse@^6.24.1, babel-traverse@^6.26.0: 448 | version "6.26.0" 449 | resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" 450 | dependencies: 451 | babel-code-frame "^6.26.0" 452 | babel-messages "^6.23.0" 453 | babel-runtime "^6.26.0" 454 | babel-types "^6.26.0" 455 | babylon "^6.18.0" 456 | debug "^2.6.8" 457 | globals "^9.18.0" 458 | invariant "^2.2.2" 459 | lodash "^4.17.4" 460 | 461 | babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: 462 | version "6.26.0" 463 | resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" 464 | dependencies: 465 | babel-runtime "^6.26.0" 466 | esutils "^2.0.2" 467 | lodash "^4.17.4" 468 | to-fast-properties "^1.0.3" 469 | 470 | babylon@^6.18.0: 471 | version "6.18.0" 472 | resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" 473 | 474 | balanced-match@^1.0.0: 475 | version "1.0.0" 476 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 477 | 478 | base64-js@^1.0.2: 479 | version "1.2.1" 480 | resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" 481 | 482 | benchmark@^2.1.0: 483 | version "2.1.4" 484 | resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629" 485 | dependencies: 486 | lodash "^4.17.4" 487 | platform "^1.3.3" 488 | 489 | bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: 490 | version "4.11.8" 491 | resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f" 492 | 493 | brace-expansion@^1.0.0, brace-expansion@^1.1.7: 494 | version "1.1.8" 495 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" 496 | dependencies: 497 | balanced-match "^1.0.0" 498 | concat-map "0.0.1" 499 | 500 | brorand@^1.0.1: 501 | version "1.1.0" 502 | resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" 503 | 504 | browser-pack@^6.0.1: 505 | version "6.0.3" 506 | resolved "https://registry.yarnpkg.com/browser-pack/-/browser-pack-6.0.3.tgz#91ca96518583ef580ab063a309de62e407767a39" 507 | dependencies: 508 | JSONStream "^1.0.3" 509 | combine-source-map "~0.8.0" 510 | defined "^1.0.0" 511 | safe-buffer "^5.1.1" 512 | through2 "^2.0.0" 513 | umd "^3.0.0" 514 | 515 | browser-resolve@^1.11.0, browser-resolve@^1.7.0: 516 | version "1.11.2" 517 | resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" 518 | dependencies: 519 | resolve "1.1.7" 520 | 521 | browser-stdout@1.3.0: 522 | version "1.3.0" 523 | resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" 524 | 525 | browserify-aes@^1.0.0, browserify-aes@^1.0.4: 526 | version "1.1.1" 527 | resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.1.1.tgz#38b7ab55edb806ff2dcda1a7f1620773a477c49f" 528 | dependencies: 529 | buffer-xor "^1.0.3" 530 | cipher-base "^1.0.0" 531 | create-hash "^1.1.0" 532 | evp_bytestokey "^1.0.3" 533 | inherits "^2.0.1" 534 | safe-buffer "^5.0.1" 535 | 536 | browserify-cipher@^1.0.0: 537 | version "1.0.0" 538 | resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" 539 | dependencies: 540 | browserify-aes "^1.0.4" 541 | browserify-des "^1.0.0" 542 | evp_bytestokey "^1.0.0" 543 | 544 | browserify-des@^1.0.0: 545 | version "1.0.0" 546 | resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" 547 | dependencies: 548 | cipher-base "^1.0.1" 549 | des.js "^1.0.0" 550 | inherits "^2.0.1" 551 | 552 | browserify-rsa@^4.0.0: 553 | version "4.0.1" 554 | resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" 555 | dependencies: 556 | bn.js "^4.1.0" 557 | randombytes "^2.0.1" 558 | 559 | browserify-sign@^4.0.0: 560 | version "4.0.4" 561 | resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.4.tgz#aa4eb68e5d7b658baa6bf6a57e630cbd7a93d298" 562 | dependencies: 563 | bn.js "^4.1.1" 564 | browserify-rsa "^4.0.0" 565 | create-hash "^1.1.0" 566 | create-hmac "^1.1.2" 567 | elliptic "^6.0.0" 568 | inherits "^2.0.1" 569 | parse-asn1 "^5.0.0" 570 | 571 | browserify-zlib@~0.2.0: 572 | version "0.2.0" 573 | resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.2.0.tgz#2869459d9aa3be245fe8fe2ca1f46e2e7f54d73f" 574 | dependencies: 575 | pako "~1.0.5" 576 | 577 | browserify@^15.2.0: 578 | version "15.2.0" 579 | resolved "https://registry.yarnpkg.com/browserify/-/browserify-15.2.0.tgz#1e121ba1fa72cf9fd2d8df002f8674b68b45df89" 580 | dependencies: 581 | JSONStream "^1.0.3" 582 | assert "^1.4.0" 583 | browser-pack "^6.0.1" 584 | browser-resolve "^1.11.0" 585 | browserify-zlib "~0.2.0" 586 | buffer "^5.0.2" 587 | cached-path-relative "^1.0.0" 588 | concat-stream "~1.5.1" 589 | console-browserify "^1.1.0" 590 | constants-browserify "~1.0.0" 591 | crypto-browserify "^3.0.0" 592 | defined "^1.0.0" 593 | deps-sort "^2.0.0" 594 | domain-browser "~1.1.0" 595 | duplexer2 "~0.1.2" 596 | events "~1.1.0" 597 | glob "^7.1.0" 598 | has "^1.0.0" 599 | htmlescape "^1.1.0" 600 | https-browserify "^1.0.0" 601 | inherits "~2.0.1" 602 | insert-module-globals "^7.0.0" 603 | labeled-stream-splicer "^2.0.0" 604 | mkdirp "^0.5.0" 605 | module-deps "^5.0.1" 606 | os-browserify "~0.3.0" 607 | parents "^1.0.1" 608 | path-browserify "~0.0.0" 609 | process "~0.11.0" 610 | punycode "^1.3.2" 611 | querystring-es3 "~0.2.0" 612 | read-only-stream "^2.0.0" 613 | readable-stream "^2.0.2" 614 | resolve "^1.1.4" 615 | shasum "^1.0.0" 616 | shell-quote "^1.6.1" 617 | stream-browserify "^2.0.0" 618 | stream-http "^2.0.0" 619 | string_decoder "~1.0.0" 620 | subarg "^1.0.0" 621 | syntax-error "^1.1.1" 622 | through2 "^2.0.0" 623 | timers-browserify "^1.0.1" 624 | tty-browserify "~0.0.0" 625 | url "~0.11.0" 626 | util "~0.10.1" 627 | vm-browserify "~0.0.1" 628 | xtend "^4.0.0" 629 | 630 | buffer-xor@^1.0.3: 631 | version "1.0.3" 632 | resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" 633 | 634 | buffer@^5.0.2: 635 | version "5.0.8" 636 | resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.0.8.tgz#84daa52e7cf2fa8ce4195bc5cf0f7809e0930b24" 637 | dependencies: 638 | base64-js "^1.0.2" 639 | ieee754 "^1.1.4" 640 | 641 | builtin-status-codes@^3.0.0: 642 | version "3.0.0" 643 | resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" 644 | 645 | cached-path-relative@^1.0.0: 646 | version "1.0.1" 647 | resolved "https://registry.yarnpkg.com/cached-path-relative/-/cached-path-relative-1.0.1.tgz#d09c4b52800aa4c078e2dd81a869aac90d2e54e7" 648 | 649 | chalk@^1.0.0, chalk@^1.1.3: 650 | version "1.1.3" 651 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" 652 | dependencies: 653 | ansi-styles "^2.2.1" 654 | escape-string-regexp "^1.0.2" 655 | has-ansi "^2.0.0" 656 | strip-ansi "^3.0.0" 657 | supports-color "^2.0.0" 658 | 659 | cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: 660 | version "1.0.4" 661 | resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" 662 | dependencies: 663 | inherits "^2.0.1" 664 | safe-buffer "^5.0.1" 665 | 666 | cli-width@^1.0.1: 667 | version "1.1.1" 668 | resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-1.1.1.tgz#a4d293ef67ebb7b88d4a4d42c0ccf00c4d1e366d" 669 | 670 | combine-source-map@~0.7.1: 671 | version "0.7.2" 672 | resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.7.2.tgz#0870312856b307a87cc4ac486f3a9a62aeccc09e" 673 | dependencies: 674 | convert-source-map "~1.1.0" 675 | inline-source-map "~0.6.0" 676 | lodash.memoize "~3.0.3" 677 | source-map "~0.5.3" 678 | 679 | combine-source-map@~0.8.0: 680 | version "0.8.0" 681 | resolved "https://registry.yarnpkg.com/combine-source-map/-/combine-source-map-0.8.0.tgz#a58d0df042c186fcf822a8e8015f5450d2d79a8b" 682 | dependencies: 683 | convert-source-map "~1.1.0" 684 | inline-source-map "~0.6.0" 685 | lodash.memoize "~3.0.3" 686 | source-map "~0.5.3" 687 | 688 | commander@2.11.0: 689 | version "2.11.0" 690 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" 691 | 692 | concat-map@0.0.1: 693 | version "0.0.1" 694 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 695 | 696 | concat-stream@^1.4.6, concat-stream@~1.6.0: 697 | version "1.6.0" 698 | resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7" 699 | dependencies: 700 | inherits "^2.0.3" 701 | readable-stream "^2.2.2" 702 | typedarray "^0.0.6" 703 | 704 | concat-stream@~1.5.1: 705 | version "1.5.2" 706 | resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.5.2.tgz#708978624d856af41a5a741defdd261da752c266" 707 | dependencies: 708 | inherits "~2.0.1" 709 | readable-stream "~2.0.0" 710 | typedarray "~0.0.5" 711 | 712 | console-browserify@^1.1.0: 713 | version "1.1.0" 714 | resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" 715 | dependencies: 716 | date-now "^0.1.4" 717 | 718 | constants-browserify@~1.0.0: 719 | version "1.0.0" 720 | resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" 721 | 722 | convert-source-map@^1.5.0: 723 | version "1.5.1" 724 | resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" 725 | 726 | convert-source-map@~1.1.0: 727 | version "1.1.3" 728 | resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.1.3.tgz#4829c877e9fe49b3161f3bf3673888e204699860" 729 | 730 | core-js@^2.4.0, core-js@^2.5.0: 731 | version "2.5.3" 732 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.3.tgz#8acc38345824f16d8365b7c9b4259168e8ed603e" 733 | 734 | core-util-is@~1.0.0: 735 | version "1.0.2" 736 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 737 | 738 | create-ecdh@^4.0.0: 739 | version "4.0.0" 740 | resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" 741 | dependencies: 742 | bn.js "^4.1.0" 743 | elliptic "^6.0.0" 744 | 745 | create-hash@^1.1.0, create-hash@^1.1.2: 746 | version "1.1.3" 747 | resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.3.tgz#606042ac8b9262750f483caddab0f5819172d8fd" 748 | dependencies: 749 | cipher-base "^1.0.1" 750 | inherits "^2.0.1" 751 | ripemd160 "^2.0.0" 752 | sha.js "^2.4.0" 753 | 754 | create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: 755 | version "1.1.6" 756 | resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.6.tgz#acb9e221a4e17bdb076e90657c42b93e3726cf06" 757 | dependencies: 758 | cipher-base "^1.0.3" 759 | create-hash "^1.1.0" 760 | inherits "^2.0.1" 761 | ripemd160 "^2.0.0" 762 | safe-buffer "^5.0.1" 763 | sha.js "^2.4.8" 764 | 765 | crypto-browserify@^3.0.0: 766 | version "3.12.0" 767 | resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" 768 | dependencies: 769 | browserify-cipher "^1.0.0" 770 | browserify-sign "^4.0.0" 771 | create-ecdh "^4.0.0" 772 | create-hash "^1.1.0" 773 | create-hmac "^1.1.0" 774 | diffie-hellman "^5.0.0" 775 | inherits "^2.0.1" 776 | pbkdf2 "^3.0.3" 777 | public-encrypt "^4.0.0" 778 | randombytes "^2.0.0" 779 | randomfill "^1.0.3" 780 | 781 | d@1: 782 | version "1.0.0" 783 | resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" 784 | dependencies: 785 | es5-ext "^0.10.9" 786 | 787 | date-now@^0.1.4: 788 | version "0.1.4" 789 | resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" 790 | 791 | debug@3.1.0: 792 | version "3.1.0" 793 | resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" 794 | dependencies: 795 | ms "2.0.0" 796 | 797 | debug@^2.1.1, debug@^2.6.8: 798 | version "2.6.9" 799 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" 800 | dependencies: 801 | ms "2.0.0" 802 | 803 | deep-equal@^1.0.1: 804 | version "1.0.1" 805 | resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" 806 | 807 | deep-is@~0.1.2: 808 | version "0.1.3" 809 | resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" 810 | 811 | defined@^1.0.0: 812 | version "1.0.0" 813 | resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" 814 | 815 | deps-sort@^2.0.0: 816 | version "2.0.0" 817 | resolved "https://registry.yarnpkg.com/deps-sort/-/deps-sort-2.0.0.tgz#091724902e84658260eb910748cccd1af6e21fb5" 818 | dependencies: 819 | JSONStream "^1.0.3" 820 | shasum "^1.0.0" 821 | subarg "^1.0.0" 822 | through2 "^2.0.0" 823 | 824 | des.js@^1.0.0: 825 | version "1.0.0" 826 | resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" 827 | dependencies: 828 | inherits "^2.0.1" 829 | minimalistic-assert "^1.0.0" 830 | 831 | detect-indent@^4.0.0: 832 | version "4.0.0" 833 | resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" 834 | dependencies: 835 | repeating "^2.0.0" 836 | 837 | detective@^5.0.2: 838 | version "5.0.2" 839 | resolved "https://registry.yarnpkg.com/detective/-/detective-5.0.2.tgz#84ec2e1c581e74211e2ae4ffce1edf52c3263f84" 840 | dependencies: 841 | "@browserify/acorn5-object-spread" "^5.0.1" 842 | acorn "^5.2.1" 843 | defined "^1.0.0" 844 | 845 | diff@3.3.1: 846 | version "3.3.1" 847 | resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.1.tgz#aa8567a6eed03c531fc89d3f711cd0e5259dec75" 848 | 849 | diffie-hellman@^5.0.0: 850 | version "5.0.2" 851 | resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" 852 | dependencies: 853 | bn.js "^4.1.0" 854 | miller-rabin "^4.0.0" 855 | randombytes "^2.0.0" 856 | 857 | doctrine@^0.6.2: 858 | version "0.6.4" 859 | resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-0.6.4.tgz#81428491a942ef18b0492056eda3800eee57d61d" 860 | dependencies: 861 | esutils "^1.1.6" 862 | isarray "0.0.1" 863 | 864 | domain-browser@~1.1.0: 865 | version "1.1.7" 866 | resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" 867 | 868 | duplexer2@^0.1.2, duplexer2@~0.1.0, duplexer2@~0.1.2: 869 | version "0.1.4" 870 | resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" 871 | dependencies: 872 | readable-stream "^2.0.2" 873 | 874 | elliptic@^6.0.0: 875 | version "6.4.0" 876 | resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.4.0.tgz#cac9af8762c85836187003c8dfe193e5e2eae5df" 877 | dependencies: 878 | bn.js "^4.4.0" 879 | brorand "^1.0.1" 880 | hash.js "^1.0.0" 881 | hmac-drbg "^1.0.0" 882 | inherits "^2.0.1" 883 | minimalistic-assert "^1.0.0" 884 | minimalistic-crypto-utils "^1.0.0" 885 | 886 | es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: 887 | version "0.10.38" 888 | resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.38.tgz#fa7d40d65bbc9bb8a67e1d3f9cc656a00530eed3" 889 | dependencies: 890 | es6-iterator "~2.0.3" 891 | es6-symbol "~3.1.1" 892 | 893 | es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: 894 | version "2.0.3" 895 | resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" 896 | dependencies: 897 | d "1" 898 | es5-ext "^0.10.35" 899 | es6-symbol "^3.1.1" 900 | 901 | es6-map@^0.1.3: 902 | version "0.1.5" 903 | resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" 904 | dependencies: 905 | d "1" 906 | es5-ext "~0.10.14" 907 | es6-iterator "~2.0.1" 908 | es6-set "~0.1.5" 909 | es6-symbol "~3.1.1" 910 | event-emitter "~0.3.5" 911 | 912 | es6-set@~0.1.5: 913 | version "0.1.5" 914 | resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" 915 | dependencies: 916 | d "1" 917 | es5-ext "~0.10.14" 918 | es6-iterator "~2.0.1" 919 | es6-symbol "3.1.1" 920 | event-emitter "~0.3.5" 921 | 922 | es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: 923 | version "3.1.1" 924 | resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" 925 | dependencies: 926 | d "1" 927 | es5-ext "~0.10.14" 928 | 929 | es6-weak-map@^2.0.1: 930 | version "2.0.2" 931 | resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" 932 | dependencies: 933 | d "1" 934 | es5-ext "^0.10.14" 935 | es6-iterator "^2.0.1" 936 | es6-symbol "^3.1.1" 937 | 938 | escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: 939 | version "1.0.5" 940 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 941 | 942 | escope@^3.1.0: 943 | version "3.6.0" 944 | resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" 945 | dependencies: 946 | es6-map "^0.1.3" 947 | es6-weak-map "^2.0.1" 948 | esrecurse "^4.1.0" 949 | estraverse "^4.1.1" 950 | 951 | eslint@^0.24.1: 952 | version "0.24.1" 953 | resolved "https://registry.yarnpkg.com/eslint/-/eslint-0.24.1.tgz#54a50809855b9655721c6f2ee57b351edce28101" 954 | dependencies: 955 | chalk "^1.0.0" 956 | concat-stream "^1.4.6" 957 | debug "^2.1.1" 958 | doctrine "^0.6.2" 959 | escape-string-regexp "^1.0.2" 960 | escope "^3.1.0" 961 | espree "^2.0.1" 962 | estraverse "^4.1.0" 963 | estraverse-fb "^1.3.1" 964 | globals "^8.0.0" 965 | inquirer "^0.8.2" 966 | is-my-json-valid "^2.10.0" 967 | js-yaml "^3.2.5" 968 | minimatch "^2.0.1" 969 | mkdirp "^0.5.0" 970 | object-assign "^2.0.0" 971 | optionator "^0.5.0" 972 | path-is-absolute "^1.0.0" 973 | strip-json-comments "~1.0.1" 974 | text-table "~0.2.0" 975 | user-home "^1.0.0" 976 | xml-escape "~1.0.0" 977 | 978 | espree@^2.0.1: 979 | version "2.2.5" 980 | resolved "https://registry.yarnpkg.com/espree/-/espree-2.2.5.tgz#df691b9310889402aeb29cc066708c56690b854b" 981 | 982 | esprima@^4.0.0: 983 | version "4.0.0" 984 | resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804" 985 | 986 | esrecurse@^4.1.0: 987 | version "4.2.0" 988 | resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" 989 | dependencies: 990 | estraverse "^4.1.0" 991 | object-assign "^4.0.1" 992 | 993 | estraverse-fb@^1.3.1: 994 | version "1.3.2" 995 | resolved "https://registry.yarnpkg.com/estraverse-fb/-/estraverse-fb-1.3.2.tgz#d323a4cb5e5ac331cea033413a9253e1643e07c4" 996 | 997 | estraverse@^4.1.0, estraverse@^4.1.1: 998 | version "4.2.0" 999 | resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" 1000 | 1001 | esutils@^1.1.6: 1002 | version "1.1.6" 1003 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.1.6.tgz#c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375" 1004 | 1005 | esutils@^2.0.2: 1006 | version "2.0.2" 1007 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" 1008 | 1009 | event-emitter@~0.3.5: 1010 | version "0.3.5" 1011 | resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" 1012 | dependencies: 1013 | d "1" 1014 | es5-ext "~0.10.14" 1015 | 1016 | events@~1.1.0: 1017 | version "1.1.1" 1018 | resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" 1019 | 1020 | evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: 1021 | version "1.0.3" 1022 | resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" 1023 | dependencies: 1024 | md5.js "^1.3.4" 1025 | safe-buffer "^5.1.1" 1026 | 1027 | fast-json-patch@^2.0.6: 1028 | version "2.0.6" 1029 | resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-2.0.6.tgz#86fff8f8662391aa819722864d632e603e6ee605" 1030 | dependencies: 1031 | deep-equal "^1.0.1" 1032 | 1033 | fast-levenshtein@~1.0.0: 1034 | version "1.0.7" 1035 | resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-1.0.7.tgz#0178dcdee023b92905193af0959e8a7639cfdcb9" 1036 | 1037 | figures@^1.3.5: 1038 | version "1.7.0" 1039 | resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" 1040 | dependencies: 1041 | escape-string-regexp "^1.0.5" 1042 | object-assign "^4.1.0" 1043 | 1044 | fs.realpath@^1.0.0: 1045 | version "1.0.0" 1046 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 1047 | 1048 | function-bind@^1.0.2: 1049 | version "1.1.1" 1050 | resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" 1051 | 1052 | generate-function@^2.0.0: 1053 | version "2.0.0" 1054 | resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" 1055 | 1056 | generate-object-property@^1.1.0: 1057 | version "1.2.0" 1058 | resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" 1059 | dependencies: 1060 | is-property "^1.0.0" 1061 | 1062 | glob@7.1.2, glob@^7.1.0: 1063 | version "7.1.2" 1064 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" 1065 | dependencies: 1066 | fs.realpath "^1.0.0" 1067 | inflight "^1.0.4" 1068 | inherits "2" 1069 | minimatch "^3.0.4" 1070 | once "^1.3.0" 1071 | path-is-absolute "^1.0.0" 1072 | 1073 | globals@^8.0.0: 1074 | version "8.18.0" 1075 | resolved "https://registry.yarnpkg.com/globals/-/globals-8.18.0.tgz#93d4a62bdcac38cfafafc47d6b034768cb0ffcb4" 1076 | 1077 | globals@^9.18.0: 1078 | version "9.18.0" 1079 | resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" 1080 | 1081 | growl@1.10.3: 1082 | version "1.10.3" 1083 | resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.3.tgz#1926ba90cf3edfe2adb4927f5880bc22c66c790f" 1084 | 1085 | has-ansi@^2.0.0: 1086 | version "2.0.0" 1087 | resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" 1088 | dependencies: 1089 | ansi-regex "^2.0.0" 1090 | 1091 | has-flag@^2.0.0: 1092 | version "2.0.0" 1093 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" 1094 | 1095 | has@^1.0.0: 1096 | version "1.0.1" 1097 | resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" 1098 | dependencies: 1099 | function-bind "^1.0.2" 1100 | 1101 | hash-base@^2.0.0: 1102 | version "2.0.2" 1103 | resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-2.0.2.tgz#66ea1d856db4e8a5470cadf6fce23ae5244ef2e1" 1104 | dependencies: 1105 | inherits "^2.0.1" 1106 | 1107 | hash-base@^3.0.0: 1108 | version "3.0.4" 1109 | resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.0.4.tgz#5fc8686847ecd73499403319a6b0a3f3f6ae4918" 1110 | dependencies: 1111 | inherits "^2.0.1" 1112 | safe-buffer "^5.0.1" 1113 | 1114 | hash.js@^1.0.0, hash.js@^1.0.3: 1115 | version "1.1.3" 1116 | resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" 1117 | dependencies: 1118 | inherits "^2.0.3" 1119 | minimalistic-assert "^1.0.0" 1120 | 1121 | he@1.1.1: 1122 | version "1.1.1" 1123 | resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd" 1124 | 1125 | hmac-drbg@^1.0.0: 1126 | version "1.0.1" 1127 | resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" 1128 | dependencies: 1129 | hash.js "^1.0.3" 1130 | minimalistic-assert "^1.0.0" 1131 | minimalistic-crypto-utils "^1.0.1" 1132 | 1133 | home-or-tmp@^2.0.0: 1134 | version "2.0.0" 1135 | resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" 1136 | dependencies: 1137 | os-homedir "^1.0.0" 1138 | os-tmpdir "^1.0.1" 1139 | 1140 | htmlescape@^1.1.0: 1141 | version "1.1.1" 1142 | resolved "https://registry.yarnpkg.com/htmlescape/-/htmlescape-1.1.1.tgz#3a03edc2214bca3b66424a3e7959349509cb0351" 1143 | 1144 | https-browserify@^1.0.0: 1145 | version "1.0.0" 1146 | resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" 1147 | 1148 | ieee754@^1.1.4: 1149 | version "1.1.8" 1150 | resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" 1151 | 1152 | indexof@0.0.1: 1153 | version "0.0.1" 1154 | resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" 1155 | 1156 | inflight@^1.0.4: 1157 | version "1.0.6" 1158 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 1159 | dependencies: 1160 | once "^1.3.0" 1161 | wrappy "1" 1162 | 1163 | inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: 1164 | version "2.0.3" 1165 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 1166 | 1167 | inherits@2.0.1: 1168 | version "2.0.1" 1169 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" 1170 | 1171 | inline-source-map@~0.6.0: 1172 | version "0.6.2" 1173 | resolved "https://registry.yarnpkg.com/inline-source-map/-/inline-source-map-0.6.2.tgz#f9393471c18a79d1724f863fa38b586370ade2a5" 1174 | dependencies: 1175 | source-map "~0.5.3" 1176 | 1177 | inquirer@^0.8.2: 1178 | version "0.8.5" 1179 | resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.8.5.tgz#dbd740cf6ca3b731296a63ce6f6d961851f336df" 1180 | dependencies: 1181 | ansi-regex "^1.1.1" 1182 | chalk "^1.0.0" 1183 | cli-width "^1.0.1" 1184 | figures "^1.3.5" 1185 | lodash "^3.3.1" 1186 | readline2 "^0.1.1" 1187 | rx "^2.4.3" 1188 | through "^2.3.6" 1189 | 1190 | insert-module-globals@^7.0.0: 1191 | version "7.0.1" 1192 | resolved "https://registry.yarnpkg.com/insert-module-globals/-/insert-module-globals-7.0.1.tgz#c03bf4e01cb086d5b5e5ace8ad0afe7889d638c3" 1193 | dependencies: 1194 | JSONStream "^1.0.3" 1195 | combine-source-map "~0.7.1" 1196 | concat-stream "~1.5.1" 1197 | is-buffer "^1.1.0" 1198 | lexical-scope "^1.2.0" 1199 | process "~0.11.0" 1200 | through2 "^2.0.0" 1201 | xtend "^4.0.0" 1202 | 1203 | invariant@^2.2.2: 1204 | version "2.2.2" 1205 | resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" 1206 | dependencies: 1207 | loose-envify "^1.0.0" 1208 | 1209 | is-buffer@^1.1.0: 1210 | version "1.1.6" 1211 | resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" 1212 | 1213 | is-finite@^1.0.0: 1214 | version "1.0.2" 1215 | resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" 1216 | dependencies: 1217 | number-is-nan "^1.0.0" 1218 | 1219 | is-my-json-valid@^2.10.0: 1220 | version "2.17.1" 1221 | resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz#3da98914a70a22f0a8563ef1511a246c6fc55471" 1222 | dependencies: 1223 | generate-function "^2.0.0" 1224 | generate-object-property "^1.1.0" 1225 | jsonpointer "^4.0.0" 1226 | xtend "^4.0.0" 1227 | 1228 | is-property@^1.0.0: 1229 | version "1.0.2" 1230 | resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" 1231 | 1232 | isarray@0.0.1, isarray@~0.0.1: 1233 | version "0.0.1" 1234 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" 1235 | 1236 | isarray@~1.0.0: 1237 | version "1.0.0" 1238 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 1239 | 1240 | jiff@^0.7.3: 1241 | version "0.7.3" 1242 | resolved "https://registry.yarnpkg.com/jiff/-/jiff-0.7.3.tgz#42db5d9140f1804399bb501747055a9434f40f46" 1243 | 1244 | js-tokens@^3.0.0, js-tokens@^3.0.2: 1245 | version "3.0.2" 1246 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" 1247 | 1248 | js-yaml@^3.2.5: 1249 | version "3.10.0" 1250 | resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc" 1251 | dependencies: 1252 | argparse "^1.0.7" 1253 | esprima "^4.0.0" 1254 | 1255 | jsesc@^1.3.0: 1256 | version "1.3.0" 1257 | resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" 1258 | 1259 | jsesc@~0.5.0: 1260 | version "0.5.0" 1261 | resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" 1262 | 1263 | json-patch-test-suite@^1.1.0: 1264 | version "1.1.0" 1265 | resolved "https://registry.yarnpkg.com/json-patch-test-suite/-/json-patch-test-suite-1.1.0.tgz#e12a7f067371ce6953b55fa8d6e2f64800916711" 1266 | 1267 | json-patch@^0.7.0: 1268 | version "0.7.0" 1269 | resolved "https://registry.yarnpkg.com/json-patch/-/json-patch-0.7.0.tgz#2598958ea67fa3660dae8ee684d35407b37f4b98" 1270 | 1271 | json-stable-stringify@~0.0.0: 1272 | version "0.0.1" 1273 | resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz#611c23e814db375527df851193db59dd2af27f45" 1274 | dependencies: 1275 | jsonify "~0.0.0" 1276 | 1277 | json5@^0.5.1: 1278 | version "0.5.1" 1279 | resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" 1280 | 1281 | json8-pointer@^0.7.1: 1282 | version "0.7.1" 1283 | resolved "https://registry.yarnpkg.com/json8-pointer/-/json8-pointer-0.7.1.tgz#e4acefd44323f035cf4a25558c503fb7dd5c88d9" 1284 | 1285 | json8@^0.9.0: 1286 | version "0.9.2" 1287 | resolved "https://registry.yarnpkg.com/json8/-/json8-0.9.2.tgz#dced62a24c8ed457702d45c71068081925c3011f" 1288 | 1289 | jsonify@~0.0.0: 1290 | version "0.0.0" 1291 | resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" 1292 | 1293 | jsonparse@^1.2.0: 1294 | version "1.3.1" 1295 | resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" 1296 | 1297 | jsonpatch@^3.0.1: 1298 | version "3.0.1" 1299 | resolved "https://registry.yarnpkg.com/jsonpatch/-/jsonpatch-3.0.1.tgz#97225367c1c3c5bf1641be59b2f73be19759f06f" 1300 | 1301 | jsonpointer@^4.0.0: 1302 | version "4.0.1" 1303 | resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" 1304 | 1305 | labeled-stream-splicer@^2.0.0: 1306 | version "2.0.0" 1307 | resolved "https://registry.yarnpkg.com/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz#a52e1d138024c00b86b1c0c91f677918b8ae0a59" 1308 | dependencies: 1309 | inherits "^2.0.1" 1310 | isarray "~0.0.1" 1311 | stream-splicer "^2.0.0" 1312 | 1313 | levn@~0.2.5: 1314 | version "0.2.5" 1315 | resolved "https://registry.yarnpkg.com/levn/-/levn-0.2.5.tgz#ba8d339d0ca4a610e3a3f145b9caf48807155054" 1316 | dependencies: 1317 | prelude-ls "~1.1.0" 1318 | type-check "~0.3.1" 1319 | 1320 | lexical-scope@^1.2.0: 1321 | version "1.2.0" 1322 | resolved "https://registry.yarnpkg.com/lexical-scope/-/lexical-scope-1.2.0.tgz#fcea5edc704a4b3a8796cdca419c3a0afaf22df4" 1323 | dependencies: 1324 | astw "^2.0.0" 1325 | 1326 | lodash.memoize@~3.0.3: 1327 | version "3.0.4" 1328 | resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-3.0.4.tgz#2dcbd2c287cbc0a55cc42328bd0c736150d53e3f" 1329 | 1330 | lodash@^3.3.1: 1331 | version "3.10.1" 1332 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" 1333 | 1334 | lodash@^4.17.4: 1335 | version "4.17.4" 1336 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" 1337 | 1338 | loose-envify@^1.0.0: 1339 | version "1.3.1" 1340 | resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" 1341 | dependencies: 1342 | js-tokens "^3.0.0" 1343 | 1344 | md5.js@^1.3.4: 1345 | version "1.3.4" 1346 | resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" 1347 | dependencies: 1348 | hash-base "^3.0.0" 1349 | inherits "^2.0.1" 1350 | 1351 | miller-rabin@^4.0.0: 1352 | version "4.0.1" 1353 | resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" 1354 | dependencies: 1355 | bn.js "^4.0.0" 1356 | brorand "^1.0.1" 1357 | 1358 | minimalistic-assert@^1.0.0: 1359 | version "1.0.0" 1360 | resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" 1361 | 1362 | minimalistic-crypto-utils@^1.0.0, minimalistic-crypto-utils@^1.0.1: 1363 | version "1.0.1" 1364 | resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" 1365 | 1366 | minimatch@^2.0.1: 1367 | version "2.0.10" 1368 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" 1369 | dependencies: 1370 | brace-expansion "^1.0.0" 1371 | 1372 | minimatch@^3.0.4: 1373 | version "3.0.4" 1374 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 1375 | dependencies: 1376 | brace-expansion "^1.1.7" 1377 | 1378 | minimist@0.0.8: 1379 | version "0.0.8" 1380 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 1381 | 1382 | minimist@^1.1.0: 1383 | version "1.2.0" 1384 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 1385 | 1386 | mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: 1387 | version "0.5.1" 1388 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 1389 | dependencies: 1390 | minimist "0.0.8" 1391 | 1392 | mocha@^5.0.0: 1393 | version "5.0.0" 1394 | resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.0.0.tgz#cccac988b0bc5477119cba0e43de7af6d6ad8f4e" 1395 | dependencies: 1396 | browser-stdout "1.3.0" 1397 | commander "2.11.0" 1398 | debug "3.1.0" 1399 | diff "3.3.1" 1400 | escape-string-regexp "1.0.5" 1401 | glob "7.1.2" 1402 | growl "1.10.3" 1403 | he "1.1.1" 1404 | mkdirp "0.5.1" 1405 | supports-color "4.4.0" 1406 | 1407 | module-deps@^5.0.1: 1408 | version "5.0.1" 1409 | resolved "https://registry.yarnpkg.com/module-deps/-/module-deps-5.0.1.tgz#3bc47c14b0a6d925aff2ec4a177b456a96ae0396" 1410 | dependencies: 1411 | JSONStream "^1.0.3" 1412 | browser-resolve "^1.7.0" 1413 | cached-path-relative "^1.0.0" 1414 | concat-stream "~1.6.0" 1415 | defined "^1.0.0" 1416 | detective "^5.0.2" 1417 | duplexer2 "^0.1.2" 1418 | inherits "^2.0.1" 1419 | parents "^1.0.0" 1420 | readable-stream "^2.0.2" 1421 | resolve "^1.1.3" 1422 | stream-combiner2 "^1.1.1" 1423 | subarg "^1.0.0" 1424 | through2 "^2.0.0" 1425 | xtend "^4.0.0" 1426 | 1427 | ms@2.0.0: 1428 | version "2.0.0" 1429 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 1430 | 1431 | mute-stream@0.0.4: 1432 | version "0.0.4" 1433 | resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.4.tgz#a9219960a6d5d5d046597aee51252c6655f7177e" 1434 | 1435 | number-is-nan@^1.0.0: 1436 | version "1.0.1" 1437 | resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" 1438 | 1439 | object-assign@^2.0.0: 1440 | version "2.1.1" 1441 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" 1442 | 1443 | object-assign@^4.0.1, object-assign@^4.1.0: 1444 | version "4.1.1" 1445 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 1446 | 1447 | once@^1.3.0: 1448 | version "1.4.0" 1449 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 1450 | dependencies: 1451 | wrappy "1" 1452 | 1453 | optionator@^0.5.0: 1454 | version "0.5.0" 1455 | resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.5.0.tgz#b75a8995a2d417df25b6e4e3862f50aa88651368" 1456 | dependencies: 1457 | deep-is "~0.1.2" 1458 | fast-levenshtein "~1.0.0" 1459 | levn "~0.2.5" 1460 | prelude-ls "~1.1.1" 1461 | type-check "~0.3.1" 1462 | wordwrap "~0.0.2" 1463 | 1464 | os-browserify@~0.3.0: 1465 | version "0.3.0" 1466 | resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.3.0.tgz#854373c7f5c2315914fc9bfc6bd8238fdda1ec27" 1467 | 1468 | os-homedir@^1.0.0: 1469 | version "1.0.2" 1470 | resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" 1471 | 1472 | os-tmpdir@^1.0.1: 1473 | version "1.0.2" 1474 | resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" 1475 | 1476 | pako@~1.0.5: 1477 | version "1.0.6" 1478 | resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.6.tgz#0101211baa70c4bca4a0f63f2206e97b7dfaf258" 1479 | 1480 | parents@^1.0.0, parents@^1.0.1: 1481 | version "1.0.1" 1482 | resolved "https://registry.yarnpkg.com/parents/-/parents-1.0.1.tgz#fedd4d2bf193a77745fe71e371d73c3307d9c751" 1483 | dependencies: 1484 | path-platform "~0.11.15" 1485 | 1486 | parse-asn1@^5.0.0: 1487 | version "5.1.0" 1488 | resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.0.tgz#37c4f9b7ed3ab65c74817b5f2480937fbf97c712" 1489 | dependencies: 1490 | asn1.js "^4.0.0" 1491 | browserify-aes "^1.0.0" 1492 | create-hash "^1.1.0" 1493 | evp_bytestokey "^1.0.0" 1494 | pbkdf2 "^3.0.3" 1495 | 1496 | path-browserify@~0.0.0: 1497 | version "0.0.0" 1498 | resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" 1499 | 1500 | path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: 1501 | version "1.0.1" 1502 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 1503 | 1504 | path-parse@^1.0.5: 1505 | version "1.0.5" 1506 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" 1507 | 1508 | path-platform@~0.11.15: 1509 | version "0.11.15" 1510 | resolved "https://registry.yarnpkg.com/path-platform/-/path-platform-0.11.15.tgz#e864217f74c36850f0852b78dc7bf7d4a5721bf2" 1511 | 1512 | pbkdf2@^3.0.3: 1513 | version "3.0.14" 1514 | resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.14.tgz#a35e13c64799b06ce15320f459c230e68e73bade" 1515 | dependencies: 1516 | create-hash "^1.1.2" 1517 | create-hmac "^1.1.4" 1518 | ripemd160 "^2.0.1" 1519 | safe-buffer "^5.0.1" 1520 | sha.js "^2.4.8" 1521 | 1522 | platform@^1.3.3: 1523 | version "1.3.5" 1524 | resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" 1525 | 1526 | prelude-ls@~1.1.0, prelude-ls@~1.1.1, prelude-ls@~1.1.2: 1527 | version "1.1.2" 1528 | resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" 1529 | 1530 | private@^0.1.6, private@^0.1.7: 1531 | version "0.1.8" 1532 | resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" 1533 | 1534 | process-nextick-args@~1.0.6: 1535 | version "1.0.7" 1536 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" 1537 | 1538 | process@~0.11.0: 1539 | version "0.11.10" 1540 | resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" 1541 | 1542 | public-encrypt@^4.0.0: 1543 | version "4.0.0" 1544 | resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" 1545 | dependencies: 1546 | bn.js "^4.1.0" 1547 | browserify-rsa "^4.0.0" 1548 | create-hash "^1.1.0" 1549 | parse-asn1 "^5.0.0" 1550 | randombytes "^2.0.1" 1551 | 1552 | punycode@1.3.2: 1553 | version "1.3.2" 1554 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" 1555 | 1556 | punycode@^1.3.2: 1557 | version "1.4.1" 1558 | resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" 1559 | 1560 | querystring-es3@~0.2.0: 1561 | version "0.2.1" 1562 | resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" 1563 | 1564 | querystring@0.2.0: 1565 | version "0.2.0" 1566 | resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" 1567 | 1568 | randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5: 1569 | version "2.0.6" 1570 | resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.6.tgz#d302c522948588848a8d300c932b44c24231da80" 1571 | dependencies: 1572 | safe-buffer "^5.1.0" 1573 | 1574 | randomfill@^1.0.3: 1575 | version "1.0.3" 1576 | resolved "https://registry.yarnpkg.com/randomfill/-/randomfill-1.0.3.tgz#b96b7df587f01dd91726c418f30553b1418e3d62" 1577 | dependencies: 1578 | randombytes "^2.0.5" 1579 | safe-buffer "^5.1.0" 1580 | 1581 | read-only-stream@^2.0.0: 1582 | version "2.0.0" 1583 | resolved "https://registry.yarnpkg.com/read-only-stream/-/read-only-stream-2.0.0.tgz#2724fd6a8113d73764ac288d4386270c1dbf17f0" 1584 | dependencies: 1585 | readable-stream "^2.0.2" 1586 | 1587 | readable-stream@^2.0.2, readable-stream@^2.1.5, readable-stream@^2.2.2, readable-stream@^2.3.3: 1588 | version "2.3.3" 1589 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" 1590 | dependencies: 1591 | core-util-is "~1.0.0" 1592 | inherits "~2.0.3" 1593 | isarray "~1.0.0" 1594 | process-nextick-args "~1.0.6" 1595 | safe-buffer "~5.1.1" 1596 | string_decoder "~1.0.3" 1597 | util-deprecate "~1.0.1" 1598 | 1599 | readable-stream@~2.0.0: 1600 | version "2.0.6" 1601 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" 1602 | dependencies: 1603 | core-util-is "~1.0.0" 1604 | inherits "~2.0.1" 1605 | isarray "~1.0.0" 1606 | process-nextick-args "~1.0.6" 1607 | string_decoder "~0.10.x" 1608 | util-deprecate "~1.0.1" 1609 | 1610 | readline2@^0.1.1: 1611 | version "0.1.1" 1612 | resolved "https://registry.yarnpkg.com/readline2/-/readline2-0.1.1.tgz#99443ba6e83b830ef3051bfd7dc241a82728d568" 1613 | dependencies: 1614 | mute-stream "0.0.4" 1615 | strip-ansi "^2.0.1" 1616 | 1617 | regenerate@^1.2.1: 1618 | version "1.3.3" 1619 | resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" 1620 | 1621 | regenerator-runtime@^0.11.0: 1622 | version "0.11.1" 1623 | resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" 1624 | 1625 | regenerator-transform@^0.10.0: 1626 | version "0.10.1" 1627 | resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" 1628 | dependencies: 1629 | babel-runtime "^6.18.0" 1630 | babel-types "^6.19.0" 1631 | private "^0.1.6" 1632 | 1633 | regexpu-core@^2.0.0: 1634 | version "2.0.0" 1635 | resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" 1636 | dependencies: 1637 | regenerate "^1.2.1" 1638 | regjsgen "^0.2.0" 1639 | regjsparser "^0.1.4" 1640 | 1641 | regjsgen@^0.2.0: 1642 | version "0.2.0" 1643 | resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" 1644 | 1645 | regjsparser@^0.1.4: 1646 | version "0.1.5" 1647 | resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" 1648 | dependencies: 1649 | jsesc "~0.5.0" 1650 | 1651 | repeating@^2.0.0: 1652 | version "2.0.1" 1653 | resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" 1654 | dependencies: 1655 | is-finite "^1.0.0" 1656 | 1657 | resolve@1.1.7: 1658 | version "1.1.7" 1659 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" 1660 | 1661 | resolve@^1.1.3, resolve@^1.1.4: 1662 | version "1.5.0" 1663 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" 1664 | dependencies: 1665 | path-parse "^1.0.5" 1666 | 1667 | ripemd160@^2.0.0, ripemd160@^2.0.1: 1668 | version "2.0.1" 1669 | resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.1.tgz#0f4584295c53a3628af7e6d79aca21ce57d1c6e7" 1670 | dependencies: 1671 | hash-base "^2.0.0" 1672 | inherits "^2.0.1" 1673 | 1674 | rx@^2.4.3: 1675 | version "2.5.3" 1676 | resolved "https://registry.yarnpkg.com/rx/-/rx-2.5.3.tgz#21adc7d80f02002af50dae97fd9dbf248755f566" 1677 | 1678 | safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: 1679 | version "5.1.1" 1680 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" 1681 | 1682 | sha.js@^2.4.0, sha.js@^2.4.8, sha.js@~2.4.4: 1683 | version "2.4.10" 1684 | resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.10.tgz#b1fde5cd7d11a5626638a07c604ab909cfa31f9b" 1685 | dependencies: 1686 | inherits "^2.0.1" 1687 | safe-buffer "^5.0.1" 1688 | 1689 | shasum@^1.0.0: 1690 | version "1.0.2" 1691 | resolved "https://registry.yarnpkg.com/shasum/-/shasum-1.0.2.tgz#e7012310d8f417f4deb5712150e5678b87ae565f" 1692 | dependencies: 1693 | json-stable-stringify "~0.0.0" 1694 | sha.js "~2.4.4" 1695 | 1696 | shell-quote@^1.6.1: 1697 | version "1.6.1" 1698 | resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.6.1.tgz#f4781949cce402697127430ea3b3c5476f481767" 1699 | dependencies: 1700 | array-filter "~0.0.0" 1701 | array-map "~0.0.0" 1702 | array-reduce "~0.0.0" 1703 | jsonify "~0.0.0" 1704 | 1705 | slash@^1.0.0: 1706 | version "1.0.0" 1707 | resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" 1708 | 1709 | source-map-support@^0.4.15: 1710 | version "0.4.18" 1711 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" 1712 | dependencies: 1713 | source-map "^0.5.6" 1714 | 1715 | source-map@^0.5.6, source-map@~0.5.3: 1716 | version "0.5.7" 1717 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" 1718 | 1719 | sprintf-js@~1.0.2: 1720 | version "1.0.3" 1721 | resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" 1722 | 1723 | stream-browserify@^2.0.0: 1724 | version "2.0.1" 1725 | resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" 1726 | dependencies: 1727 | inherits "~2.0.1" 1728 | readable-stream "^2.0.2" 1729 | 1730 | stream-combiner2@^1.1.1: 1731 | version "1.1.1" 1732 | resolved "https://registry.yarnpkg.com/stream-combiner2/-/stream-combiner2-1.1.1.tgz#fb4d8a1420ea362764e21ad4780397bebcb41cbe" 1733 | dependencies: 1734 | duplexer2 "~0.1.0" 1735 | readable-stream "^2.0.2" 1736 | 1737 | stream-http@^2.0.0: 1738 | version "2.8.0" 1739 | resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.0.tgz#fd86546dac9b1c91aff8fc5d287b98fafb41bc10" 1740 | dependencies: 1741 | builtin-status-codes "^3.0.0" 1742 | inherits "^2.0.1" 1743 | readable-stream "^2.3.3" 1744 | to-arraybuffer "^1.0.0" 1745 | xtend "^4.0.0" 1746 | 1747 | stream-splicer@^2.0.0: 1748 | version "2.0.0" 1749 | resolved "https://registry.yarnpkg.com/stream-splicer/-/stream-splicer-2.0.0.tgz#1b63be438a133e4b671cc1935197600175910d83" 1750 | dependencies: 1751 | inherits "^2.0.1" 1752 | readable-stream "^2.0.2" 1753 | 1754 | string_decoder@~0.10.x: 1755 | version "0.10.31" 1756 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" 1757 | 1758 | string_decoder@~1.0.0, string_decoder@~1.0.3: 1759 | version "1.0.3" 1760 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" 1761 | dependencies: 1762 | safe-buffer "~5.1.0" 1763 | 1764 | strip-ansi@^2.0.1: 1765 | version "2.0.1" 1766 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-2.0.1.tgz#df62c1aa94ed2f114e1d0f21fd1d50482b79a60e" 1767 | dependencies: 1768 | ansi-regex "^1.0.0" 1769 | 1770 | strip-ansi@^3.0.0: 1771 | version "3.0.1" 1772 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 1773 | dependencies: 1774 | ansi-regex "^2.0.0" 1775 | 1776 | strip-json-comments@~1.0.1: 1777 | version "1.0.4" 1778 | resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" 1779 | 1780 | subarg@^1.0.0: 1781 | version "1.0.0" 1782 | resolved "https://registry.yarnpkg.com/subarg/-/subarg-1.0.0.tgz#f62cf17581e996b48fc965699f54c06ae268b8d2" 1783 | dependencies: 1784 | minimist "^1.1.0" 1785 | 1786 | supports-color@4.4.0: 1787 | version "4.4.0" 1788 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-4.4.0.tgz#883f7ddabc165142b2a61427f3352ded195d1a3e" 1789 | dependencies: 1790 | has-flag "^2.0.0" 1791 | 1792 | supports-color@^2.0.0: 1793 | version "2.0.0" 1794 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" 1795 | 1796 | syntax-error@^1.1.1: 1797 | version "1.3.0" 1798 | resolved "https://registry.yarnpkg.com/syntax-error/-/syntax-error-1.3.0.tgz#1ed9266c4d40be75dc55bf9bb1cb77062bb96ca1" 1799 | dependencies: 1800 | acorn "^4.0.3" 1801 | 1802 | text-table@~0.2.0: 1803 | version "0.2.0" 1804 | resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" 1805 | 1806 | through2@^2.0.0: 1807 | version "2.0.3" 1808 | resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" 1809 | dependencies: 1810 | readable-stream "^2.1.5" 1811 | xtend "~4.0.1" 1812 | 1813 | "through@>=2.2.7 <3", through@^2.3.6: 1814 | version "2.3.8" 1815 | resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" 1816 | 1817 | timers-browserify@^1.0.1: 1818 | version "1.4.2" 1819 | resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" 1820 | dependencies: 1821 | process "~0.11.0" 1822 | 1823 | to-arraybuffer@^1.0.0: 1824 | version "1.0.1" 1825 | resolved "https://registry.yarnpkg.com/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz#7d229b1fcc637e466ca081180836a7aabff83f43" 1826 | 1827 | to-fast-properties@^1.0.3: 1828 | version "1.0.3" 1829 | resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" 1830 | 1831 | trim-right@^1.0.1: 1832 | version "1.0.1" 1833 | resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" 1834 | 1835 | tty-browserify@~0.0.0: 1836 | version "0.0.0" 1837 | resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" 1838 | 1839 | type-check@~0.3.1: 1840 | version "0.3.2" 1841 | resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" 1842 | dependencies: 1843 | prelude-ls "~1.1.2" 1844 | 1845 | typedarray@^0.0.6, typedarray@~0.0.5: 1846 | version "0.0.6" 1847 | resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" 1848 | 1849 | umd@^3.0.0: 1850 | version "3.0.1" 1851 | resolved "https://registry.yarnpkg.com/umd/-/umd-3.0.1.tgz#8ae556e11011f63c2596708a8837259f01b3d60e" 1852 | 1853 | url@~0.11.0: 1854 | version "0.11.0" 1855 | resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" 1856 | dependencies: 1857 | punycode "1.3.2" 1858 | querystring "0.2.0" 1859 | 1860 | user-home@^1.0.0: 1861 | version "1.1.1" 1862 | resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" 1863 | 1864 | util-deprecate@~1.0.1: 1865 | version "1.0.2" 1866 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 1867 | 1868 | util@0.10.3, util@~0.10.1: 1869 | version "0.10.3" 1870 | resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" 1871 | dependencies: 1872 | inherits "2.0.1" 1873 | 1874 | vm-browserify@~0.0.1: 1875 | version "0.0.4" 1876 | resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" 1877 | dependencies: 1878 | indexof "0.0.1" 1879 | 1880 | wordwrap@~0.0.2: 1881 | version "0.0.3" 1882 | resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" 1883 | 1884 | wrappy@1: 1885 | version "1.0.2" 1886 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 1887 | 1888 | xml-escape@~1.0.0: 1889 | version "1.0.0" 1890 | resolved "https://registry.yarnpkg.com/xml-escape/-/xml-escape-1.0.0.tgz#00963d697b2adf0c185c4e04e73174ba9b288eb2" 1891 | 1892 | xtend@^4.0.0, xtend@~4.0.1: 1893 | version "4.0.1" 1894 | resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" 1895 | --------------------------------------------------------------------------------