commitizen
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -14,6 +14,2 @@ "use strict"; | ||
var _isUtf = _interopRequireDefault(require("is-utf8")); | ||
var _stripBom = _interopRequireDefault(require("strip-bom")); | ||
var _configLoader = require("../configLoader"); | ||
@@ -38,3 +34,5 @@ | ||
const isRcFile = parsedPath.ext !== '.js' && parsedPath.ext !== '.json'; | ||
const jsonString = readConfigFileContent(configPath); | ||
const jsonString = _fs.default.readFileSync(configPath, 'utf-8'); | ||
const parse = isRcFile ? contents => JSON.parse((0, _stripJsonComments.default)(contents)) : contents => JSON.parse(contents); | ||
@@ -78,18 +76,2 @@ | ||
; | ||
/** | ||
* Read proper content from config file. | ||
* If the chartset of the config file is not utf-8, one error will be thrown. | ||
* @param {String} configPath | ||
* @return {String} | ||
*/ | ||
function readConfigFileContent(configPath) { | ||
let rawBufContent = _fs.default.readFileSync(configPath); | ||
if (!(0, _isUtf.default)(rawBufContent)) { | ||
throw new Error(`The config file at "${configPath}" contains invalid charset, expect utf8`); | ||
} | ||
return (0, _stripBom.default)(rawBufContent.toString("utf8")); | ||
} | ||
; |
{ | ||
"name": "commitizen", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Git commit, but play nice with conventions.", | ||
@@ -88,3 +88,2 @@ "main": "dist/index.js", | ||
"shelljs": "0.7.6", | ||
"strip-bom": "3.0.0", | ||
"strip-json-comments": "2.0.1" | ||
@@ -91,0 +90,0 @@ }, |
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
13
156744
1172
- Removedstrip-bom@3.0.0
- Removedstrip-bom@3.0.0(transitive)