(obj: any, shapeOf: ShapeOf<T>)
| 60 | * @param shapeOf Desired shape. |
| 61 | */ |
| 62 | export function isShapeOf<T>(obj: any, shapeOf: ShapeOf<T>): obj is T { |
| 63 | if (typeof obj === 'object' && obj) { |
| 64 | return Object.keys(shapeOf).every((key) => obj.hasOwnProperty(key)); |
| 65 | } |
| 66 | return false; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Determines if `obj` matches the shape `TI18n`. |