Validate TypeScript code for refactoring

Is there a better way of writing this?

const result = A.isNonEmptyArray(pairs.list) ? Option.some(pairs.list) : Option.none()
Was this page helpful?