Skip to main content
Code Review

Return to Question

edited tags
Link
Commonmark migration
Source Link

###Solution 1

Solution 1

###Solution 2

Solution 2

###Solution 3

Solution 3

###Solution 1

###Solution 2

###Solution 3

Solution 1

Solution 2

Solution 3

Tweeted twitter.com/StackCodeReview/status/1172797257864945664
deleted 44 characters in body
Source Link
NCM
  • 181
  • 3
function resolveGitConflict(lines, mode) {
 return lines.reduce((p, c) => {
 let last = p[p.length-1]
 if(typeof last === 'object' ) {
 if(c === '>>>>>>>') last = [].concat(last[mode[0]] || [], last[mode[1]] || [])
 else if(c === '=======') last.t = [] 
 else last[last.t ? 't' : 'm'].push(c)
 return p.slice(0, -1).concat(last)
 } else if(c === '<<<<<<<') c = {m: []} 
 return p.concat(c)
 }, [])
}
function resolveGitConflict(lines, mode) {
 return lines.reduce((p, c) => {
 let last = p[p.length-1]
 if(typeof last === 'object' ) {
 if(c === '>>>>>>>') last = [].concat(last[mode[0]] || [], last[mode[1]] || [])
 else if(c === '=======') last.t = [] 
 else last[last.t ? 't' : 'm'].push(c)
 return p.slice(0, -1).concat(last)
 } else if(c === '<<<<<<<') c = {m: []} 
 return p.concat(c)
 }, [])
}
function resolveGitConflict(lines, mode) {
 return lines.reduce((p, c) => {
 let last = p[p.length-1]
 if(typeof last === 'object' ) {
 if(c === '>>>>>>>') last = [].concat(last[mode[0]] || [], last[mode[1]] || [])
 else if(c === '=======') last.t = [] 
 else last[last.t ? 't' : 'm'].push(c)
 return p.slice(0, -1).concat(last)
 } else if(c === '<<<<<<<') c = {m: []} 
 return p.concat(c)
 }, [])
}
Loading
deleted 2 characters in body
Source Link
NCM
  • 181
  • 3
Loading
Loading
edited title; body formatting; edited tags;
Source Link
Ben A
  • 10.8k
  • 5
  • 37
  • 102
Loading
added 49 characters in body
Source Link
NCM
  • 181
  • 3
Loading
Source Link
NCM
  • 181
  • 3
Loading
lang-js

AltStyle によって変換されたページ (->オリジナル) /