Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
feat(pkgmap): treat .package-map.json as a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Oct 26, 2018
1 parent 4df88b2 commit 66c7f2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pkgmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async function stat ({cache, hash, pkg, resolvedPath, isDir}, verify) {
if (!cache || !hash) {
throw new Error('stat() requires a fully-resolved pkgmap file address')
}
if (isDir) {
if (isDir || path.basename(resolvedPath) === '.package-map.json') {
return Object.assign(fs.lstatSync(process.tink.cache), {
mode: 16676, // read-only
size: 64
Expand Down Expand Up @@ -191,7 +191,7 @@ function statSync ({cache, hash, pkg, resolvedPath, isDir}, verify) {
if (!cache || !hash) {
throw new Error('statSync() requires a fully-resolved pkgmap file address')
}
if (isDir) {
if (isDir || path.basename(resolvedPath) === '.package-map.json') {
return Object.assign(fs.lstatSync(process.tink.cache), {
mode: 16676, // read-only
size: 64
Expand Down

0 comments on commit 66c7f2e

Please sign in to comment.