@nodelib/fs.stat
Advanced tools
Comparing version 2.0.2 to 2.0.3
/// <reference types="node" /> | ||
import * as fs from 'fs'; | ||
export interface FileSystemAdapter { | ||
export declare type FileSystemAdapter = { | ||
lstat: typeof fs.lstat; | ||
@@ -8,5 +8,5 @@ stat: typeof fs.stat; | ||
statSync: typeof fs.statSync; | ||
} | ||
}; | ||
export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; | ||
export declare function createFileSystemAdapter(fsMethods?: Partial<FileSystemAdapter>): FileSystemAdapter; | ||
//# sourceMappingURL=fs.d.ts.map |
@@ -11,7 +11,7 @@ "use strict"; | ||
function createFileSystemAdapter(fsMethods) { | ||
if (!fsMethods) { | ||
if (fsMethods === undefined) { | ||
return exports.FILE_SYSTEM_ADAPTER; | ||
} | ||
return Object.assign({}, exports.FILE_SYSTEM_ADAPTER, fsMethods); | ||
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); | ||
} | ||
exports.createFileSystemAdapter = createFileSystemAdapter; |
import { FileSystemAdapter } from './adapters/fs'; | ||
import * as async from './providers/async'; | ||
import Settings, { Options } from './settings'; | ||
import { Stats } from './types/index'; | ||
import { Stats } from './types'; | ||
declare type AsyncCallback = async.AsyncCallback; | ||
@@ -6,0 +6,0 @@ declare function stat(path: string, callback: AsyncCallback): void; |
import Settings from '../settings'; | ||
import { ErrnoException, Stats } from '../types/index'; | ||
import { ErrnoException, Stats } from '../types'; | ||
export declare type AsyncCallback = (err: ErrnoException, stats: Stats) => void; | ||
export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; | ||
//# sourceMappingURL=async.d.ts.map |
@@ -5,3 +5,3 @@ "use strict"; | ||
settings.fs.lstat(path, (lstatError, lstat) => { | ||
if (lstatError) { | ||
if (lstatError !== null) { | ||
return callFailureCallback(callback, lstatError); | ||
@@ -13,3 +13,3 @@ } | ||
settings.fs.stat(path, (statError, stat) => { | ||
if (statError) { | ||
if (statError !== null) { | ||
if (settings.throwErrorOnBrokenSymbolicLink) { | ||
@@ -16,0 +16,0 @@ return callFailureCallback(callback, statError); |
import Settings from '../settings'; | ||
import { Stats } from '../types/index'; | ||
import { Stats } from '../types'; | ||
export declare function read(path: string, settings: Settings): Stats; | ||
//# sourceMappingURL=sync.d.ts.map |
import * as fs from './adapters/fs'; | ||
export interface Options { | ||
export declare type Options = { | ||
followSymbolicLink?: boolean; | ||
@@ -7,3 +7,3 @@ fs?: Partial<fs.FileSystemAdapter>; | ||
throwErrorOnBrokenSymbolicLink?: boolean; | ||
} | ||
}; | ||
export default class Settings { | ||
@@ -10,0 +10,0 @@ private readonly _options; |
{ | ||
"name": "@nodelib/fs.stat", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Get the status of a file with some features", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
"clean": "rimraf {tsconfig.tsbuildinfo,out}", | ||
"lint": "tslint \"src/**/*.ts\" -p . -t stylish", | ||
"lint": "eslint \"src/**/*.ts\" --cache", | ||
"compile": "tsc -b .", | ||
@@ -29,3 +29,3 @@ "compile:watch": "tsc -p . --watch --sourceMap", | ||
}, | ||
"gitHead": "b56e041e80bc6ae6c5fa31c327d5174ed1b8957a" | ||
"gitHead": "3b1ef7554ad7c061b3580858101d483fba847abf" | ||
} |
11410