Skip to content

Commit

Permalink
fix: Replaced yamljs with yaml due to memory leak Unitech#5721
Browse files Browse the repository at this point in the history
  • Loading branch information
SeverinAlexB committed Jan 5, 2024
1 parent c4032e2 commit 83a3269
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 35 deletions.
4 changes: 2 additions & 2 deletions lib/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ Common.getConfigFileCandidates = function (name) {
* @return {Object} config object
*/
Common.parseConfig = function(confObj, filename) {
var yamljs = require('yamljs');
var YAML = require('yaml');
var vm = require('vm');

var isConfigFile = Common.isConfigFile(filename);
Expand All @@ -323,7 +323,7 @@ Common.parseConfig = function(confObj, filename) {
});
}
else if (isConfigFile == 'yaml') {
return yamljs.parse(confObj.toString());
return YAML.parse(confObj.toString());
}
else if (isConfigFile == 'js' || isConfigFile == 'mjs') {
var confPath = require.resolve(path.resolve(filename));
Expand Down
57 changes: 25 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"source-map-support": "0.5.21",
"sprintf-js": "1.1.2",
"vizion": "~2.2.1",
"yamljs": "0.3.0"
"yaml": "^2.3.4"
},
"optionalDependencies": {
"pm2-sysmonit": "^1.2.8"
Expand Down

0 comments on commit 83a3269

Please sign in to comment.