(props: any)
| 1103 | * or `null` if all keys are affected. |
| 1104 | */ |
| 1105 | export function createUpdate(props: any) { |
| 1106 | const { to, from } = (props = inferTo(props)) |
| 1107 | |
| 1108 | // Collect the keys affected by this update. |
| 1109 | const keys = new Set<string>() |
| 1110 | |
| 1111 | if (is.obj(to)) findDefined(to, keys) |
| 1112 | if (is.obj(from)) findDefined(from, keys) |
| 1113 | |
| 1114 | // The "keys" prop helps in applying updates to affected keys only. |
| 1115 | props.keys = keys.size ? Array.from(keys) : null |
| 1116 | |
| 1117 | return props |
| 1118 | } |
| 1119 | |
| 1120 | /** |
| 1121 | * A modified version of `createUpdate` meant for declarative APIs. |
no test coverage detected
searching dependent graphs…