@xtia/alea-rc 0.0.5 → 0.0.6

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/README.md CHANGED
@@ -7,7 +7,7 @@ Alea is a utility wrapper for turning random numbers into useful values. Give it
7
7
  * Fully typed
8
8
  * Crypto-safe and seeded algorithms out-of-the-box
9
9
  * No dependencies
10
- * ~2.3kb minified core
10
+ * ~2.3kb minified core (1.04kb gzipped)
11
11
  * Ranged int, array shuffling, dice roll, weighted sampling, phrase generation, UUID, bytes and many more
12
12
 
13
13
  ## Brief:
@@ -1,3 +1,3 @@
1
- import { createAleaFromByteSource } from "./internal/factories.js";
1
+ import { createAleaFromByteSource } from "../internal/factories.js";
2
2
  export * from "./common.js";
3
3
  export const cryptoAlea = createAleaFromByteSource(arr => globalThis.crypto.getRandomValues(arr));
@@ -0,0 +1,5 @@
1
+ import { Alea } from "../internal/alea.js";
2
+ export type { Alea };
3
+ export { createAleaFromByteSource, createAleaFromSeed, createAleaFromFunc, } from "../internal/factories.js";
4
+ export { charsets } from "../internal/charsets.js";
5
+ export { alea } from "../internal/mathalea.js";
@@ -0,0 +1,3 @@
1
+ export { createAleaFromByteSource, createAleaFromSeed, createAleaFromFunc, } from "../internal/factories.js";
2
+ export { charsets } from "../internal/charsets.js";
3
+ export { alea } from "../internal/mathalea.js";
@@ -1,4 +1,4 @@
1
- import { createAleaFromByteSource } from "./internal/factories.js";
1
+ import { createAleaFromByteSource } from "../internal/factories.js";
2
2
  import { randomBytes } from 'node:crypto';
3
3
  export * from "./common.js";
4
4
  export const cryptoAlea = createAleaFromByteSource(arr => {
@@ -1,4 +1,4 @@
1
- import { Alea } from "./internal/alea.js";
1
+ import { Alea } from "../internal/alea.js";
2
2
  export * from "./common.js";
3
3
  /**
4
4
  * An Alea instance that uses the runtime environment's `crypto` provider as a source
@@ -1,4 +1,4 @@
1
- import { Alea } from "./internal/alea.js";
1
+ import { Alea } from "../internal/alea.js";
2
2
  export * from "./common.js";
3
3
  /**
4
4
  * An Alea instance that uses the runtime environment's `crypto` provider as a source
@@ -0,0 +1,5 @@
1
+ import { Alea } from "./alea.js";
2
+ /**
3
+ * An Alea instance that uses Math.random() as a source
4
+ */
5
+ export declare const alea: Alea;
@@ -0,0 +1,5 @@
1
+ import { Alea } from "./alea.js";
2
+ /**
3
+ * An Alea instance that uses Math.random() as a source
4
+ */
5
+ export const alea = new Alea(Math.random);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtia/alea-rc",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "RNG utilities",
5
5
  "repository": {
6
6
  "url": "https://github.com/tiadrop/alea",
@@ -11,19 +11,20 @@
11
11
  "main": "./index.js",
12
12
  "exports": {
13
13
  ".": {
14
- "types": "./other.d.ts",
15
- "browser": "./browser.js",
16
- "workerd": "./browser.js",
17
- "deno": "./browser.js",
18
- "node": "./node.js",
19
- "bun": "./node.js",
20
- "default": "./other.js"
14
+ "types": "./entry/other.d.ts",
15
+ "browser": "./entry/browser.js",
16
+ "workerd": "./entry/browser.js",
17
+ "deno": "./entry/browser.js",
18
+ "node": "./entry/node.js",
19
+ "bun": "./entry/node.js",
20
+ "default": "./entry/other.js"
21
21
  },
22
22
  "./prng": {
23
23
  "types": "./prng/index.d.ts",
24
24
  "default": "./prng/index.js"
25
25
  },
26
- "./internal/*": null
26
+ "./internal/*": null,
27
+ "./entry/*": null
27
28
  },
28
29
  "scripts": {
29
30
  "prepublishOnly": "cp ../README.md .",
package/common.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { Alea } from "./internal/alea.js";
2
- export type { Alea };
3
- export { createAleaFromByteSource, createAleaFromSeed, createAleaFromFunc, } from "./internal/factories.js";
4
- export { charsets } from "./internal/charsets.js";
5
- /**
6
- * An Alea instance that uses Math.random() as a source
7
- */
8
- export declare const alea: Alea;
package/common.js DELETED
@@ -1,7 +0,0 @@
1
- import { Alea } from "./internal/alea.js";
2
- export { createAleaFromByteSource, createAleaFromSeed, createAleaFromFunc, } from "./internal/factories.js";
3
- export { charsets } from "./internal/charsets.js";
4
- /**
5
- * An Alea instance that uses Math.random() as a source
6
- */
7
- export const alea = new Alea(Math.random);
File without changes
File without changes