bpms_site/.svn/pristine/2a/2a9f28e938ed8c1a7a552df87d6d1f03835adc63.svn-base
2025-11-02 16:38:49 +03:30

20 lines
770 B
Plaintext

import { CachedRouteMatcherProvider } from "../helpers/cached-route-matcher-provider";
/**
* This will memoize the matchers when the file contents are the same.
*/ export class FileCacheRouteMatcherProvider extends CachedRouteMatcherProvider {
constructor(dir, reader){
super({
load: async ()=>reader.read(dir),
compare: (left, right)=>{
if (left.length !== right.length) return false;
// Assuming the file traversal order is deterministic...
for(let i = 0; i < left.length; i++){
if (left[i] !== right[i]) return false;
}
return true;
}
});
}
}
//# sourceMappingURL=file-cache-route-matcher-provider.js.map