boho 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "boho",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Secure Lightweight Encryption & Authentication Library for Node.js, Browsers and Arduino.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  "import": "./dist/boho.js",
8
- "require": null
8
+ "require": "./dist/boho.cjs"
9
9
  },
10
10
  "types": "dist/boho.d.ts",
11
11
  "browser": "./dist/boho.min.js",
@@ -33,11 +33,11 @@
33
33
  "devDependencies": {
34
34
  "@rollup/plugin-commonjs": "^28.0.3",
35
35
  "@rollup/plugin-node-resolve": "^15.3.1",
36
- "@rollup/plugin-terser": "^0.4.4",
36
+ "@rollup/plugin-terser": "^1.0.0",
37
37
  "rollup": "^4.36.0"
38
38
  },
39
39
  "dependencies": {
40
- "meta-buffer-pack": "^2.1.1"
40
+ "meta-buffer-pack": "^2.1.2"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "rollup -c",
package/rollup.config.js CHANGED
@@ -12,6 +12,10 @@ export default [
12
12
  name: 'Boho',
13
13
  sourcemap: true
14
14
  },
15
+ {
16
+ file: './dist/boho.cjs',
17
+ format: 'cjs'
18
+ },
15
19
  {
16
20
  file: './dist/boho.js',
17
21
  format: 'es',
package/test/RAND.cjs ADDED
@@ -0,0 +1,19 @@
1
+ const { describe, it } = require('node:test');
2
+ const assert = require('node:assert');
3
+ const Boho = require('boho');
4
+
5
+ describe('RAND cjs', function () {
6
+ describe('for number', function () {
7
+ const num = 16;
8
+
9
+ it('should return Uint8Array', function () {
10
+ assert.ok(Boho.RAND(num) instanceof Uint8Array);
11
+ });
12
+
13
+ it('should return number-bytes size of Uint8Array', function () {
14
+ assert.ok(Boho.RAND(num).byteLength === num);
15
+ });
16
+ });
17
+ });
18
+
19
+ console.log('buffer: hello', Boho.Buffer.from('hello'));