Skip to content

Commit

Permalink
refactor(fslib): change realPosition declaration to const (#4123)
Browse files Browse the repository at this point in the history
* refactor(fslib): change realPosition to const

* chore: yarn version check --interactive

* Update ZipFS.ts

Co-authored-by: Maël Nison <nison.mael@gmail.com>
  • Loading branch information
trivikr and arcanis authored Feb 21, 2022
1 parent 34585b5 commit 2ea0abe
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
36 changes: 36 additions & 0 deletions .yarn/versions/cec5e934.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
releases:
"@yarnpkg/fslib": patch

declined:
- "@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-http"
- "@yarnpkg/plugin-init"
- "@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-version"
- "@yarnpkg/plugin-workspace-tools"
- vscode-zipfs
- "@yarnpkg/builder"
- "@yarnpkg/cli"
- "@yarnpkg/core"
- "@yarnpkg/doctor"
- "@yarnpkg/json-proxy"
- "@yarnpkg/nm"
- "@yarnpkg/pnp"
- "@yarnpkg/pnpify"
- "@yarnpkg/sdks"
- "@yarnpkg/shell"
8 changes: 3 additions & 5 deletions packages/yarnpkg-fslib/sources/ZipFS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,11 +387,9 @@ export class ZipFS extends BasePortableFakeFS {
if (typeof entry === `undefined`)
throw errors.EBADF(`read`);

let realPosition;
if (position === -1 || position === null)
realPosition = entry.cursor;
else
realPosition = position;
const realPosition = position === -1 || position === null
? entry.cursor
: position;

const source = this.readFileSync(entry.p);
source.copy(buffer, offset, realPosition, realPosition + length);
Expand Down

0 comments on commit 2ea0abe

Please sign in to comment.