Conversation
|
CC @isaacs |
src/primordials.ts
Outdated
| @@ -0,0 +1,4 @@ | |||
| export const primordials: any = // TODO export as typeof import('node-primordials'), types are wrong | |||
| // @ts-expect-error | |||
| typeof primordials !== 'undefined' ? primordials /* c8 ignore next */ : | |||
There was a problem hiding this comment.
I don't think c8 ignore next is a thing, is that new? I thought it only supported /* c8 ignore start */ and /* c8 ignore stop */
There was a problem hiding this comment.
it is. you can also specify the amount of lines. https://github.com/bcoe/c8/blob/main/README.md#ignoring-uncovered-lines-functions-and-blocks
There was a problem hiding this comment.
Oh, that's somewhat new-ish, I think. (Like, added in the last 5 years or so probably lol.) Nice!
|
Test failures are spurious, should be fixed by rebasing onto main to update tap. |
184993c to
aba228e
Compare
|
@isaacs PTAL |
| '$', | ||
| '\\', | ||
| '!', | ||
| ]) |
There was a problem hiding this comment.
Does SafeSet only take arrays, not arbitrary iterables?
There was a problem hiding this comment.
see the implementation here https://github.com/isaacs/node-primordials/pull/9/files# I guess it would work with any iterable, but didn't try
|
Looks mostly fine. I'd like to get the PRs on node-primordials landed before landing this, so that it can be a simple dep update. Then the real question will be what the perf impact is, if any. If it's awful, we'll have to figure out some way to either mitigate it, or have the primordials version live side by side somehow with the normal code. |
|
ping @isaacs can you take a look? |
|
@isaacs as we discussed - I'v ran benchmarks on the glob repo: isaacs/node-glob@main...MoLow:node-glob:primordials |
|
how is it going? |
this is just a POC to start the process of node exposing
fs.glob.if this PR will land, I will complete the process on all the rest of the code.
also, it seems like
node-primordialsneeds some type fixes / additionsdepends on isaacs/node-primordials#8 and isaacs/node-primordials#9