BREAKING CHANGE(smartfile.fs.fileExists now returns a Promise<boolean>): update

This commit is contained in:
Philipp Kunz 2019-02-17 21:07:22 +01:00
parent 9b8f055ec2
commit c92b759432
3 changed files with 39 additions and 39 deletions

62
package-lock.json generated
View File

@ -15,9 +15,9 @@
}
},
"@gitzone/tsbuild": {
"version": "2.1.5",
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.5.tgz",
"integrity": "sha512-jmilEa+pSeZCGp2TuckCbc+BU5fQQjnPv0CYmOTtyOltbwOVigZesNBV4otSMJq54OlQ/GghgjC3SUCOI5SOTw==",
"version": "2.1.8",
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftsbuild/-/tsbuild-2.1.8.tgz",
"integrity": "sha512-xdFCi5OZe03ShjB5tIcKZ5vGis6wzqiCkvNtQ/pMkp90KFA+fAjARVfeSUpuRRlAXoaewv+snK/GkvlvhviqNw==",
"dev": true,
"requires": {
"@pushrocks/smartcli": "^3.0.7",
@ -272,17 +272,17 @@
}
},
"@types/fs-extra": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-5.0.4.tgz",
"integrity": "sha512-DsknoBvD8s+RFfSGjmERJ7ZOP1HI0UZRA3FSI+Zakhrc/Gy26YQsLI+m5V5DHxroHRJqCDLKJp7Hixn8zyaF7g==",
"version": "5.0.5",
"resolved": "https://verdaccio.lossless.one/@types%2ffs-extra/-/fs-extra-5.0.5.tgz",
"integrity": "sha512-w7iqhDH9mN8eLClQOYTkhdYUOSpp25eXxfc6VbFOGtzxW34JcvctH2bKjj4jD4++z4R5iO5D+pg48W2e03I65A==",
"requires": {
"@types/node": "*"
}
},
"@types/luxon": {
"version": "1.10.2",
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.10.2.tgz",
"integrity": "sha512-LEqrz+1tzeWwyzmC9hJ6negMjGGc1ABaAwVPwkeN1a2/Oqql/SowlcENFd5e2EkWYJd7FhMojFBTuyWOPUx8sg==",
"version": "1.11.0",
"resolved": "https://verdaccio.lossless.one/@types%2fluxon/-/luxon-1.11.0.tgz",
"integrity": "sha512-4MBC4fp+W+LJ7Abr03qJtJn2yS6sy9B9xgU+fEaWiIHYxRkFgLVl4WEsLK/dKYXe8VdWtLM4fED4HWaJpMnJMg==",
"dev": true
},
"@types/minimatch": {
@ -292,9 +292,9 @@
"dev": true
},
"@types/node": {
"version": "10.12.18",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-10.12.18.tgz",
"integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ=="
"version": "11.9.4",
"resolved": "https://verdaccio.lossless.one/@types%2fnode/-/node-11.9.4.tgz",
"integrity": "sha512-Zl8dGvAcEmadgs1tmSPcvwzO1YRsz38bVJQvH1RvRqSR9/5n61Q1ktcDL0ht3FXWR+ZpVmXVwN1LuH4Ax23NsA=="
},
"@types/through2": {
"version": "2.0.33",
@ -320,9 +320,9 @@
"dev": true
},
"@types/yargs": {
"version": "12.0.8",
"resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.8.tgz",
"integrity": "sha512-OMSKUmZ09gbzITzx4nxnJqhprWC7JqsmlrEsVtb+cv3GXHNpv0kktqxhboKX52FnMggkQvT5ezt8pxTWyKpJHA==",
"version": "12.0.9",
"resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.9.tgz",
"integrity": "sha512-sCZy4SxP9rN2w30Hlmg5dtdRwgYQfYRiLo9usw8X9cxlf+H4FqM1xX7+sNH7NNKVdbXMJWqva7iyy+fxh/V7fA==",
"dev": true
},
"ansi-256-colors": {
@ -1013,9 +1013,9 @@
}
},
"luxon": {
"version": "1.10.0",
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.10.0.tgz",
"integrity": "sha512-ry3GKh//v3isD6oJN5pFWmdh+3GiScwv9q8VgG6fZ2j1guGOol2vVVdo4GBAWCrcq5RHOqSeipqHBnOu/u024Q==",
"version": "1.11.2",
"resolved": "https://verdaccio.lossless.one/luxon/-/luxon-1.11.2.tgz",
"integrity": "sha512-dD6sJotzprPhqJAp9eZbc1y1cc0CMiwRabsaEfFBJT2lRkWdOqJe3QmxB8GNwjOHZ6fciuGiLK3htgxZgphGxA==",
"dev": true
},
"make-error": {
@ -1034,14 +1034,14 @@
}
},
"mem": {
"version": "4.0.0",
"resolved": "https://verdaccio.lossless.one/mem/-/mem-4.0.0.tgz",
"integrity": "sha512-WQxG/5xYc3tMbYLXoXPm81ET2WDULiU5FxbuIoNbJqLOOI8zehXFdZuiUEgfdrU2mVB1pxBZUGlYORSrpuJreA==",
"version": "4.1.0",
"resolved": "https://verdaccio.lossless.one/mem/-/mem-4.1.0.tgz",
"integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==",
"dev": true,
"requires": {
"map-age-cleaner": "^0.1.1",
"mimic-fn": "^1.0.0",
"p-is-promise": "^1.1.0"
"p-is-promise": "^2.0.0"
}
},
"mime-db": {
@ -1169,9 +1169,9 @@
"dev": true
},
"p-is-promise": {
"version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/p-is-promise/-/p-is-promise-1.1.0.tgz",
"integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=",
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/p-is-promise/-/p-is-promise-2.0.0.tgz",
"integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==",
"dev": true
},
"p-limit": {
@ -1299,9 +1299,9 @@
}
},
"rxjs": {
"version": "6.3.3",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.3.3.tgz",
"integrity": "sha512-JTWmoY9tWCs7zvIk/CvRjhjGaOd+OVBM987mxFo+OW66cGpdKjZcpmc74ES1sB//7Kl/PAe8+wEakuhG4pcgOw==",
"version": "6.4.0",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz",
"integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==",
"dev": true,
"requires": {
"tslib": "^1.9.0"
@ -1503,9 +1503,9 @@
}
},
"tslint-config-prettier": {
"version": "1.17.0",
"resolved": "https://verdaccio.lossless.one/tslint-config-prettier/-/tslint-config-prettier-1.17.0.tgz",
"integrity": "sha512-NKWNkThwqE4Snn4Cm6SZB7lV5RMDDFsBwz6fWUkTxOKGjMx8ycOHnjIbhn7dZd5XmssW3CwqUjlANR6EhP9YQw==",
"version": "1.18.0",
"resolved": "https://verdaccio.lossless.one/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz",
"integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==",
"dev": true
},
"tsutils": {

View File

@ -31,7 +31,7 @@
"@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartrequest": "^1.1.14",
"@types/fs-extra": "^5.0.4",
"@types/fs-extra": "^5.0.5",
"@types/vinyl": "^2.0.2",
"fs-extra": "^7.0.1",
"glob": "^7.1.3",
@ -39,13 +39,13 @@
"vinyl-file": "^3.0.0"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.5",
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.18",
"@types/node": "^11.9.4",
"gulp-function": "^2.2.14",
"tslint": "^5.12.1",
"tslint-config-prettier": "^1.17.0"
"tslint-config-prettier": "^1.18.0"
}
}

View File

@ -29,10 +29,10 @@ export let fileExistsSync = function(filePath): boolean {
* @param filePath
* @returns {any}
*/
export let fileExists = (filePath): Promise<void> => {
let done = plugins.smartpromise.defer<void>();
export let fileExists = (filePath): Promise<boolean> => {
const done = plugins.smartpromise.defer<boolean>();
plugins.fs.access(filePath, 4, err => {
err ? done.reject(err) : done.resolve();
err ? done.resolve(false) : done.resolve(true);
});
return done.promise;
};
@ -40,7 +40,7 @@ export let fileExists = (filePath): Promise<void> => {
/**
* Checks if given path points to an existing directory
*/
export let isDirectory = function(pathArg): boolean {
export let isDirectory = (pathArg): boolean => {
try {
return plugins.fsExtra.statSync(pathArg).isDirectory();
} catch (err) {