Revert find projects by identifier without alphanumerical characters
This commit is contained in:
@@ -25,7 +25,6 @@ export const ERROR_UNKNOWN = "unknown"
|
|||||||
|
|
||||||
export const noop = () => null
|
export const noop = () => null
|
||||||
export const asArray = input => (Array.isArray(input) ? input : [input])
|
export const asArray = input => (Array.isArray(input) ? input : [input])
|
||||||
export const removeNonAlphanumChars = input => String(input ?? "").replace(/[\W_]/g, "")
|
|
||||||
|
|
||||||
export const findProjectBy = prop => val => projects => {
|
export const findProjectBy = prop => val => projects => {
|
||||||
if (!val) {
|
if (!val) {
|
||||||
@@ -33,11 +32,7 @@ export const findProjectBy = prop => val => projects => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return compose(
|
return compose(
|
||||||
find(
|
find(pathEq(prop, val)),
|
||||||
project =>
|
|
||||||
project[prop] === val ||
|
|
||||||
removeNonAlphanumChars(project[prop]) === removeNonAlphanumChars(val),
|
|
||||||
),
|
|
||||||
flatMap(get("options")),
|
flatMap(get("options")),
|
||||||
)(projects)
|
)(projects)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user