update to latest standards
This commit is contained in:
37
dist/smartfile.classes.smartfile.d.ts
vendored
37
dist/smartfile.classes.smartfile.d.ts
vendored
@ -4,13 +4,48 @@ export interface ISmartfileConstructorOptions {
|
||||
contentsString?: string;
|
||||
contentBuffer?: Buffer;
|
||||
}
|
||||
/**
|
||||
* class Smartfile
|
||||
* -> is vinyl file compatible
|
||||
*/
|
||||
export declare class Smartfile {
|
||||
/**
|
||||
* the full path of the file on disk
|
||||
*/
|
||||
path: string;
|
||||
/**
|
||||
* The contents of the file as Buffer
|
||||
*/
|
||||
contents: Buffer;
|
||||
/**
|
||||
* The current working directory of the file
|
||||
*/
|
||||
cwd: string;
|
||||
/**
|
||||
* sync the file with disk
|
||||
*/
|
||||
sync: boolean;
|
||||
/**
|
||||
* the constructor of Smartfile
|
||||
* @param optionsArg
|
||||
*/
|
||||
constructor(optionsArg: ISmartfileConstructorOptions);
|
||||
/**
|
||||
* return relative path of file
|
||||
* ->
|
||||
*/
|
||||
readonly relative: string;
|
||||
/**
|
||||
* set contents from string
|
||||
* @param contentString
|
||||
*/
|
||||
setContentFromString(contentString: string): void;
|
||||
setContentsFromString(contentString: string): void;
|
||||
/**
|
||||
* write file to disk
|
||||
*/
|
||||
write(): Promise<void>;
|
||||
/**
|
||||
* read file from disk
|
||||
*/
|
||||
read(): Promise<void>;
|
||||
}
|
||||
|
41
dist/smartfile.classes.smartfile.js
vendored
41
dist/smartfile.classes.smartfile.js
vendored
@ -1,6 +1,22 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
/**
|
||||
* class Smartfile
|
||||
* -> is vinyl file compatible
|
||||
*/
|
||||
class Smartfile {
|
||||
/**
|
||||
* the constructor of Smartfile
|
||||
* @param optionsArg
|
||||
*/
|
||||
constructor(optionsArg) {
|
||||
if (optionsArg.contentBuffer) {
|
||||
this.contents = optionsArg.contentBuffer;
|
||||
@ -10,13 +26,34 @@ class Smartfile {
|
||||
}
|
||||
this.path = optionsArg.path;
|
||||
}
|
||||
/**
|
||||
* return relative path of file
|
||||
* ->
|
||||
*/
|
||||
get relative() {
|
||||
return '';
|
||||
}
|
||||
/**
|
||||
* set contents from string
|
||||
* @param contentString
|
||||
*/
|
||||
setContentFromString(contentString) {
|
||||
setContentsFromString(contentString) {
|
||||
this.contents = new Buffer(contentString);
|
||||
}
|
||||
/**
|
||||
* write file to disk
|
||||
*/
|
||||
write() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
});
|
||||
}
|
||||
/**
|
||||
* read file from disk
|
||||
*/
|
||||
read() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.Smartfile = Smartfile;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRmaWxlLmNsYXNzZXMuc21hcnRmaWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBUUE7SUFHRSxZQUFZLFVBQXdDO1FBQ2xELEVBQUUsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxhQUFhLENBQUMsQ0FBQyxDQUFDO1lBQzdCLElBQUksQ0FBQyxRQUFRLEdBQUcsVUFBVSxDQUFDLGFBQWEsQ0FBQTtRQUMxQyxDQUFDO1FBQUMsSUFBSSxDQUFDLE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