mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
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:
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user