randex 0.16.0 → 0.18.0

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.
@@ -0,0 +1 @@
1
+ export declare function randomArrayItem<T>(array: T[]): T;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.randomArrayItem = void 0;
4
+ var number_1 = require("./number");
5
+ function randomArrayItem(array) {
6
+ var arrayCount = array.length - 1;
7
+ var index = (0, number_1.randomNumber)(0, arrayCount);
8
+ return array[index];
9
+ }
10
+ exports.randomArrayItem = randomArrayItem;
@@ -0,0 +1 @@
1
+ export declare function randomBool(): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.randomBool = void 0;
4
+ function randomBool() {
5
+ return Math.random() < 0.5;
6
+ }
7
+ exports.randomBool = randomBool;
@@ -6,3 +6,4 @@ export * from "./fullname";
6
6
  export * from "./number";
7
7
  export * from "./number-array";
8
8
  export * from "./array";
9
+ export * from "./bool";
@@ -22,3 +22,4 @@ __exportStar(require("./fullname"), exports);
22
22
  __exportStar(require("./number"), exports);
23
23
  __exportStar(require("./number-array"), exports);
24
24
  __exportStar(require("./array"), exports);
25
+ __exportStar(require("./bool"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "randex",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -9,7 +9,8 @@
9
9
  "build": "tsc",
10
10
  "lint": "eslint .",
11
11
  "lint:fix": "eslint . --fix",
12
- "v": "npm --no-git-tag-version version minor"
12
+ "v": "npm --no-git-tag-version version minor",
13
+ "p": "npm run v && npm run lint:fix && git add * && git commit -m\"v\" && git push origin master"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",