deno
deno copied to clipboard
`fs.statSync` return value is not instance of `fs.Stats`
trafficstars
Reproduction from Next.js on Windows:
import etag from "npm:etag";
import {statSync, Stats} from "node:fs";
const stat = statSync("README.md");
etag(stat);
error: Uncaught (in promise) TypeError: argument entity must be string, Buffer, or fs.Stats
at etag (file:///Users/divy/Library/Caches/deno/npm/registry.npmjs.org/etag/1.8.1/index.js:83:11)
at file:///Users/divy/gh/deno/etag.mjs:5:1
Simpler reproduction:
import {statSync, Stats} from "node:fs";
const stat = statSync("README.md");
console.log(stat instanceof Stats); // false