Skip to content

Commit

Permalink
update import is-valid-path
Browse files Browse the repository at this point in the history
  • Loading branch information
Beni03 committed Sep 10, 2019
1 parent 4789b60 commit 3135196
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion output/undefined.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"t"
"]"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"dayjs": "^1.8.13",
"eslint-plugin-json": "^1.4.0",
"fs": "^0.0.2",
"is-valid-path": "^0.1.1",
"lodash": "^4.17.11",
"path": "^0.12.7",
"path-exists": "^4.0.0",
Expand Down
9 changes: 4 additions & 5 deletions src/fileSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import {
writeFile, mkdirSync, readFileSync, existsSync,
} from 'fs';
import isValid from 'is-valid-path';
import { stripSymbols, getFileName } from './writeFile';
var isValid = require('is-valid-path');

// import { isDirectory } from "./utils";

Expand All @@ -18,10 +18,9 @@ var isValid = require('is-valid-path');
// @TODO cover a test case, when dataStr is not an array.
// we can just pass a string there
const write = (path, data) => new Promise((resolve) => {
if(!isValid(path))
{
console.log("path is not valid")
}
if (!isValid(path)) {
console.log('path is not valid');
}
const dataStr = stripSymbols(data);

writeFile(path, dataStr, (err) => {
Expand Down

0 comments on commit 3135196

Please sign in to comment.