aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@nodelib/fs.stat/out/index.js
blob: 26c5ba8df3b5706278c83cfb0da1a4d72f52f716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const optionsManager = require("./managers/options");
const statProvider = require("./providers/stat");
/**
 * Asynchronous API.
 */
function stat(path, opts) {
    return new Promise((resolve, reject) => {
        statProvider.async(path, optionsManager.prepare(opts), (err, stats) => err ? reject(err) : resolve(stats));
    });
}
exports.stat = stat;
function statCallback(path, optsOrCallback, callback) {
    if (typeof optsOrCallback === 'function') {
        callback = optsOrCallback; /* tslint:disable-line: no-parameter-reassignment */
        optsOrCallback = undefined; /* tslint:disable-line: no-parameter-reassignment */
    }
    if (typeof callback === 'undefined') {
        throw new TypeError('The "callback" argument must be of type Function.');
    }
    statProvider.async(path, optionsManager.prepare(optsOrCallback), callback);
}
exports.statCallback = statCallback;
/**
 * Synchronous API.
 */
function statSync(path, opts) {
    return statProvider.sync(path, optionsManager.prepare(opts));
}
exports.statSync = statSync;