( a: string, b: string, threshold: number, )
| 243 | } |
| 244 | |
| 245 | function stringsWithinLevDistThreshold( |
| 246 | a: string, |
| 247 | b: string, |
| 248 | threshold: number, |
| 249 | ) { |
| 250 | const dist = distance(a, b); |
| 251 | return dist / Math.min(a.length, b.length) <= threshold; |
| 252 | } |
| 253 | |
| 254 | function programNodeIsSimilar( |
| 255 | programNode: Parser.SyntaxNode, |