fix(napi): set lossless parameter in napi_get_value_bigint_{int64,uint64}, and trim leading zeroes in napi_create_bigint_words (#15804)

This commit is contained in:
190n
2024-12-17 17:38:12 -08:00
committed by GitHub
parent 430c1dd583
commit 59e06b0df5
9 changed files with 1297 additions and 42 deletions

View File

@@ -22,20 +22,25 @@ describe("package.json dependencies must be exact versions", async () => {
optionalDependencies = {},
} = await Bun.file(join(dir, "./package.json")).json();
// Hyphen is necessary to accept prerelease versions like "1.1.3-alpha.7"
// This regex still forbids semver ranges like "1.0.0 - 1.2.0", as those must have spaces
// around the hyphen.
const okRegex = /^([a-zA-Z0-9\.\-])+$/;
for (const [name, dep] of Object.entries(dependencies)) {
expect(dep).toMatch(/^([a-zA-Z0-9\.])+$/);
expect(dep, `dependency ${name} specifies non-exact version "${dep}"`).toMatch(okRegex);
}
for (const [name, dep] of Object.entries(devDependencies)) {
expect(dep).toMatch(/^([a-zA-Z0-9\.])+$/);
expect(dep, `dev dependency ${name} specifies non-exact version "${dep}"`).toMatch(okRegex);
}
for (const [name, dep] of Object.entries(peerDependencies)) {
expect(dep).toMatch(/^([a-zA-Z0-9\.])+$/);
expect(dep, `peer dependency ${name} specifies non-exact version "${dep}"`).toMatch(okRegex);
}
for (const [name, dep] of Object.entries(optionalDependencies)) {
expect(dep).toMatch(/^([a-zA-Z0-9\.])+$/);
expect(dep, `optional dependency ${name} specifies non-exact version "${dep}"`).toMatch(okRegex);
}
});
}