Skip to content

Commit

Permalink
Merge fda992a into a62417b
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot-preview[bot] committed Jan 30, 2021
2 parents a62417b + fda992a commit 68f39da
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/hexo/multi_config_path.js
Expand Up @@ -51,7 +51,7 @@ module.exports = ctx => function multiConfigPath(base, configPaths, outputDir) {
combinedConfig = deepMerge(combinedConfig, yml.load(file));
count++;
} else if (ext === '.json') {
combinedConfig = deepMerge(combinedConfig, yml.safeLoad(file, {json: true}));
combinedConfig = deepMerge(combinedConfig, yml.load(file, {json: true}));
count++;
} else {
log.w(`Config file ${paths[i]} not supported type.`);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -49,7 +49,7 @@
"hexo-i18n": "^1.0.0",
"hexo-log": "^2.0.0",
"hexo-util": "^2.4.0",
"js-yaml": "^3.12.0",
"js-yaml": "^4.0.0",
"micromatch": "^4.0.2",
"moment": "^2.22.2",
"moment-timezone": "^0.5.21",
Expand Down
5 changes: 0 additions & 5 deletions test/scripts/console/config.js
Expand Up @@ -95,11 +95,6 @@ describe('config', () => {
should.not.exist(config.meta_generator);
});

it('write config: regex', async () => {
const config = await writeConfig('include', /^pattern$/gim);
config.include.should.eql(/^pattern$/gim);
});

it('write config: json', async () => {
const configPath = join(hexo.base_dir, '_config.json');
hexo.config_path = join(hexo.base_dir, '_config.json');
Expand Down
1 change: 0 additions & 1 deletion test/scripts/filters/backtick_code_block.js
Expand Up @@ -477,7 +477,6 @@ describe('Backtick code block', () => {
};

codeBlock(data);
console.log(data.content);
data.content.should.contain('\n\n# New line');
});
});
Expand Down
12 changes: 6 additions & 6 deletions test/scripts/hexo/multi_config_path.js
Expand Up @@ -208,14 +208,14 @@ describe('config flag handling', () => {
it('2 YAML overwrite', () => {
const configFile = mcp(base, 'test1.yml,test2.yml');
let config = fs.readFileSync(configFile);
config = yml.safeLoad(config);
config = yml.load(config);

config.author.should.eql('bar');
config.favorites.food.should.eql('candy');
config.type.should.eql('dinosaur');

config = fs.readFileSync(mcp(base, 'test2.yml,test1.yml'));
config = yml.safeLoad(config);
config = yml.load(config);

config.author.should.eql('foo');
config.favorites.food.should.eql('sushi');
Expand All @@ -224,14 +224,14 @@ describe('config flag handling', () => {

it('2 JSON overwrite', () => {
let config = fs.readFileSync(mcp(base, 'test1.json,test2.json'));
config = yml.safeLoad(config);
config = yml.load(config);

config.author.should.eql('waldo');
config.favorites.food.should.eql('ice cream');
config.type.should.eql('elephant');

config = fs.readFileSync(mcp(base, 'test2.json,test1.json'));
config = yml.safeLoad(config);
config = yml.load(config);

config.author.should.eql('dinosaur');
config.favorites.food.should.eql('burgers');
Expand All @@ -240,14 +240,14 @@ describe('config flag handling', () => {

it('JSON & YAML overwrite', () => {
let config = fs.readFileSync(mcp(base, 'test1.yml,test1.json'));
config = yml.safeLoad(config);
config = yml.load(config);

config.author.should.eql('dinosaur');
config.favorites.food.should.eql('burgers');
config.type.should.eql('elephant');

config = fs.readFileSync(mcp(base, 'test1.json,test1.yml'));
config = yml.safeLoad(config);
config = yml.load(config);

config.author.should.eql('foo');
config.favorites.food.should.eql('sushi');
Expand Down

0 comments on commit 68f39da

Please sign in to comment.