Skip to content

Commit

Permalink
chore(deps): bump hexo-fs from ^4.1.1 to ^4.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Apr 14, 2024
1 parent b6ebbca commit 488c595
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lib/hexo/load_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function loadModuleList(ctx: Hexo, basedir: string): Promise<any> {

// Read package.json and find dependencies
return readFile(packagePath).then(content => {
const json = JSON.parse(content as string);
const json = JSON.parse(content);
const deps = Object.keys(json.dependencies || {});
const devDeps = Object.keys(json.devDependencies || {});

Expand Down
2 changes: 1 addition & 1 deletion lib/hexo/multi_config_path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export = (ctx: Hexo) => function multiConfigPath(base: string, configPaths?: str
}

// files read synchronously to ensure proper overwrite order
const file = readFileSync(configPath) as string;
const file = readFileSync(configPath);
const ext = extname(paths[i]).toLowerCase();

if (ext === '.yml') {
Expand Down
2 changes: 1 addition & 1 deletion lib/hexo/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ class Post {
// Read the content
src = join(draftDir, item);
return readFile(src);
}).then((content: string) => {
}).then(content => {
// Create post
Object.assign(data, yfmParse(content));
data.content = data._content;
Expand Down
4 changes: 2 additions & 2 deletions lib/hexo/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Render {
} else if (!data.path) {
return Promise.reject(new TypeError('No input file or string!'));
} else {
promise = readFile(data.path) as Promise<string>;
promise = readFile(data.path);
}

return promise.then(text => {
Expand Down Expand Up @@ -109,7 +109,7 @@ class Render {

if (data.text == null) {
if (!data.path) throw new TypeError('No input file or string!');
data.text = readFileSync(data.path) as string;
data.text = readFileSync(data.path);
}

if (data.text == null) throw new TypeError('No input file or string!');
Expand Down
2 changes: 1 addition & 1 deletion lib/hexo/update_package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function readPkg(path: string): Promise<any> {
if (!exist) return;

return readFile(path).then(content => {
const pkg = JSON.parse(content as string);
const pkg = JSON.parse(content);
if (typeof pkg.hexo !== 'object') return;

return pkg;
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/helper/number_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface Options {

function numberFormatHelper(num: number, options: Options = {}) {
const split = num.toString().split('.');
let before = split.shift() as string;
let before = split.shift();
let after = split.length ? split[0] : '';
const delimiter = options.delimiter || ',';
const separator = options.separator || '.';
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/renderer/nunjucks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function njkCompile(data: StoreFunctionData): nunjucks.Template {

const text = 'text' in data ? data.text : readFileSync(data.path);

return nunjucks.compile(text as string, env, data.path);
return nunjucks.compile(text, env, data.path);
}

function njkRenderer(data: StoreFunctionData, locals?: any): string {
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/tag/include_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export = (ctx: Hexo) => function includeCodeTag(args: string[]) {

return exists(src).then(exist => {
if (exist) return readFile(src);
}).then((code: string) => {
}).then(code => {
if (!code) return;

const lines = code.split('\n');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"bluebird": "^3.7.2",
"hexo-cli": "^4.3.0",
"hexo-front-matter": "^4.2.1",
"hexo-fs": "^4.1.1",
"hexo-fs": "^4.1.3",
"hexo-i18n": "^2.0.0",
"hexo-log": "^4.0.1",
"hexo-util": "^3.3.0",
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/console/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ describe('config', () => {

async function writeConfig(...args) {
await config({_: args});
const content = await readFile(hexo.config_path) as string;
const content = await readFile(hexo.config_path);
return load(content) as any;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ describe('config', () => {
await config({_: ['title', 'My Blog']});

return readFile(configPath).then(content => {
const json = JSON.parse(content as string);
const json = JSON.parse(content);

json.title.should.eql('My Blog');

Expand Down
8 changes: 4 additions & 4 deletions test/scripts/console/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('render', () => {

await writeFile(src, body);
await render({_: ['test.yml'], output: 'result.json'});
const result = await readFile(dest) as string;
const result = await readFile(dest);
JSON.parse(result).should.eql({
foo: 1,
bar: {
Expand All @@ -64,7 +64,7 @@ describe('render', () => {
await writeFile(src, body);
await render({_: [src], output: 'result.json'});

const result = await readFile(dest) as string;
const result = await readFile(dest);
JSON.parse(result).should.eql({
foo: 1,
bar: {
Expand All @@ -85,7 +85,7 @@ describe('render', () => {
await writeFile(src, body);
await render({_: ['test.yml'], output: dest});

const result = await readFile(dest) as string;
const result = await readFile(dest);
JSON.parse(result).should.eql({
foo: 1,
bar: {
Expand All @@ -108,7 +108,7 @@ describe('render', () => {
await writeFile(src, body);
await render({_: ['test'], output: 'result.json', engine: 'yaml'});

const result = await readFile(dest) as string;
const result = await readFile(dest);
JSON.parse(result).should.eql({
foo: 1,
bar: {
Expand Down
6 changes: 3 additions & 3 deletions test/scripts/hexo/update_package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Update package.json', () => {

await writeFile(packagePath, JSON.stringify(pkg));
await updatePkg(hexo);
const content = await readFile(packagePath) as string;
const content = await readFile(packagePath);
JSON.parse(content).hexo.version.should.eql(hexo.version);
hexo.env.init.should.be.true;

Expand All @@ -40,7 +40,7 @@ describe('Update package.json', () => {

await writeFile(packagePath, JSON.stringify(pkg));
await updatePkg(hexo);
const content = await readFile(packagePath) as string;
const content = await readFile(packagePath);
// Don't change the original package.json
JSON.parse(content).should.eql(pkg);
hexo.env.init.should.be.false;
Expand All @@ -57,7 +57,7 @@ describe('Update package.json', () => {

await writeFile(packagePath, JSON.stringify(pkg));
await updatePkg(hexo);
const content = await readFile(packagePath) as string;
const content = await readFile(packagePath);
JSON.parse(content).should.eql(pkg);
hexo.env.init.should.be.true;

Expand Down

0 comments on commit 488c595

Please sign in to comment.