@konoui/mjimage 0.0.25 → 0.0.26

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.
@@ -24,8 +24,8 @@ export declare class Hand {
24
24
  getArrayLen(t: Type): 2 | 8 | 10;
25
25
  sum(t: Type): number;
26
26
  get(t: Type, n: number): number;
27
- inc(tiles: Tile[]): Tile[];
28
- dec(tiles: Tile[]): Tile[];
27
+ inc(tiles: readonly Tile[]): Tile[];
28
+ dec(tiles: readonly Tile[]): Tile[];
29
29
  draw(t: Tile): void;
30
30
  discard(t: Tile): void;
31
31
  reach(): void;
@@ -43,15 +43,15 @@ var Hand = (function () {
43
43
  continue;
44
44
  }
45
45
  else if (b.is(constants_1.BLOCK.HAND)) {
46
- this.inc(__spreadArray([], b.tiles, true));
46
+ this.inc(b.tiles);
47
47
  continue;
48
48
  }
49
49
  else if (input.split("").every(function (v) { return v === constants_1.TYPE.BACK; })) {
50
- this.inc(__spreadArray([], b.tiles, true));
50
+ this.inc(b.tiles);
51
51
  continue;
52
52
  }
53
53
  else if (allowBackBlock) {
54
- this.inc(__spreadArray([], b.tiles, true));
54
+ this.inc(b.tiles);
55
55
  continue;
56
56
  }
57
57
  throw new Error("unexpected block ".concat(b.type, " ").concat(b.toString()));
@@ -137,7 +137,7 @@ export declare class Controller {
137
137
  export declare class ActorHand extends Hand {
138
138
  isBackHand(): boolean;
139
139
  clone(): ActorHand;
140
- dec(tiles: Tile[]): Tile[];
140
+ dec(tiles: readonly Tile[]): Tile[];
141
141
  }
142
142
  export declare abstract class BaseActor {
143
143
  id: string;
@@ -681,7 +681,7 @@ var ActorHand = (function (_super) {
681
681
  if (!this.isBackHand())
682
682
  return _super.prototype.dec.call(this, tiles);
683
683
  _super.prototype.dec.call(this, tiles.map(function () { return new parser_1.Tile(core_1.TYPE.BACK, 0); }));
684
- return tiles;
684
+ return __spreadArray([], tiles, true);
685
685
  };
686
686
  return ActorHand;
687
687
  }(calculator_1.Hand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konoui/mjimage",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Generates Mahjong tiles in SVG format.",
5
5
  "author": "konoui",
6
6
  "license": "MIT",