Function
findExtraneousKeys
(file: string[], schema: string[], path: string)
Source from the content-addressed store, hash-verified
| 63 | * @param {String} path string path to file |
| 64 | */ |
| 65 | const findExtraneousKeys = (file: string[], schema: string[], path: string) => { |
| 66 | const extraKeys = []; |
| 67 | for (const key of file) { |
| 68 | if (!schema.includes(key)) { |
| 69 | extraKeys.push(key); |
| 70 | } |
| 71 | } |
| 72 | if (extraKeys.length) { |
| 73 | console.warn( |
| 74 | `${path} has these keys that are not in the schema: ${extraKeys.join( |
| 75 | ', ' |
| 76 | )}` |
| 77 | ); |
| 78 | } |
| 79 | }; |
| 80 | |
| 81 | /** |
| 82 | * Validates that all values in the object are non-empty. Includes |
Tested by
no test coverage detected