mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 09:27:20 +00:00
22 lines
464 B
JavaScript
22 lines
464 B
JavaScript
// eslint-disable-next-line eqeqeq
|
|
export const notNil = a => a != null;
|
|
|
|
export function pick(object, props) {
|
|
const result = {};
|
|
for (let prop of props) {
|
|
result[prop] = object[prop];
|
|
}
|
|
return result;
|
|
}
|
|
|
|
export function pickBy(object, pred) {
|
|
const result = {};
|
|
for (let prop of Object.keys(object)) {
|
|
const val = object[prop];
|
|
if (pred(val)) {
|
|
result[prop] = val;
|
|
}
|
|
}
|
|
return result;
|
|
}
|