Revert find projects by identifier without alphanumerical characters

This commit is contained in:
manubo
2019-10-17 09:46:44 +02:00
parent f286ffceb8
commit f11c12f777

View File

@@ -25,7 +25,6 @@ export const ERROR_UNKNOWN = "unknown"
export const noop = () => null
export const asArray = input => (Array.isArray(input) ? input : [input])
export const removeNonAlphanumChars = input => String(input ?? "").replace(/[\W_]/g, "")
export const findProjectBy = prop => val => projects => {
if (!val) {
@@ -33,11 +32,7 @@ export const findProjectBy = prop => val => projects => {
}
return compose(
find(
project =>
project[prop] === val ||
removeNonAlphanumChars(project[prop]) === removeNonAlphanumChars(val),
),
find(pathEq(prop, val)),
flatMap(get("options")),
)(projects)
}