Function
combineFn_arrayAppend
(oldVal: any, newVal: any, opts: SetPathOpts)
Source from the content-addressed store, hash-verified
| 69 | }; |
| 70 | |
| 71 | function combineFn_arrayAppend(oldVal: any, newVal: any, opts: SetPathOpts): any { |
| 72 | if (oldVal == null) { |
| 73 | return [newVal]; |
| 74 | } |
| 75 | if (!isArray(oldVal) && !opts.force) { |
| 76 | throw new Error("Cannot append to non-array: " + oldVal); |
| 77 | } |
| 78 | if (!isArray(oldVal)) { |
| 79 | return [newVal]; |
| 80 | } |
| 81 | oldVal.push(newVal); |
| 82 | return oldVal; |
| 83 | } |
| 84 | |
| 85 | function checkPath(path: PathType): boolean { |
| 86 | if (!isArray(path)) { |
Callers
nothing calls this directly
Tested by
no test coverage detected