Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
51f9d76a64 | |||
c2f809f9cf | |||
9f311984ac | |||
7515ecf9ce |
2
dist/smartfile.fs.js
vendored
2
dist/smartfile.fs.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "smartfile",
|
"name": "smartfile",
|
||||||
"version": "4.2.7",
|
"version": "4.2.9",
|
||||||
"description": "offers smart ways to work with files in nodejs",
|
"description": "offers smart ways to work with files in nodejs",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
|
@ -53,8 +53,8 @@ tap.test('.fs.listFileTree() -> should get a file tree', async () => {
|
|||||||
|
|
||||||
tap.test('.fs.fileTreeToObject -> should read a file tree into an Object', async () => {
|
tap.test('.fs.fileTreeToObject -> should read a file tree into an Object', async () => {
|
||||||
let fileArrayArg = await smartfile.fs.fileTreeToObject(path.resolve('./test/'), '**/*.txt')
|
let fileArrayArg = await smartfile.fs.fileTreeToObject(path.resolve('./test/'), '**/*.txt')
|
||||||
expect(fileArrayArg[0].contents.toString()).to.not.be.null
|
expect(fileArrayArg[0]).to.be.instanceof(smartfile.Smartfile)
|
||||||
// expect(fileArrayArg[1]).to.be.instanceof(smartfile.Smartfile)
|
expect(fileArrayArg[0].contents.toString()).to.equal(fileArrayArg[0].contentBuffer.toString())
|
||||||
})
|
})
|
||||||
|
|
||||||
tap.test('.fs.copy() -> should copy a directory', async () => {
|
tap.test('.fs.copy() -> should copy a directory', async () => {
|
||||||
|
@ -203,8 +203,8 @@ export let toObjectSync = function (filePathArg, fileTypeArg?) {
|
|||||||
* @param filePath
|
* @param filePath
|
||||||
* @returns {string|Buffer|any}
|
* @returns {string|Buffer|any}
|
||||||
*/
|
*/
|
||||||
export let toStringSync = function (filePath: string) {
|
export let toStringSync = function (filePath: string): string {
|
||||||
let fileString = plugins.fsExtra.readFileSync(filePath, 'utf8')
|
let fileString: any = plugins.fsExtra.readFileSync(filePath, 'utf8')
|
||||||
return fileString
|
return fileString
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user