UNPKG

inference-server

Version:

Libraries and server to build AI applications. Adapters to various native bindings allowing local inference. Integrate it with your application, or use as a microservice.

12 lines (8 loc) 302 B
export function getLargestCommonPrefix(str1: string, str2: string): string { const minLength = Math.min(str1.length, str2.length); let prefixLength = 0; while (prefixLength < minLength && str1[prefixLength] === str2[prefixLength]) { prefixLength++; } return str1.slice(0, prefixLength); }