2020-09-08 16:53:51 +00:00
|
|
|
import { helper as buildHelper } from '@ember/component/helper';
|
|
|
|
|
2020-09-15 18:11:24 +00:00
|
|
|
export function isWildcardString(string) {
|
2020-09-08 16:53:51 +00:00
|
|
|
if (!string) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
// string is actually an object which is what comes in in the searchSelect component
|
|
|
|
if (typeof string === 'object') {
|
2020-09-08 20:24:27 +00:00
|
|
|
// if the dropdown is used the object is a class which cannot be converted into a string
|
|
|
|
if (Object.prototype.hasOwnProperty.call(string, 'store')) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
string = Object.values(string).toString();
|
2020-09-08 16:53:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return string.includes('*');
|
|
|
|
}
|
|
|
|
|
|
|
|
export default buildHelper(isWildcardString);
|