Skip to content

Commit

Permalink
chore: fix some tests and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ByDSA committed Jun 18, 2024
1 parent 404546c commit 77d2ebd
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"lint:fix": "eslint ./src/*.ts --fix",
"postdocs": "lib/docs/generate_footer.sh",
"postpublish": "pnpm clean",
"prebuild": "pnpm lint:fix &&p npm clean && pnpm rebuild && pnpm test",
"prebuild": "pnpm lint:fix && pnpm clean && pnpm rebuild && pnpm test",
"prepublishOnly": "pnpm build",
"test": "jest",
"test:coverage": "jest --coverage",
Expand Down
1 change: 1 addition & 0 deletions src/CreatePicker.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line import/no-cycle
import { Picker } from "./Picker";
import { DefaultPickerOptions, PickerOptions } from "./PickerOptions";
import { SinglePicker } from "./SinglePicker";
Expand Down
3 changes: 3 additions & 0 deletions src/Picker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import seedRandom from "seed-random";
// eslint-disable-next-line import/no-cycle
import { create } from "./CreatePicker";
import { DefaultPickOptions, PickOptions } from "./PickOptions";
import { PickerOptions } from "./PickerOptions";
Expand All @@ -14,6 +15,7 @@ export abstract class Picker<T> {
Object.freeze(options);
}

// eslint-disable-next-line accessor-pairs
get data(): Readonly<T[]> {
return this.innerData;
}
Expand Down Expand Up @@ -171,6 +173,7 @@ export abstract class Picker<T> {
return this.innerData.splice(index, 1)[0];
}

// eslint-disable-next-line accessor-pairs
get length(): number {
return this.innerData.length;
}
Expand Down
2 changes: 1 addition & 1 deletion src/RemoverPicker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import create from "./CreatePicker";
import { create } from "./CreatePicker";
import { PickOptions } from "./PickOptions";

const data = [1, 2, 3, 4, 5, 6];
Expand Down
2 changes: 1 addition & 1 deletion src/SinglePicker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable prefer-destructuring */
import create from "./CreatePicker";
import { create } from "./CreatePicker";
import { PickOptions } from "./PickOptions";

const data = [1, 2, 3, 4, 5, 6];
Expand Down
1 change: 1 addition & 0 deletions src/SinglePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Picker as AbstractPicker } from "./Picker";
export class SinglePicker<T> extends AbstractPicker<T> {
throwDart = (dart: number): T | undefined => this.innerData[dart];

// eslint-disable-next-line accessor-pairs
get weight(): number {
return this.innerData.length;
}
Expand Down
2 changes: 1 addition & 1 deletion src/WeightPicker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import create from "./CreatePicker";
import { create } from "./CreatePicker";

function createSample() {
const picker = create([1, 2, 3, 4, 5, 6], {
Expand Down
1 change: 1 addition & 0 deletions src/WeightPicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class WeightPicker<T> extends Picker<T> {
};
}

// eslint-disable-next-line accessor-pairs
get weight(): number {
let size = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/readme.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import create from "./CreatePicker";
import { create } from "./CreatePicker";
import { RandomMode } from "./RandomMode";
import { newPicker, Picker } from ".";

Expand Down

0 comments on commit 77d2ebd

Please sign in to comment.