Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions .yarn/versions/78344001.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
releases:
"@yarnpkg/fslib": patch

declined:
- "@yarnpkg/plugin-catalog"
- "@yarnpkg/plugin-compat"
- "@yarnpkg/plugin-constraints"
- "@yarnpkg/plugin-dlx"
- "@yarnpkg/plugin-essentials"
- "@yarnpkg/plugin-exec"
- "@yarnpkg/plugin-file"
- "@yarnpkg/plugin-git"
- "@yarnpkg/plugin-github"
- "@yarnpkg/plugin-init"
- "@yarnpkg/plugin-jsr"
- "@yarnpkg/plugin-link"
- "@yarnpkg/plugin-nm"
- "@yarnpkg/plugin-npm"
- "@yarnpkg/plugin-npm-cli"
- "@yarnpkg/plugin-pack"
- "@yarnpkg/plugin-patch"
- "@yarnpkg/plugin-pnp"
- "@yarnpkg/plugin-pnpm"
- "@yarnpkg/plugin-stage"
- "@yarnpkg/plugin-typescript"
- "@yarnpkg/plugin-version"
- "@yarnpkg/plugin-workspace-tools"
- vscode-zipfs
- "@yarnpkg/builder"
- "@yarnpkg/cli"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/libzip"
- "@yarnpkg/nm"
- "@yarnpkg/pnp"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
- "@yarnpkg/shell"
10 changes: 5 additions & 5 deletions packages/yarnpkg-fslib/sources/statUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,18 @@ export function convertToBigIntStats(stats: Stats): BigIntStats {
const element = stats[key as keyof typeof stats];
if (typeof element === `number`) {
// @ts-expect-error Typescript isn't able to tell this is valid
bigintStats[key as keyof typeof bigintStats] = BigInt(element);
bigintStats[key as keyof typeof bigintStats] = BigInt(Math.floor(element));
} else if (nodeUtils.types.isDate(element)) {
// @ts-expect-error Typescript isn't able to tell this is valid
bigintStats[key as keyof typeof bigintStats] = new Date(element);
}
}
}

bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6);
bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6);
bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6);
bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6);
bigintStats.atimeNs = bigintStats.atimeMs * BigInt(1e6) + BigInt(Math.floor((stats.atimeMs % 1) * 1e3)) * BigInt(1e3);
bigintStats.mtimeNs = bigintStats.mtimeMs * BigInt(1e6) + BigInt(Math.floor((stats.mtimeMs % 1) * 1e3)) * BigInt(1e3);
bigintStats.ctimeNs = bigintStats.ctimeMs * BigInt(1e6) + BigInt(Math.floor((stats.ctimeMs % 1) * 1e3)) * BigInt(1e3);
bigintStats.birthtimeNs = bigintStats.birthtimeMs * BigInt(1e6) + BigInt(Math.floor((stats.birthtimeMs % 1) * 1e3)) * BigInt(1e3);

return bigintStats as unknown as BigIntStats;
}
Expand Down
Binary file not shown.
14 changes: 14 additions & 0 deletions packages/yarnpkg-libzip/tests/ZipOpenFS.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ export const ZIP_DIR4 = ppath.join(
npath.toPortablePath(__dirname),
`fixtures/symlink.zip` as Filename,
);
export const ZIP_DIR5 = ppath.join(
npath.toPortablePath(__dirname),
`fixtures/implicit-folders.zip` as Filename,
);

export const ZIP_FILE1 = ppath.join(ZIP_DIR1, `foo.txt`);
export const ZIP_FILE2 = ppath.join(ZIP_DIR2, `foo.txt`);
export const ZIP_FILE3 = ppath.join(ZIP_DIR3, `foo.txt`);
export const ZIP_FILE4 = ppath.join(ZIP_DIR4, `foo.txt`);
export const ZIP_FILE5 = ppath.join(ZIP_DIR5, `foo.txt`);

afterEach(() => {
jest.useRealTimers();
Expand Down Expand Up @@ -86,6 +91,15 @@ describe(`ZipOpenFS`, () => {
fs.discardAndClose();
});

it(`can read stats from a zip file with implicit folders`, () => {
const fs = new ZipOpenFS();

expect(fs.statSync(ppath.join(ZIP_DIR5, `node_modules`)).isDirectory()).toBe(true);
expect(fs.statSync(ppath.join(ZIP_DIR5, `node_modules`), {bigint: true}).isDirectory()).toBe(true);

fs.discardAndClose();
});

it(`can read from a zip file that's a symlink`, () => {
const fs = new ZipOpenFS();

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/yarnpkg-pnp/sources/hook.js

Large diffs are not rendered by default.