Skip to content
Myr

lint: coalesce duplicate switch statements

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

closes #4587

authored by Abderrahmenla · committed by Douglas Christopher Wilson · parent 2402126 · Browse files · 1 file+2 added−6 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+2 added−6 removed

  • other:+2 added−6 removed

1 file+2 added−6 removed

modified:lib/utils.js+2 added-6 removed
155 unmodified lines
156 }157158 switch (val) {159 case true:160 case 'weak':161 fn = exports.wetag;162 break;163 case false:164 break;165 case 'strong':166 fn = exports.etag;167 break;167 case 'weak':168 fn = exports.wetag;169 break;168 default:169 throw new TypeError('unknown value for etag function: ' + val);170 }171
16 unmodified lines
188 }189190 switch (val) {191 case true:192 case 'simple':193 fn = querystring.parse;194 break;195 case false:196 fn = newObject;197 break;198 case 'extended':199 fn = parseExtendedQueryString;200 break;202 case 'simple':203 fn = querystring.parse;204 break;201 default:202 throw new TypeError('unknown value for query parser function: ' + val);203 }204
98 unmodified lines