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

View File

@ -31,7 +31,7 @@
"@pushrocks/smartpath": "^4.0.1", "@pushrocks/smartpath": "^4.0.1",
"@pushrocks/smartpromise": "^2.0.5", "@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartrequest": "^1.1.14", "@pushrocks/smartrequest": "^1.1.14",
"@types/fs-extra": "^5.0.4", "@types/fs-extra": "^5.0.5",
"@types/vinyl": "^2.0.2", "@types/vinyl": "^2.0.2",
"fs-extra": "^7.0.1", "fs-extra": "^7.0.1",
"glob": "^7.1.3", "glob": "^7.1.3",
@ -39,13 +39,13 @@
"vinyl-file": "^3.0.0" "vinyl-file": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.5", "@gitzone/tsbuild": "^2.1.8",
"@gitzone/tsrun": "^1.1.17", "@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18", "@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7", "@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^10.12.18", "@types/node": "^11.9.4",
"gulp-function": "^2.2.14", "gulp-function": "^2.2.14",
"tslint": "^5.12.1", "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 * @param filePath
* @returns {any} * @returns {any}
*/ */
export let fileExists = (filePath): Promise<void> => { export let fileExists = (filePath): Promise<boolean> => {
let done = plugins.smartpromise.defer<void>(); const done = plugins.smartpromise.defer<boolean>();
plugins.fs.access(filePath, 4, err => { plugins.fs.access(filePath, 4, err => {
err ? done.reject(err) : done.resolve(); err ? done.resolve(false) : done.resolve(true);
}); });
return done.promise; return done.promise;
}; };
@ -40,7 +40,7 @@ export let fileExists = (filePath): Promise<void> => {
/** /**
* Checks if given path points to an existing directory * Checks if given path points to an existing directory
*/ */
export let isDirectory = function(pathArg): boolean { export let isDirectory = (pathArg): boolean => {
try { try {
return plugins.fsExtra.statSync(pathArg).isDirectory(); return plugins.fsExtra.statSync(pathArg).isDirectory();
} catch (err) { } catch (err) {