( data: TransformData, matchedKeys: string[], keySelector: KeyRule, args: string | string[] | undefined, isHeader: boolean )
| 374 | } |
| 375 | |
| 376 | function opAppend( |
| 377 | data: TransformData, |
| 378 | matchedKeys: string[], |
| 379 | keySelector: KeyRule, |
| 380 | args: string | string[] | undefined, |
| 381 | isHeader: boolean |
| 382 | ) { |
| 383 | if (isEmptyArgs(args)) { |
| 384 | return; |
| 385 | } |
| 386 | const toAppend = typeof args === 'string' ? [args] : (args ?? []); |
| 387 | |
| 388 | for (const key of matchedKeys) { |
| 389 | const next = [...toValueList(data[key], isHeader), ...toAppend]; |
| 390 | setTransformValue(data, key, fromValueList(next)); |
| 391 | } |
| 392 | |
| 393 | // create new key if nothing matched as key selector is a simple string |
| 394 | if (matchedKeys.length === 0 && typeof keySelector === 'string') { |
| 395 | setTransformValue(data, keySelector, fromValueList(toAppend)); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | function opDelete( |
| 400 | data: TransformData, |
no test coverage detected