Files
react-native-svg/src/lib/util.ts
Wojciech Lewicki 416ccc8a86 fix: bump packages, eslint, tsconfig, prettier and resolve all conflicts (#2114)
PR bumping packages, eslint, tsconfig, prettier and resolving all conflicts connected to it.
2023-08-07 17:44:58 +02:00

15 lines
399 B
TypeScript

export function pickNotNil(object: { [prop: string]: unknown }) {
const result: { [prop: string]: unknown } = {};
for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) {
const value = object[key];
if (value !== undefined && value !== null) {
result[key] = value;
}
}
}
return result;
}
export const idPattern = /#([^)]+)\)?$/;