"use strict";
///<reference path="../lib.deno.d.ts" />
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.stat = exports.denoifyFileInfo = void 0;
const promises_1 = require("fs/promises");
const errorMap_js_1 = __importDefault(require("../../internal/errorMap.js"));
function denoifyFileInfo(s) {
    return {
        atime: s.atime,
        birthtime: s.birthtime,
        blksize: s.blksize,
        blocks: s.blocks,
        dev: s.dev,
        gid: s.gid,
        ino: s.ino,
        isDirectory: s.isDirectory(),
        isFile: s.isFile(),
        isSymlink: s.isSymbolicLink(),
        mode: s.mode,
        mtime: s.mtime,
        nlink: s.nlink,
        rdev: s.rdev,
        size: s.size,
        uid: s.uid,
    };
}
exports.denoifyFileInfo = denoifyFileInfo;
const stat = async (path) => {
    try {
        return denoifyFileInfo(await (0, promises_1.stat)(path));
    }
    catch (e) {
        throw (0, errorMap_js_1.default)(e);
    }
};
exports.stat = stat;
