Comparing version 2.1.0 to 2.1.2
/// <reference types="node" /> | ||
import { FSMergerObject, Node, FileMeta, FileMetaOption, FileContent, ProxyOperations } from './interface'; | ||
import { Options, Entry } from 'walk-sync'; | ||
declare class FSMerge { | ||
_dirList: Node[]; | ||
import { InputNode } from 'broccoli-node-api'; | ||
import { readFileSync, existsSync, lstatSync, statSync, readdirSync, readdir } from 'fs'; | ||
import { entries, Options, Entry } from 'walk-sync'; | ||
declare class FSMerger { | ||
_dirList: FSMerger.Node[]; | ||
MAP: { | ||
[key: string]: FSMergerObject; | ||
[key: string]: FSMerger.FSMergerObject; | ||
} | null; | ||
PREFIXINDEXMAP: { | ||
[key: number]: FSMergerObject; | ||
[key: number]: FSMerger.FSMergerObject; | ||
}; | ||
_atList: FSMerge[]; | ||
fs: ProxyOperations; | ||
constructor(trees: Node[] | Node); | ||
_atList: FSMerger[]; | ||
fs: FSMerger.FSMergerFileOperations; | ||
constructor(trees: FSMerger.Node[] | FSMerger.Node); | ||
readFileSync(filePath: string, options?: { | ||
encoding?: string | null; | ||
flag?: string; | ||
} | string | null): FileContent | undefined; | ||
at(index: number): FSMerge; | ||
} | string | null): FSMerger.FileContent | undefined; | ||
at(index: number): FSMerger; | ||
_generateMap(): void; | ||
readFileMeta(filePath: string, options: FileMetaOption): FileMeta | undefined; | ||
readFileMeta(filePath: string, options?: FSMerger.FileMetaOption): FSMerger.FileMeta | undefined; | ||
readdirSync(dirPath: string, options?: { | ||
@@ -30,4 +31,35 @@ encoding?: string | null; | ||
} | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, files: string[] | Buffer[]) => void): void; | ||
entries(dirPath: string | undefined, options: Options): Entry[]; | ||
entries(dirPath?: string, options?: Options): Entry[]; | ||
} | ||
export default FSMerge; | ||
export = FSMerger; | ||
declare namespace FSMerger { | ||
export interface FSMergerFileOperations extends FSMerger { | ||
existsSync: typeof existsSync; | ||
lstatSync: typeof lstatSync; | ||
statSync: typeof statSync; | ||
} | ||
export type FSMergerObject = { | ||
root: string; | ||
prefix: string | undefined; | ||
getDestinationPath: Function | undefined; | ||
}; | ||
export type FileContent = string | Buffer | null; | ||
export type FileMeta = { | ||
path: string; | ||
prefix: string | undefined; | ||
getDestinationPath: Function | undefined; | ||
}; | ||
export type FileMetaOption = { | ||
basePath: string; | ||
}; | ||
export type Node = FSMergerObject | InputNode; | ||
interface FSMerger { | ||
readFileSync: typeof readFileSync; | ||
readdirSync: typeof readdirSync; | ||
readdir: typeof readdir; | ||
at(index: number): FSMerger; | ||
readFileMeta(filePath: string, options: FileMetaOption): FileMeta; | ||
entries: typeof entries; | ||
} | ||
export {}; | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs = require('fs-extra'); | ||
@@ -72,3 +71,3 @@ const path = require('path'); | ||
} | ||
class FSMerge { | ||
class FSMerger { | ||
constructor(trees) { | ||
@@ -106,3 +105,3 @@ this._dirList = Array.isArray(trees) ? trees : [trees]; | ||
if (!this._atList[index]) { | ||
this._atList[index] = new FSMerge(this._dirList[index]); | ||
this._atList[index] = new FSMerger(this._dirList[index]); | ||
} | ||
@@ -239,3 +238,3 @@ return this._atList[index]; | ||
} | ||
exports.default = FSMerge; | ||
module.exports = FSMerger; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "fs-merger", | ||
"version": "2.1.0", | ||
"version": "2.1.2", | ||
"description": "Reads files from a real location", | ||
"main": "dist/index.js", | ||
"types": "src/index.ts", | ||
"types": "dist/index.d.ts", | ||
"author": "Sparshith NR", | ||
@@ -12,3 +12,3 @@ "license": "MIT", | ||
"clean": "rm -rf dist", | ||
"test": "yarn build && mocha tests/unit-test.js -r ts-node/register", | ||
"test": "yarn clean && yarn build && mocha tests/unit-test.js -r ts-node/register", | ||
"test:debugger": "yarn build && mocha --inspect-brk tests/unit-test.js -r ts-node/register" | ||
@@ -32,6 +32,3 @@ }, | ||
"walk-sync": "^2.0.2" | ||
}, | ||
"files": [ | ||
"dist" | ||
] | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
46332
11
884
4