flex-dev-utils
Advanced tools
Comparing version 3.0.0-alpha.0 to 3.0.1-alpha.0
import fs from 'fs'; | ||
export default fs; | ||
/** | ||
* Checks the provided array of files exist | ||
* | ||
* @param files the files to check that they exist | ||
*/ | ||
export declare const checkFilesExist: (...files: string[]) => boolean; | ||
/** | ||
* Gets package.json path | ||
*/ | ||
export declare const getPackageJsonPath: () => string; | ||
/** | ||
* Updates the package.json version field | ||
* | ||
* @param version the new version | ||
*/ | ||
export declare const updatePackageVersion: (version: string) => void; | ||
/** | ||
* Reads package.json | ||
*/ | ||
export declare const readPackageJson: () => any; |
@@ -17,8 +17,35 @@ "use strict"; | ||
/** | ||
* Checks the provided array of files exist | ||
* | ||
* @param files the files to check that they exist | ||
*/ | ||
exports.checkFilesExist = function () { | ||
var files = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
files[_i] = arguments[_i]; | ||
} | ||
return files | ||
.map(fs_1.default.existsSync) | ||
.every(function (resp) { return resp; }); | ||
}; | ||
/** | ||
* Gets package.json path | ||
*/ | ||
exports.getPackageJsonPath = function () { return path.join(process.cwd(), 'package.json'); }; | ||
/** | ||
* Updates the package.json version field | ||
* | ||
* @param version the new version | ||
*/ | ||
exports.updatePackageVersion = function (version) { | ||
var packageJson = exports.readPackageJson(); | ||
packageJson.version = version; | ||
fs_1.default.writeFileSync(exports.getPackageJsonPath(), JSON.stringify(packageJson, null, 2)); | ||
}; | ||
/** | ||
* Reads package.json | ||
*/ | ||
exports.readPackageJson = function () { | ||
var packageJsonPath = path.join(process.cwd(), 'package.json'); | ||
return JSON.parse(fs_1.default.readFileSync(packageJsonPath, 'utf8')); | ||
return JSON.parse(fs_1.default.readFileSync(exports.getPackageJsonPath(), 'utf8')); | ||
}; | ||
//# sourceMappingURL=fs.js.map |
{ | ||
"name": "flex-dev-utils", | ||
"version": "3.0.0-alpha.0", | ||
"version": "3.0.1-alpha.0", | ||
"description": "Common development utility for creating a Flex plugin", | ||
"keywords": [ | ||
"flex", | ||
"plugins", | ||
"plugin", | ||
"twilio", | ||
@@ -45,3 +45,3 @@ "scripts" | ||
}, | ||
"gitHead": "9c2b77cefef18b5f1a8b2c51988921a7d3019435" | ||
"gitHead": "c14c66d5cc67a7da7bdfe4bf04587f70096905b3" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
329
18149
18