Skip to content
Myr

chore: run prettier on __tests__/flow/flow.js.flow

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by aleclarson · committed by Alec Larson · parent b788457 · Browse files · 1 file+28 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+28 added−13 removed

  • tests:+28 added−13 removed

1 file+28 added−13 removed

modified:__tests__/flow/flow.js.flow+28 added-13 removed
1// @flow2import produce, {setAutoFreeze, setUseProxies, produce as produce2, applyPatches, Patch, original} from "../../src/index"2import produce, {3 setAutoFreeze,4 setUseProxies,5 produce as produce2,6 applyPatches,7 Patch,8 original9} from "../../src/index.js"1011setAutoFreeze(true)12setUseProxies(true)13
12 unmodified lines
26})2728console.log(result2.x)2930const f = produce(23const f = produce((draft): {x: number} => {24 return {x: 4}25})31 (draft): {x: number} => {32 return {x: 4}33 }34)35f({x: 3})3637const f2 = produce((draft): void => {})38f2({x: 3})
34 unmodified lines
73}7475{76 // curried f & no initial arg77 const f2 = produce(68 const f2 = produce((state: {x: number}, increment: number): void => {69 state.x += increment70 })78 (state: {x: number}, increment: number): void => {79 state.x += increment80 }81 )8283 f2({x: 5}, 3)8485 // $ExpectError
13 unmodified lines
99}100101{102 let p: Patch[] = []103 produce(104 {},105 d => {},92 produce({ }, d=> {}, (patches, inverse) => {93 p = patches94 })106 (patches, inverse) => {107 p = patches108 }109 )110 applyPatches({}, p)111}112113{
8 unmodified lines
122}123124{125 produce([1], draftState => {111 const a = original(draftState);126 const a = original(draftState)127 if (a) {113 const b: number = a[0];128 const b: number = a[0]129 // $ExpectError115 const c: string = a[0];130 const c: string = a[0]131 }132 })133}