### Added

- Modern and lite builds generated from the same source.
- support ESM.
- Set up GitHub release action / provenance

### Fixed
- Fix uploading coverage to coveralls
- fix recognize environment is node when use browserfs
This commit is contained in:
Yi-Cyuan Chen
2026-07-20 10:19:42 +08:00
parent 6f25176e1e
commit b02f0d93f3
37 changed files with 10048 additions and 1073 deletions
+24
View File
@@ -0,0 +1,24 @@
import expect from 'expect.js';
import md5, {md5 as namedMd5} from 'js-md5';
import browserMd5 from 'js-md5/build/md5.mjs';
import minBrowserMd5 from 'js-md5/build/md5.min.mjs';
import modernMd5 from 'js-md5/build/md5.modern.mjs';
import minModernMd5 from 'js-md5/build/md5.modern.min.mjs';
import liteMd5 from 'js-md5/build/md5-lite.mjs';
import minLiteMd5 from 'js-md5/build/md5-lite.min.mjs';
const EXPECTED_MD5 = '900150983cd24fb0d6963f7d28e17f72';
[md5, namedMd5, browserMd5, minBrowserMd5, modernMd5, minModernMd5,
liteMd5, minLiteMd5].forEach(hash => {
expect(hash('abc')).to.be(EXPECTED_MD5);
});
expect(md5.hmac).to.be.a('function');
expect(browserMd5.hmac).to.be.a('function');
expect(modernMd5.hmac).to.be.a('function');
expect(liteMd5.hmac).to.be(undefined);
expect(liteMd5.base64).to.be(undefined);
expect(liteMd5.buffer).to.be(undefined);
console.log('ESM imports: PASS');