@actinc/dls
Version:
Design Language System (DLS) for ACT & Encoura front-end projects.
23 lines • 763 B
JavaScript
/**
* Copyright (c) ACT, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import get from 'lodash/get';
import toString from 'lodash/toString';
export function search(docs, properties, value) {
return docs.filter(function (doc) {
return properties.some(function (property) {
var currentValue = get(doc, property);
if (doc !== null && currentValue !== null) {
return toString(currentValue)
.toLowerCase()
.includes(value.trim().toLowerCase());
}
return false;
});
});
}
export default search;
//# sourceMappingURL=index.js.map