| 1860 | |
| 1861 | // an order listing the props as they're sorted is dropped |
| 1862 | export const normalizeOrder = (inner: mutable<Structure.Inner>): void => { |
| 1863 | const required = inner.required ?? [] |
| 1864 | const optional = inner.optional ?? [] |
| 1865 | if ( |
| 1866 | inner.order?.length === required.length + optional.length && |
| 1867 | inner.order.every( |
| 1868 | (k, i) => |
| 1869 | k === |
| 1870 | (i < required.length ? required[i] : optional[i - required.length]).key |
| 1871 | ) |
| 1872 | ) |
| 1873 | delete inner.order |
| 1874 | } |
| 1875 | |
| 1876 | export const ownKeysOf = (data: object): Key[] => { |
| 1877 | const keys: Key[] = Object.keys(data) |