Closed zephinzer closed 3 years ago
Referencing: https://github.com/GovTechSG/mcf-boilerplate-js/blob/100ab62f7d68191e74c8c4164a9f8188e42ea275/packages/constants/src/mcf.ts#L676
Could we use the native .reduce() over the lodash flow(...)? I imagine it would be like:
.reduce()
lodash
flow(...)
return [ removeWordsInBracket, removeStopWords, removePunctuations, removeExcessWhitespaces, joinWords, removeRepeatedHyphens, encodeURIComponent, ].reduce((currentState, currentItem) => currentItem(currentState), currentStr)
Arguably less readable but this together with #66 removes the need for a 14MB lodash dependency.
Going to close this issue since there's no lodash dependencies
Referencing: https://github.com/GovTechSG/mcf-boilerplate-js/blob/100ab62f7d68191e74c8c4164a9f8188e42ea275/packages/constants/src/mcf.ts#L676
Could we use the native
.reduce()
over thelodash
flow(...)
? I imagine it would be like:Arguably less readable but this together with #66 removes the need for a 14MB
lodash
dependency.