toStringSynv now creates normal strings
This commit is contained in:
parent
fb9766e93b
commit
7515ecf9ce
3
dist/smartfile.fs.js
vendored
3
dist/smartfile.fs.js
vendored
File diff suppressed because one or more lines are too long
@ -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 () => {
|
||||
let fileArrayArg = await smartfile.fs.fileTreeToObject(path.resolve('./test/'), '**/*.txt')
|
||||
expect(fileArrayArg[0].contents.toString()).to.not.be.null
|
||||
// expect(fileArrayArg[1]).to.be.instanceof(smartfile.Smartfile)
|
||||
expect(fileArrayArg[0]).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 () => {
|
||||
|
@ -203,8 +203,9 @@ export let toObjectSync = function (filePathArg, fileTypeArg?) {
|
||||
* @param filePath
|
||||
* @returns {string|Buffer|any}
|
||||
*/
|
||||
export let toStringSync = function (filePath: string) {
|
||||
let fileString = plugins.fsExtra.readFileSync(filePath, 'utf8')
|
||||
export let toStringSync = function (filePath: string): string {
|
||||
let fileString: any = plugins.fsExtra.readFileSync(filePath, 'utf8')
|
||||
fileString = `${fileString}`
|
||||
return fileString
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user