File tree Expand file tree Collapse file tree 4 files changed +51
-41
lines changed
Expand file tree Collapse file tree 4 files changed +51
-41
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "semi": false,
3+ "trailingComma": "all"
4+ }
Original file line number Diff line number Diff line change 3636 "transform" : {
3737 ".(ts|tsx)" : " ts-jest"
3838 },
39- "testRegex" :
40- " /(src|integration-tests|property-based-tests)/.+\\ .test\\ .ts$" ,
41- "moduleFileExtensions" : [" ts" , " tsx" , " js" ]
39+ "testRegex" : " /(src|integration-tests|property-based-tests)/.+\\ .test\\ .ts$" ,
40+ "moduleFileExtensions" : [
41+ " ts" ,
42+ " tsx" ,
43+ " js"
44+ ]
4245 },
4346 "devDependencies" : {
4447 "@types/app-root-path" : " ^1.2.4" ,
5356 "jest" : " ^23.6.0" ,
5457 "lint-staged" : " ^3.4.1" ,
5558 "np" : " ^2.15.0" ,
56- "prettier" : " ^1.11.1 " ,
59+ "prettier" : " ^1.15.3 " ,
5760 "randomstring" : " ^1.1.5" ,
5861 "ts-jest" : " ^23.10.5" ,
5962 "ts-node" : " ^7.0.1" ,
Original file line number Diff line number Diff line change @@ -44,39 +44,41 @@ function reverseHunks(hunks: PatchHunk[]): PatchHunk[] {
4444
4545export const reversePatch = ( patch : ParsedPatchFile ) : ParsedPatchFile => {
4646 return patch
47- . map ( ( part : PatchFilePart ) : PatchFilePart => {
48- switch ( part . type ) {
49- case "file creation" :
50- return {
51- type : "file deletion" ,
52- path : part . path ,
53- lines : part . lines ,
54- mode : part . mode ,
55- noNewlineAtEndOfFile : part . noNewlineAtEndOfFile ,
56- }
57- case "file deletion" :
58- return {
59- type : "file creation" ,
60- path : part . path ,
61- lines : part . lines ,
62- mode : part . mode ,
63- noNewlineAtEndOfFile : part . noNewlineAtEndOfFile ,
64- }
65- case "rename" :
66- return {
67- type : "rename" ,
68- fromPath : part . toPath ,
69- toPath : part . fromPath ,
70- }
71- case "patch" :
72- return {
73- type : "patch" ,
74- path : part . path ,
75- parts : reverseHunks ( part . parts ) ,
76- }
77- default :
78- throw new Error ( )
79- }
80- } )
47+ . map (
48+ ( part : PatchFilePart ) : PatchFilePart => {
49+ switch ( part . type ) {
50+ case "file creation" :
51+ return {
52+ type : "file deletion" ,
53+ path : part . path ,
54+ lines : part . lines ,
55+ mode : part . mode ,
56+ noNewlineAtEndOfFile : part . noNewlineAtEndOfFile ,
57+ }
58+ case "file deletion" :
59+ return {
60+ type : "file creation" ,
61+ path : part . path ,
62+ lines : part . lines ,
63+ mode : part . mode ,
64+ noNewlineAtEndOfFile : part . noNewlineAtEndOfFile ,
65+ }
66+ case "rename" :
67+ return {
68+ type : "rename" ,
69+ fromPath : part . toPath ,
70+ toPath : part . fromPath ,
71+ }
72+ case "patch" :
73+ return {
74+ type : "patch" ,
75+ path : part . path ,
76+ parts : reverseHunks ( part . parts ) ,
77+ }
78+ default :
79+ throw new Error ( )
80+ }
81+ } ,
82+ )
8183 . reverse ( )
8284}
Original file line number Diff line number Diff line change @@ -3416,9 +3416,10 @@ preserve@^0.2.0:
34163416 version "0.2.0"
34173417 resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
34183418
3419- prettier@^1.11.1 :
3420- version "1.11.1"
3421- resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75"
3419+ prettier@^1.15.3 :
3420+ version "1.15.3"
3421+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.15.3.tgz#1feaac5bdd181237b54dbe65d874e02a1472786a"
3422+ integrity sha512-gAU9AGAPMaKb3NNSUUuhhFAS7SCO4ALTN4nRIn6PJ075Qd28Yn2Ig2ahEJWdJwJmlEBTUfC7mMUSFy8MwsOCfg==
34223423
34233424pretty-format@^23.6.0 :
34243425 version "23.6.0"
You can’t perform that action at this time.
0 commit comments