improve types
This commit is contained in:
parent
8139aeb073
commit
51f0f5718a
15 changed files with 196 additions and 186 deletions
|
@ -21,7 +21,7 @@ export interface IDiff {
|
|||
at?: number;
|
||||
}
|
||||
|
||||
function firstDiff(a: string, b: string) {
|
||||
function firstDiff(a: string, b: string): number {
|
||||
const compareLen = Math.min(a.length, b.length);
|
||||
for (let i = 0; i < compareLen; ++i) {
|
||||
if (a[i] !== b[i]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue