Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
E.chain(value => {
switch (spec.style) {
case HttpParamStyles.DeepObject:
return E.right(serializeWithDeepObjectStyle(spec.name, value));
case HttpParamStyles.PipeDelimited:
return pipe(
value,
E.fromPredicate(
Array.isArray,
() => new Error('Pipe delimited style is only applicable to array parameter')
),
E.map(v => serializeWithPipeDelimitedStyle(spec.name, v, spec.explode))
);
case HttpParamStyles.SpaceDelimited:
return pipe(
value,
E.fromPredicate(
Array.isArray,