Conversation
… fixRWC # Conflicts: # src/harness/harness.ts
|
I did a quick search but couldn't find the answer so don't mind my intrusion / potentially dumb question, but what is |
|
@basarat it stands for Real World Code. We have a mix of internal/external codebases that we use to take benchmarks and find potential breaks. |
| export function isDefaultLibraryFile(filePath: string): boolean { | ||
| // We need to make sure that the filePath is prefix with "lib." not just containing "lib." and end with ".d.ts" | ||
| const fileName = Path.getFileName(filePath); | ||
| return fileName.indexOf("lib.") === 0 && !!fileName.match(/\.d\.ts/); |
There was a problem hiding this comment.
/^lib(\..+)*\.d\.ts$/
- Must start with
lib - Optionally has some number of non-empty pieces that start with a period.
- Ends in
.d.ts
There was a problem hiding this comment.
You might choose not to do that, but as a heads up, you're not properly testing that .d.ts occurs last. That's what the $ I wrote in my regex is for.
There was a problem hiding this comment.
+1 why not just add a ^ and $ to the existing regex? Is it broken for other reasons?
There was a problem hiding this comment.
we already have endsWith in program it can be moved to utilities and reused here
No description provided.