Merge branch 'master' into feature/freeze
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Michel Weststrate · committed by Michel Weststrate · parents 0190958, e775cca · Browse files · 9 files·+208 added−102 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+208 added−102 removed
- tests:+58 added−26 removed
- other:+150 added−76 removed
Provenance
- Commit
f08403a- Tree
b035de0- Author
Michel Weststrate <mweststrate@gmail.com>- Committer
Michel Weststrate <mweststrate@gmail.com>- Parent 1
0190958- Parent 2
e775cca
9 files changed+208 added−102 removed
modified:__tests__/base.js+50 added-18 removed
15 unmodified lines16 17 it("should return the original without modifications when reading stuff", () => {18 const nextState = immer(baseState, s => {19 expect(s.aProp).toBe("hi")20- expect(s.anObject.nested).toEqual({ yummie: true })20+ expect(s.anObject.nested).toEqual({yummie: true})21 })22 expect(nextState).toBe(baseState)23 })24 25+ it("should not return any value: thunk", () => {26+ const warning = jest.spyOn(console, "warn")27+ immer(baseState, () => ({bad: "don't do this"}))28+ immer(baseState, () => [1, 2, 3])29+ immer(baseState, () => false)30+ immer(baseState, () => "")31+32+ expect(warning).toHaveBeenCalledTimes(4)33+ })34+35 it("should return a copy when modifying stuff", () => {36 const nextState = immer(baseState, s => {37 s.aProp = "hello world"38 })16 unmodified lines55 })56 57 it("can add props", () => {58 const nextState = immer(baseState, s => {49- s.anObject.cookie = { tasty: true }59+ s.anObject.cookie = {tasty: true}60 })61 expect(nextState).not.toBe(baseState)62 expect(nextState.anObject).not.toBe(baseState.anObject)63 expect(nextState.anObject.nested).toBe(baseState.anObject.nested)54- expect(nextState.anObject.cookie).toEqual({ tasty: true })64+ expect(nextState.anObject.cookie).toEqual({tasty: true})65 })66 67 it("can delete props", () => {68 const nextState = immer(baseState, s => {43 unmodified lines112 })113 expect(nextState).not.toBe(baseState)114 expect(nextState.anArray).not.toBe(baseState.anArray)115 106- expect(nextState.anArray).toEqual([3, "a", "b", { c: 3 }, 1])116+ expect(nextState.anArray).toEqual([3, "a", "b", {c: 3}, 1])117 })118 119 it("should support sorting arrays", () => {120 const nextState = immer(baseState, s => {2 unmodified lines123 s.anArray[3].c = 5124 })125 expect(nextState).not.toBe(baseState)126 expect(nextState.anArray).not.toBe(baseState.anArray)117- expect(nextState.anArray).toEqual([1, 2, 3, { c: 5 }])127+ expect(nextState.anArray).toEqual([1, 2, 3, {c: 5}])128 })129 130 it("should updating inside arrays", () => {131 const nextState = immer(baseState, s => {132 s.anArray[2].test = true133 })134 expect(nextState).not.toBe(baseState)135 expect(nextState.anArray).not.toBe(baseState.anArray)126- expect(nextState.anArray).toEqual([3, 2, { c: 3, test: true }, 1])136+ expect(nextState.anArray).toEqual([3, 2, {c: 3, test: true}, 1])137 })138 139 it("reusing object should work", () => {140 const nextState = immer(baseState, s => {3 unmodified lines144 })145 expect(nextState).not.toBe(baseState)146 expect(nextState.anArray).toBe(baseState.anArray)147 expect(nextState).toEqual({138- anArray: [3, 2, { c: 3 }, 1],148+ anArray: [3, 2, {c: 3}, 1],149 aProp: "hi",150 messy: {151 nested: {142- yummie: true152+ yummie: true,153 },144- coffee: false145- }154+ coffee: false,155+ },156 })157 expect(nextState.messy.nested).toBe(baseState.anObject.nested)158 })159 7 unmodified lines167 })168 expect(nextState).not.toBe(baseState)169 expect(nextState.anArray).toBe(baseState.anArray)170 expect(nextState).toEqual({161- anArray: [3, 2, { c: 3 }, 1],171+ anArray: [3, 2, {c: 3}, 1],172 aProp: "hello",173 messy: {174 nested: {165- yummie: true175+ yummie: true,176 },167- coffee: true168- }177+ coffee: true,178+ },179 })180 expect(nextState.messy.nested).toBe(baseState.anObject.nested)181 })182 5 unmodified lines188 expect(baseState.aProp).toBe("hi")189 expect(nextState.aProp).toBe(undefined)190 })191 192+ it("should revoke the proxy of the baseState after immer function is executed", () => {193+ let proxy194+ const nextState = immer(baseState, s => {195+ proxy = s196+ s.aProp = "hello"197+ })198+ expect(nextState).not.toBe(baseState)199+ expect(baseState.aProp).toBe("hi")200+ expect(nextState.aProp).toBe("hello")201+202+ expect(() => {203+ proxy.aProp = "Hallo"204+ }).toThrowError(/^Cannot perform.*on a proxy that has been revoked/)205+ expect(() => {206+ const aProp = proxy.aProp207+ }).toThrowError(/^Cannot perform.*on a proxy that has been revoked/)208+209+ expect(nextState).not.toBe(baseState)210+ expect(baseState.aProp).toBe("hi")211+ expect(nextState.aProp).toBe("hello")212+ })213+214 afterEach(() => {215 expect(baseState).toBe(origBaseState)216 expect(baseState).toEqual(createBaseState())217 })218 219 function createBaseState() {220 return {189- anArray: [3, 2, { c: 3 }, 1],221+ anArray: [3, 2, {c: 3}, 1],222 aProp: "hi",223 anObject: {224 nested: {193- yummie: true225+ yummie: true,226 },195- coffee: false196- }227+ coffee: false,228+ },229 }230 }231 })modified:__tests__/frozen.js+4 added-4 removed
12345676789101123 unmodified lines3536373839394041424344454647474849"use strict"import immer from ".."
describe("auto freeze", () => { const baseState = { object: { a: 1 }, array: [1, 2] object: {a: 1}, array: [1, 2], }
it("should freeze objects after modifications", () => { expect(Object.isFrozen(baseState.object)).toBe(false) // initially not frozen23 unmodified lines })
it("can handle already frozen trees", () => { const a = [] const b = { a: a } const b = {a: a} Object.freeze(a) Object.freeze(b) const n = immer(b, draft => { draft.c = true draft.a.push(3) debugger }) expect(n).toEqual({ c: true, a: [3] }) expect(n).toEqual({c: true, a: [3]}) })})modified:__tests__/readme.js+4 added-4 removed
4 unmodified lines5678991011121314131415161718181920212214 unmodified lines4 unmodified lines it("works", () => { const baseState = [ { todo: "Learn typescript", done: true done: true, }, { todo: "Try immer", done: false } done: false, }, ]
const nextState = immer(baseState, draft => { draft.push({ todo: "Tweet about it" }) draft.push({todo: "Tweet about it"}) draft[1].done = true })
// the new item is only added to the next state,14 unmodified linesmodified:.gitignore+1 added
55 unmodified lines56 57 # dotenv environment variables file58 .env59 60+.ideaadded:.prettierrc+19 added
1+{2+ "bracketSpacing": false,3+ "printWidth": 80,4+ "proseWrap": "never",5+ "requirePragma": false,6+ "semi": false,7+ "singleQuote": false,8+ "tabWidth": 4,9+ "trailingComma": "all",10+ "useTabs": false,11+ "overrides": [12+ {13+ "files": "*.json",14+ "options": {15+ "printWidth": 20016+ }17+ }18+ ]19+}modified:immer.js+51 added-14 removed
1 "use strict"2 // @ts-check3 4+/**5+ * @typedef {Object} RevocableProxy6+ * @property {any} proxy7+ * @property {Function} revoke8+ */9+10 const IMMER_PROXY = Symbol("immer-proxy") // TODO: create per closure, to avoid sharing proxies between multiple immer version11 12 // This property indicates that the current object is cloned for another object,13 // to make sure the proxy of a frozen object is writeable11 unmodified lines25 * @param {Function} thunk - function that receives a proxy of the base state as first argument and which can be freely modified26 * @returns {any} a new state, or the base state if nothing was modified27 */28 function immer(baseState, thunk) {23- // Maps baseState objects to proxies24- const proxies = new Map()29+ /**30+ * Maps baseState objects to revocable proxies31+ * @type {Map<Object,RevocableProxy>}32+ */33+ const revocableProxies = new Map()34 // Maps baseState objects to their copies35+36 const copies = new Map()37 38 const objectTraps = {39 get(target, prop) {10 unmodified lines50 const current = createProxy(getCurrentSource(target)[prop])51 const newValue = createProxy(value)52 if (current !== newValue) {53 const copy = getOrCreateCopy(target)44- copy[prop] = isProxy(newValue) ? newValue[IMMER_PROXY] : newValue54+ copy[prop] = isProxy(newValue)55+ ? newValue[IMMER_PROXY]56+ : newValue57 }58 return true59 },60 deleteProperty(target, property) {61 const copy = getOrCreateCopy(target)62 delete copy[property]63 return true52- }64+ },65 }66 67 // creates a copy for a base object if there ain't one68 function getOrCreateCopy(base) {20 unmodified lines89 // creates a proxy for plain objects / arrays90 function createProxy(base) {91 if (isPlainObject(base) || Array.isArray(base)) {92 if (isProxy(base)) return base // avoid double wrapping81- if (proxies.has(base)) return proxies.get(base)93+ if (revocableProxies.has(base))94+ return revocableProxies.get(base).proxy95 let proxyTarget = base96 // special case, if the base tree is frozen, we cannot modify it's proxy it in strict mode, clone first.97 if (Object.isFrozen(proxyTarget)) {85- proxyTarget = Array.isArray(proxyTarget) ? proxyTarget.slice() : { ...proxyTarget }98+ proxyTarget = Array.isArray(proxyTarget)99+ ? proxyTarget.slice()100+ : {...proxyTarget}101 Object.defineProperty(proxyTarget, CLONE_TARGET, {102 enumerable: false,103 value: base,89- configurable: true104+ configurable: true,105 })106 }107 // create the proxy93- const proxy = new Proxy(proxyTarget, objectTraps)94- proxies.set(base, proxy)95- return proxy108+ const revocableProxy = Proxy.revocable(base, objectTraps)109+ revocableProxies.set(base, revocableProxy)110+ return revocableProxy.proxy111 }112 return base113 }114 115 // checks if the given base object has modifications, either because it is modified, or116 // because one of it's children is117 function hasChanges(base) {103- const proxy = proxies.get(base)118+ const proxy = revocableProxies.get(base)119 if (!proxy) return false // nobody did read this object120 if (copies.has(base)) return true // a copy was created, so there are changes121 // look deeper122 const keys = Object.keys(base)123 for (let i = 0; i < keys.length; i++) {124 const value = base[keys[i]]110- if ((Array.isArray(value) || isPlainObject(value)) && hasChanges(value)) return true125+ if (126+ (Array.isArray(value) || isPlainObject(value)) &&127+ hasChanges(value)128+ )129+ return true130 }131 return false132 }133 26 unmodified lines160 161 // create proxy for root162 const rootClone = createProxy(baseState)163 // execute the thunk145- thunk(rootClone)164+ const maybeVoidReturn = thunk(rootClone)165+ //values either than undefined will trigger warning;166+ !Object.is(maybeVoidReturn, undefined) &&167+ console.warn(168+ `Immer callback expects no return value. However ${typeof maybeVoidReturn} was returned`,169+ )170+ // revoke all proxies171+ revoke(revocableProxies)172 // and finalize the modified proxy173 return finalize(baseState)174 }175 176+/**177+ * Revoke all the proxies stored in the revocableProxies map178+ *179+ * @param {Map<Object,RevocableProxy>} revocableProxies180+ */181+function revoke(revocableProxies) {182+ for (var revocableProxy of revocableProxies.values()) {183+ revocableProxy.revoke()184+ }185+}186+187 function isPlainObject(value) {188 if (value === null || typeof value !== "object") return false189 const proto = Object.getPrototypeOf(value)190 return proto === Object.prototype || proto === null20 unmodified lines211 autoFreeze = enableAutoFreeze212 }213 214 Object.defineProperty(exports, "__esModule", {178- value: true215+ value: true,216 })217 module.exports.default = immer218 module.exports.setAutoFreeze = setAutoFreezemodified:package.json+7 added-2 removed
3 unmodified lines4567889101112131415161710 unmodified lines28293031283233343536373839404142435 unmodified lines3 unmodified lines "description": "Create your next immutable state by mutating the current one", "main": "immer.js", "types": "./index.d.ts", "scripts": { "test": "jest" "test": "jest", "prettier": "prettier \"*/**/*.js\" --ignore-path ./.prettierignore --write && git add . && git status" }, "pre-commit": [ "prettier" ], "repository": { "type": "git", "url": "git+https://github.com/mweststrate/immer.git" },10 unmodified lines "homepage": "https://github.com/mweststrate/immer#readme", "files": [ "immer.js" ], "dependencies": {}, "devDependencies": { "@types/jest": "^22.0.0", "babel-core": "^6.26.0", "babel-jest": "^22.0.4", "babel-preset-env": "^1.6.1", "jest": "^22.0.4", "pre-commit": "^1.2.2", "prettier": "^1.9.2", "regenerator-runtime": "^0.11.1", "typescript": "^2.6.2" }, "jest": {5 unmodified linesmodified:readme.md+13 added-13 removed
1 # Immer2 3-_Your personally assistance for creating your next immutable state_3+_Your personal assistant for creating your next immutable state_4 5 ---6 7-Immer (German for: always) is a tiny package that allows you work with immutable state in a more convenient way.7+Immer (German for: always) is a tiny package that allows you to work with immutable state in a more convenient way.8 It is based on [_copy-on-write_](https://en.wikipedia.org/wiki/Copy-on-write) mechanism.9 10-The basic idea is that you will apply all your changes to a _draftState_. Which is a proxy of the _currentState_, and once all your mutations are completed, immer will produce the _nextState_ based on the mutations to the draft state. This means that you can interact with your data by simply modifying it, while keeping all the benefits of immutable data.10+The basic idea is that, you will apply all your changes to a _draftState_, which is a proxy of the _currentState_ and once all your mutations are completed, immer will produce the _nextState_ based on the mutations to the draft state. This means that you can interact with your data by simply modifying it, while keeping all the benefits of immutable data.11 12 <center>13 14 15 16-Using immer is like having a personal assistant; he takes a letter (the current state), and gives you a copy (draft) to jod changes onto. Once you are done the assistant will take your draft and produce the real immutable, final letter for you (the next state).16+Using immer is like having a personal assistant; he takes a letter (the current state), and gives you a copy (draft) to jot changes onto. Once you are done, the assistant will take your draft and produce the real immutable, final letter for you (the next state).17 </center>18 19 ## API20 20 unmodified lines41 draftState[1].done = true42 })43 ```44 45-The interesting thing about `immer` is that `baseState` will be untouched, but that `nextState` will reflect all changes made to `draftState`.45+The interesting thing about `immer` is that, the `baseState` will be untouched, but the `nextState` will reflect all changes made to `draftState`.46 47 ```javascript48 // the new item is only added to the next state,49 // base state is unmodified28 unmodified lines78 Use `setAutoFreeze(true / false)` to turn this feature on or off.79 80 ## Reducer Example81 82-A lot of words; here is a simple example of what difference that could make in practice.82+A lot of words; here is a simple example of the difference that this approach could make in practice.83 The todo reducers from the official Redux [todos-with-undo example](https://codesandbox.io/s/github/reactjs/redux/tree/master/examples/todos-with-undo)84 85-_Note, this is just a sample application of the `immer` package. Immer is design to just simply Redux reducers. It can be used in any context where you have an immutable data tree that you want to clone and modify (with structural sharing)_85+_Note, this is just a sample application of the `immer` package. Immer is not just designed to simplify Redux reducers. It can be used in any context where you have an immutable data tree that you want to clone and modify (with structural sharing)_86 87 ```javascript88 const todo = (state, action) => {89 switch (action.type) {57 unmodified lines147 }148 })149 ```150 151-Creating middleware or reducer wrapper that applies `immer` automatically is left as exercise to the reader :-).151+Creating middleware or a reducer wrapper that applies `immer` automatically is left as exercise for the reader :-).152 153 ## Limitations154 155 * This package requires Proxies, so Safari > 10, no Internet Explorer156-* Currently only tree shaped states are supported. Cycles could potentially be supported as well (PR's welcome)157-* Currently only supports plain objects and arrays. Non-plain data structures (like `Map`, `Set`) not (yet). (PR's welcome)156+* Currently, only tree shaped states are supported. Cycles could potentially be supported as well (PR's welcome)157+* Currently, only supports plain objects and arrays. Non-plain data structures (like `Map`, `Set`) not (yet). (PR's welcome)158 159 ## Pitfalls:160 161-* Make sure to modify the state you get passed in in the callback function, not the original base state that was passed as first argument to `immer`!162-* Since immer uses proxies, reading huge amounts of data from state comes with an overhead. If this ever becomes an issue (measure before optimize!), do the current state analysis before entering the `immer` block or read form the `currentState` rather than the `draftState`161+* Make sure to modify the draft state you get passed in in the callback function, not the original current state that was passed as the first argument to `immer`!162+* Since immer uses proxies, reading huge amounts of data from state comes with an overhead. If this ever becomes an issue (measure before you optimize!), do the current state analysis before entering the `immer` block or read from the `currentState` rather than the `draftState`163 164 ## Changelog165 166 ### 0.0.54 unmodified lines171 172 ### 0.0.4 (31-12-2017)173 174 * Added typescript typings [#11](https://github.com/mweststrate/immer/pull/11) by [@benbraou](https://github.com/benbraou)175-* Fixed bug when setting properties to `undefined`. Fixes [#12](https://github.com/mweststrate/immer/issues/12) through [#13](https://github.com/mweststrate/immer/pull/13) by [@benbraou](https://github.com/benbraou)175+* Fixed bug when setting properties to `undefined`. Fixes [#12](https://github.com/mweststrate/immer/issues/12) through [#13](https://github.com/mweststrate/immer/pull/13) by [@benbraou](https://github.com/benbraou)modified:yarn.lock+59 added-47 removed
391 unmodified lines392 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141"393 dependencies:394 babel-runtime "^6.22.0"395 396-babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1:396+babel-plugin-transform-es2015-block-scoping@^6.23.0:397 version "6.26.0"398 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f"399 dependencies:400 babel-runtime "^6.26.0"1 unmodified line402 babel-traverse "^6.26.0"403 babel-types "^6.26.0"404 lodash "^4.17.4"405 406-babel-plugin-transform-es2015-classes@^6.23.0, babel-plugin-transform-es2015-classes@^6.24.1:406+babel-plugin-transform-es2015-classes@^6.23.0:407 version "6.24.1"408 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"409 dependencies:410 babel-helper-define-map "^6.24.1"5 unmodified lines416 babel-template "^6.24.1"417 babel-traverse "^6.24.1"418 babel-types "^6.24.1"419 420-babel-plugin-transform-es2015-computed-properties@^6.22.0, babel-plugin-transform-es2015-computed-properties@^6.24.1:420+babel-plugin-transform-es2015-computed-properties@^6.22.0:421 version "6.24.1"422 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"423 dependencies:424 babel-runtime "^6.22.0"425 babel-template "^6.24.1"426 427-babel-plugin-transform-es2015-destructuring@^6.22.0, babel-plugin-transform-es2015-destructuring@^6.23.0:427+babel-plugin-transform-es2015-destructuring@^6.23.0:428 version "6.23.0"429 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"430 dependencies:431 babel-runtime "^6.22.0"432 433-babel-plugin-transform-es2015-duplicate-keys@^6.22.0, babel-plugin-transform-es2015-duplicate-keys@^6.24.1:433+babel-plugin-transform-es2015-duplicate-keys@^6.22.0:434 version "6.24.1"435 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"436 dependencies:437 babel-runtime "^6.22.0"438 babel-types "^6.24.1"439 440-babel-plugin-transform-es2015-for-of@^6.22.0, babel-plugin-transform-es2015-for-of@^6.23.0:440+babel-plugin-transform-es2015-for-of@^6.23.0:441 version "6.23.0"442 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"443 dependencies:444 babel-runtime "^6.22.0"445 446-babel-plugin-transform-es2015-function-name@^6.22.0, babel-plugin-transform-es2015-function-name@^6.24.1:446+babel-plugin-transform-es2015-function-name@^6.22.0:447 version "6.24.1"448 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"449 dependencies:450 babel-helper-function-name "^6.24.1"22 unmodified lines473 babel-runtime "^6.26.0"474 babel-template "^6.26.0"475 babel-types "^6.26.0"476 477-babel-plugin-transform-es2015-modules-systemjs@^6.23.0, babel-plugin-transform-es2015-modules-systemjs@^6.24.1:477+babel-plugin-transform-es2015-modules-systemjs@^6.23.0:478 version "6.24.1"479 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"480 dependencies:481 babel-helper-hoist-variables "^6.24.1"482 babel-runtime "^6.22.0"483 babel-template "^6.24.1"484 485-babel-plugin-transform-es2015-modules-umd@^6.23.0, babel-plugin-transform-es2015-modules-umd@^6.24.1:485+babel-plugin-transform-es2015-modules-umd@^6.23.0:486 version "6.24.1"487 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"488 dependencies:489 babel-plugin-transform-es2015-modules-amd "^6.24.1"490 babel-runtime "^6.22.0"491 babel-template "^6.24.1"492 493-babel-plugin-transform-es2015-object-super@^6.22.0, babel-plugin-transform-es2015-object-super@^6.24.1:493+babel-plugin-transform-es2015-object-super@^6.22.0:494 version "6.24.1"495 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"496 dependencies:497 babel-helper-replace-supers "^6.24.1"498 babel-runtime "^6.22.0"499 500-babel-plugin-transform-es2015-parameters@^6.23.0, babel-plugin-transform-es2015-parameters@^6.24.1:500+babel-plugin-transform-es2015-parameters@^6.23.0:501 version "6.24.1"502 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"503 dependencies:504 babel-helper-call-delegate "^6.24.1"2 unmodified lines507 babel-template "^6.24.1"508 babel-traverse "^6.24.1"509 babel-types "^6.24.1"510 511-babel-plugin-transform-es2015-shorthand-properties@^6.22.0, babel-plugin-transform-es2015-shorthand-properties@^6.24.1:511+babel-plugin-transform-es2015-shorthand-properties@^6.22.0:512 version "6.24.1"513 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"514 dependencies:515 babel-runtime "^6.22.0"4 unmodified lines520 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"521 dependencies:522 babel-runtime "^6.22.0"523 524-babel-plugin-transform-es2015-sticky-regex@^6.22.0, babel-plugin-transform-es2015-sticky-regex@^6.24.1:524+babel-plugin-transform-es2015-sticky-regex@^6.22.0:525 version "6.24.1"526 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"527 dependencies:528 babel-helper-regex "^6.24.1"5 unmodified lines534 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"535 dependencies:536 babel-runtime "^6.22.0"537 538-babel-plugin-transform-es2015-typeof-symbol@^6.22.0, babel-plugin-transform-es2015-typeof-symbol@^6.23.0:538+babel-plugin-transform-es2015-typeof-symbol@^6.23.0:539 version "6.23.0"540 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"541 dependencies:542 babel-runtime "^6.22.0"543 544-babel-plugin-transform-es2015-unicode-regex@^6.22.0, babel-plugin-transform-es2015-unicode-regex@^6.24.1:544+babel-plugin-transform-es2015-unicode-regex@^6.22.0:545 version "6.24.1"546 resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"547 dependencies:548 babel-helper-regex "^6.24.1"7 unmodified lines556 babel-helper-builder-binary-assignment-operator-visitor "^6.24.1"557 babel-plugin-syntax-exponentiation-operator "^6.8.0"558 babel-runtime "^6.22.0"559 560-babel-plugin-transform-regenerator@^6.22.0, babel-plugin-transform-regenerator@^6.24.1:560+babel-plugin-transform-regenerator@^6.22.0:561 version "6.26.0"562 resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"563 dependencies:564 regenerator-transform "^0.10.0"39 unmodified lines604 browserslist "^2.1.2"605 invariant "^2.2.2"606 semver "^5.3.0"607 608-babel-preset-es2015@^6.24.1:609- version "6.24.1"610- resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"611- dependencies:612- babel-plugin-check-es2015-constants "^6.22.0"613- babel-plugin-transform-es2015-arrow-functions "^6.22.0"614- babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"615- babel-plugin-transform-es2015-block-scoping "^6.24.1"616- babel-plugin-transform-es2015-classes "^6.24.1"617- babel-plugin-transform-es2015-computed-properties "^6.24.1"618- babel-plugin-transform-es2015-destructuring "^6.22.0"619- babel-plugin-transform-es2015-duplicate-keys "^6.24.1"620- babel-plugin-transform-es2015-for-of "^6.22.0"621- babel-plugin-transform-es2015-function-name "^6.24.1"622- babel-plugin-transform-es2015-literals "^6.22.0"623- babel-plugin-transform-es2015-modules-amd "^6.24.1"624- babel-plugin-transform-es2015-modules-commonjs "^6.24.1"625- babel-plugin-transform-es2015-modules-systemjs "^6.24.1"626- babel-plugin-transform-es2015-modules-umd "^6.24.1"627- babel-plugin-transform-es2015-object-super "^6.24.1"628- babel-plugin-transform-es2015-parameters "^6.24.1"629- babel-plugin-transform-es2015-shorthand-properties "^6.24.1"630- babel-plugin-transform-es2015-spread "^6.22.0"631- babel-plugin-transform-es2015-sticky-regex "^6.24.1"632- babel-plugin-transform-es2015-template-literals "^6.22.0"633- babel-plugin-transform-es2015-typeof-symbol "^6.22.0"634- babel-plugin-transform-es2015-unicode-regex "^6.24.1"635- babel-plugin-transform-regenerator "^6.24.1"636-608 babel-preset-jest@^22.0.3:609 version "22.0.3"610 resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-22.0.3.tgz#e2bb6f6b4a509d3ea0931f013db78c5a84856693"611 dependencies:228 unmodified lines840 concat-map@0.0.1:841 version "0.0.1"842 resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"843 844+concat-stream@^1.4.7:845+ version "1.6.0"846+ resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.0.tgz#0aac662fd52be78964d5532f694784e70110acf7"847+ dependencies:848+ inherits "^2.0.3"849+ readable-stream "^2.2.2"850+ typedarray "^0.0.6"851+852 console-control-strings@^1.0.0, console-control-strings@~1.1.0:853 version "1.1.0"854 resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"855 556 unmodified lines1412 dependencies:1413 once "^1.3.0"1414 wrappy "1"1415 1437-inherits@2, inherits@~2.0.0, inherits@~2.0.3:1416+inherits@2, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.3:1417 version "2.0.3"1418 resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"1419 1420 ini@~1.3.0:838 unmodified lines2259 execa "^0.7.0"2260 lcid "^1.0.0"2261 mem "^1.1.0"2262 2263+os-shim@^0.1.2:2264+ version "0.1.3"2265+ resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917"2266+2267 os-tmpdir@^1.0.0, os-tmpdir@^1.0.1:2268 version "1.0.2"2269 resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"2270 94 unmodified lines2365 pn@^1.0.0:2366 version "1.0.0"2367 resolved "https://registry.yarnpkg.com/pn/-/pn-1.0.0.tgz#1cf5a30b0d806cd18f88fc41a6b5d4ad615b3ba9"2368 2369+pre-commit@^1.2.2:2370+ version "1.2.2"2371+ resolved "https://registry.yarnpkg.com/pre-commit/-/pre-commit-1.2.2.tgz#dbcee0ee9de7235e57f79c56d7ce94641a69eec6"2372+ dependencies:2373+ cross-spawn "^5.0.1"2374+ spawn-sync "^1.0.15"2375+ which "1.2.x"2376+2377 prelude-ls@~1.1.2:2378 version "1.1.2"2379 resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"2380 2381 preserve@^0.2.0:2382 version "0.2.0"2383 resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"2384 2385+prettier@^1.9.2:2386+ version "1.9.2"2387+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.2.tgz#96bc2132f7a32338e6078aeb29727178c6335827"2388+2389 pretty-format@^22.0.3:2390 version "22.0.3"2391 resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-22.0.3.tgz#a2bfa59fc33ad24aa4429981bb52524b41ba5dd7"2392 dependencies:58 unmodified lines2451 load-json-file "^1.0.0"2452 normalize-package-data "^2.3.2"2453 path-type "^1.0.0"2454 2460-readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.4:2455+readable-stream@^2.0.1, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.2.2:2456 version "2.3.3"2457 resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"2458 dependencies:2459 core-util-is "~1.0.0"249 unmodified lines2709 source-map@^0.6.0:2710 version "0.6.1"2711 resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"2712 2713+spawn-sync@^1.0.15:2714+ version "1.0.15"2715+ resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476"2716+ dependencies:2717+ concat-stream "^1.4.7"2718+ os-shim "^0.1.2"2719+2720 spdx-correct@~1.0.0:2721 version "1.0.2"2722 resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40"2723 dependencies:189 unmodified lines2913 resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72"2914 dependencies:2915 prelude-ls "~1.1.2"2916 2917+typedarray@^0.0.6:2918+ version "0.0.6"2919+ resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"2920+2921 typescript@^2.6.2:2922 version "2.6.2"2923 resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"2924 85 unmodified lines3010 which-module@^2.0.0:3011 version "2.0.0"3012 resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"3013 3014+which@1.2.x:3015+ version "1.2.14"3016+ resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"3017+ dependencies:3018+ isexe "^2.0.0"3019+3020 which@^1.2.12, which@^1.2.9:3021 version "1.3.0"3022 resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a"3023 dependencies:86 unmodified lines