Skip to content

Commit cefee92

Browse files
authored
chore(deps): bump hexo-fs from ^4.1.1 to ^4.1.3 (#5463)
1 parent b6ebbca commit cefee92

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

lib/hexo/load_plugins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function loadModuleList(ctx: Hexo, basedir: string): Promise<any> {
1919

2020
// Read package.json and find dependencies
2121
return readFile(packagePath).then(content => {
22-
const json = JSON.parse(content as string);
22+
const json = JSON.parse(content);
2323
const deps = Object.keys(json.dependencies || {});
2424
const devDeps = Object.keys(json.devDependencies || {});
2525

lib/hexo/multi_config_path.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export = (ctx: Hexo) => function multiConfigPath(base: string, configPaths?: str
4343
}
4444

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

4949
if (ext === '.yml') {

lib/hexo/post.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class Post {
363363
// Read the content
364364
src = join(draftDir, item);
365365
return readFile(src);
366-
}).then((content: string) => {
366+
}).then(content => {
367367
// Create post
368368
Object.assign(data, yfmParse(content));
369369
data.content = data._content;

lib/hexo/render.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Render {
7676
} else if (!data.path) {
7777
return Promise.reject(new TypeError('No input file or string!'));
7878
} else {
79-
promise = readFile(data.path) as Promise<string>;
79+
promise = readFile(data.path);
8080
}
8181

8282
return promise.then(text => {
@@ -109,7 +109,7 @@ class Render {
109109

110110
if (data.text == null) {
111111
if (!data.path) throw new TypeError('No input file or string!');
112-
data.text = readFileSync(data.path) as string;
112+
data.text = readFileSync(data.path);
113113
}
114114

115115
if (data.text == null) throw new TypeError('No input file or string!');

lib/hexo/update_package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function readPkg(path: string): Promise<any> {
2525
if (!exist) return;
2626

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

3131
return pkg;

lib/plugins/helper/number_format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Options {
66

77
function numberFormatHelper(num: number, options: Options = {}) {
88
const split = num.toString().split('.');
9-
let before = split.shift() as string;
9+
let before = split.shift();
1010
let after = split.length ? split[0] : '';
1111
const delimiter = options.delimiter || ',';
1212
const separator = options.separator || '.';

lib/plugins/renderer/nunjucks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function njkCompile(data: StoreFunctionData): nunjucks.Template {
5353

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

56-
return nunjucks.compile(text as string, env, data.path);
56+
return nunjucks.compile(text, env, data.path);
5757
}
5858

5959
function njkRenderer(data: StoreFunctionData, locals?: any): string {

lib/plugins/tag/include_code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export = (ctx: Hexo) => function includeCodeTag(args: string[]) {
5555

5656
return exists(src).then(exist => {
5757
if (exist) return readFile(src);
58-
}).then((code: string) => {
58+
}).then(code => {
5959
if (!code) return;
6060

6161
const lines = code.split('\n');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"bluebird": "^3.7.2",
4646
"hexo-cli": "^4.3.0",
4747
"hexo-front-matter": "^4.2.1",
48-
"hexo-fs": "^4.1.1",
48+
"hexo-fs": "^4.1.3",
4949
"hexo-i18n": "^2.0.0",
5050
"hexo-log": "^4.0.1",
5151
"hexo-util": "^3.3.0",

test/scripts/console/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('config', () => {
6565

6666
async function writeConfig(...args) {
6767
await config({_: args});
68-
const content = await readFile(hexo.config_path) as string;
68+
const content = await readFile(hexo.config_path);
6969
return load(content) as any;
7070
}
7171

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

109109
return readFile(configPath).then(content => {
110-
const json = JSON.parse(content as string);
110+
const json = JSON.parse(content);
111111

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

test/scripts/console/render.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe('render', () => {
4343

4444
await writeFile(src, body);
4545
await render({_: ['test.yml'], output: 'result.json'});
46-
const result = await readFile(dest) as string;
46+
const result = await readFile(dest);
4747
JSON.parse(result).should.eql({
4848
foo: 1,
4949
bar: {
@@ -64,7 +64,7 @@ describe('render', () => {
6464
await writeFile(src, body);
6565
await render({_: [src], output: 'result.json'});
6666

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

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

111-
const result = await readFile(dest) as string;
111+
const result = await readFile(dest);
112112
JSON.parse(result).should.eql({
113113
foo: 1,
114114
bar: {

test/scripts/hexo/update_package.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Update package.json', () => {
2525

2626
await writeFile(packagePath, JSON.stringify(pkg));
2727
await updatePkg(hexo);
28-
const content = await readFile(packagePath) as string;
28+
const content = await readFile(packagePath);
2929
JSON.parse(content).hexo.version.should.eql(hexo.version);
3030
hexo.env.init.should.be.true;
3131

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

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

5858
await writeFile(packagePath, JSON.stringify(pkg));
5959
await updatePkg(hexo);
60-
const content = await readFile(packagePath) as string;
60+
const content = await readFile(packagePath);
6161
JSON.parse(content).should.eql(pkg);
6262
hexo.env.init.should.be.true;
6363

0 commit comments

Comments
 (0)