(
oldStr: InputValueT,
newStr: InputValueT,
// Type below is not accurate/complete - see above for full possibilities - but it compiles
options: DiffCallbackNonabortable<ValueT> | AllDiffOptions & Partial<CallbackOptionNonabortable<ValueT>> = {}
)
| 52 | options?: AllDiffOptions |
| 53 | ): ChangeObject<ValueT>[] |
| 54 | diff( |
| 55 | oldStr: InputValueT, |
| 56 | newStr: InputValueT, |
| 57 | // Type below is not accurate/complete - see above for full possibilities - but it compiles |
| 58 | options: DiffCallbackNonabortable<ValueT> | AllDiffOptions & Partial<CallbackOptionNonabortable<ValueT>> = {} |
| 59 | ): ChangeObject<ValueT>[] | undefined { |
| 60 | let callback: DiffCallbackAbortable<ValueT> | DiffCallbackNonabortable<ValueT> | undefined; |
| 61 | if (typeof options === 'function') { |
| 62 | callback = options; |
| 63 | options = {}; |
| 64 | } else if ('callback' in options) { |
| 65 | callback = options.callback; |
| 66 | } |
| 67 | // Allow subclasses to massage the input prior to running |
| 68 | const oldString = this.castInput(oldStr, options); |
| 69 | const newString = this.castInput(newStr, options); |
| 70 | |
| 71 | const oldTokens = this.removeEmpty(this.tokenize(oldString, options)); |
| 72 | const newTokens = this.removeEmpty(this.tokenize(newString, options)); |
| 73 | |
| 74 | return this.diffWithOptionsObj(oldTokens, newTokens, options, callback); |
| 75 | } |
| 76 | |
| 77 | private diffWithOptionsObj( |
| 78 | oldTokens: TokenT[], |
no test coverage detected