Add proper zip file check

master
Rohan Vazarkar 2018-07-16 15:11:42 -04:00
parent f093a6863c
commit 37cc34c7cb
2 changed files with 3 additions and 2 deletions

View File

@ -56,9 +56,9 @@
"dagre": "^0.7.4",
"electron-store": "^1.3.0",
"eventemitter2": "^4.1.0",
"is-zip-file": "^1.0.2",
"jquery": "^3.2.1",
"linkurious": "^1.5.1",
"magic-number": "^0.1.6",
"mustache": "^2.3.0",
"neo4j-driver": "^1.6.2",
"prop-types": "^15.6.2",

View File

@ -23,6 +23,7 @@ import { withParser } from "stream-json/filters/Pick";
import { streamArray } from "stream-json/streamers/StreamArray";
import { chain } from "stream-chain";
import { connectTo } from "stream-json/Assembler";
var iszip = require('is-zip-file');
export default class MenuContainer extends Component {
constructor() {
@ -168,7 +169,7 @@ export default class MenuContainer extends Component {
var path = files[index].path;
var name = files[index].name;
if (path.endsWith(".zip")) {
if (iszip.isZipSync(path)) {
await createReadStream(path)
.pipe(Parse())
.on("entry", function(entry) {