• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hexojs / hexo / 5501096667

pending completion
5501096667

push

github

web-flow
fix(moize): helper function not working fine with relative_url (#5217)

2250 of 2356 branches covered (95.5%)

14 of 14 new or added lines in 2 files covered. (100.0%)

8840 of 8917 relevant lines covered (99.14%)

54.13 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/lib/theme/processors/source.ts
1
import { Pattern } from 'hexo-util';
1✔
2
import * as common from '../../plugins/processor/common';
1✔
3

1✔
4
function process(file) {
14✔
5
  const Asset = this.model('Asset');
14✔
6
  const id = file.source.substring(this.base_dir.length).replace(/\\/g, '/');
14✔
7
  const { path } = file.params;
14✔
8
  const doc = Asset.findById(id);
14✔
9

14✔
10
  if (file.type === 'delete') {
14✔
11
    if (doc) {
2✔
12
      return doc.remove();
2✔
13
    }
2✔
14

×
15
    return;
×
16
  }
×
17

12✔
18
  return Asset.save({
12✔
19
    _id: id,
12✔
20
    path,
12✔
21
    modified: file.type !== 'skip'
12✔
22
  });
12✔
23
}
12✔
24

1✔
25
const pattern = new Pattern(path => {
1✔
26
  if (!path.startsWith('source/')) return false;
25✔
27

16✔
28
  path = path.substring(7);
16✔
29
  if (common.isHiddenFile(path) || common.isTmpFile(path) || path.includes('node_modules')) return false;
25✔
30

11✔
31
  return {path};
11✔
32
});
1✔
33

1✔
34
export const source = {
1✔
35
  pattern,
1✔
36
  process
1✔
37
};
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc