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

hexojs / hexo-util / 16649341003

31 Jul 2025 12:44PM UTC coverage: 71.629% (-25.2%) from 96.875%
16649341003

Pull #426

github

web-flow
Merge ba0ee12e7 into d497bc760
Pull Request #426: build: support both ESM and CommonJS

730 of 1049 branches covered (69.59%)

1439 of 2000 new or added lines in 41 files covered. (71.95%)

6 existing lines in 1 file now uncovered.

5196 of 7254 relevant lines covered (71.63%)

68.15 hits per line

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

87.5
/lib/cache_stream.ts
1
import { Transform } from 'stream';
1✔
2

1✔
3
class CacheStream extends Transform {
1✔
4
  _cache: Buffer[];
23✔
5

23✔
6
  constructor() {
23✔
7
    super();
23✔
8

23✔
9
    this._cache = [];
23✔
10
  }
23✔
11

23✔
12
  _transform(chunk, enc, callback) {
23✔
13
    const buf = chunk instanceof Buffer ? chunk : Buffer.from(chunk, enc);
10!
14
    this._cache.push(buf);
10✔
15
    this.push(buf);
10✔
16
    callback();
10✔
17
  }
10✔
18

23✔
19
  getCache() {
23✔
20
    return Buffer.concat(this._cache);
12✔
21
  }
12✔
22
}
23✔
23

1✔
24

1✔
25
// For ESM compatibility
1✔
26
export default CacheStream;
1✔
27
// For CommonJS compatibility
1✔
28
if (typeof module !== 'undefined' && typeof module.exports === 'object' && module.exports !== null) {
1!
NEW
29
  module.exports = CacheStream;
×
NEW
30
  // For ESM compatibility
×
NEW
31
  module.exports.default = CacheStream;
×
NEW
32
}
×
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