diff --git a/demo/package.json b/demo/package.json index 30c195c..d4b8d5c 100644 --- a/demo/package.json +++ b/demo/package.json @@ -16,7 +16,7 @@ "@types/react": "^18.0.27", "@types/react-dom": "^18.0.10", "antd": "^5.1.7", - "mahjong-utils": "^0.3.0", + "mahjong-utils": "^0.6.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-scripts": "5.0.1", diff --git a/demo/yarn.lock b/demo/yarn.lock index 6512913..e74df96 100644 --- a/demo/yarn.lock +++ b/demo/yarn.lock @@ -4902,6 +4902,11 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +format-util@^1.0.5: + version "1.0.5" + resolved "http://localhost:4873/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271" + integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg== + forwarded@0.2.0: version "0.2.0" resolved "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -6562,17 +6567,19 @@ magic-string@^0.25.0, magic-string@^0.25.7: dependencies: sourcemap-codec "^1.4.8" -mahjong-utils-entry@^0.2.5: - version "0.2.5" - resolved "http://localhost:4873/mahjong-utils-entry/-/mahjong-utils-entry-0.2.5.tgz#3a87b2fad2c20902c6466bc9bd8449193131b682" - integrity sha512-VNBlqDhjQtl8dogIxviCM3HwhlRrUmqNI1mfPDXkwtn/D4r/YNGwlVHXpFaZCpSpV+FtZ8VQQmdUgGIo+1HYMw== +mahjong-utils-entry@^0.6.0: + version "0.6.0" + resolved "http://localhost:4873/mahjong-utils-entry/-/mahjong-utils-entry-0.6.0.tgz#29fe1a9e6191f10d181157a6e829953b7bb69b7f" + integrity sha512-V5u9mUkkc6C96PRR9FesxOrvN4DiUmWAywNy9JhBVh7gxW2HsRIVpNDw7767qdodId2/Y0cvNO6ktw2S4fmB0A== + dependencies: + format-util "^1.0.5" -mahjong-utils@^0.3.0: - version "0.3.0" - resolved "http://localhost:4873/mahjong-utils/-/mahjong-utils-0.3.0.tgz#501643a22c31cfb27d1dd1d70d2bc63d6f0256fe" - integrity sha512-tBKBz2rMiiTSJbkKfiwITB58S9gXkFKOgTfxum046hILBfeDnK1P+2uBK3Z3eG4G6YWyQLfgAqxycU5JVGKpKw== +mahjong-utils@^0.6.0: + version "0.6.0" + resolved "http://localhost:4873/mahjong-utils/-/mahjong-utils-0.6.0.tgz#ed0747754d68889865d5a09ccb1bda3677b9c0f9" + integrity sha512-IuIRErrCYRkNQhu7TiRGuNfzDZSVa43ScGsq+aNX+7MIk85rTBisNmIgEx9H63HEopcLmwgz5+6xRr5pCqelAA== dependencies: - mahjong-utils-entry "^0.2.5" + mahjong-utils-entry "^0.6.0" make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" diff --git a/package.json b/package.json index 60a552f..9dc7137 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "name": "ssttkkl", "email": "huang.wen.long@hotmail.com" }, - "version": "0.4.0", + "version": "0.5.2", "license": "MIT", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "tsc", + "build": "rimraf ./dist && tsc", "test": "jest", "lint": "eslint src/**/*.ts --fix" }, @@ -22,6 +22,7 @@ "eslint-plugin-n": "^15.0.0", "eslint-plugin-promise": "^6.0.0", "jest": "^29.4.1", + "rimraf": "^5.0.1", "ts-jest": "^29.0.5", "ts-loader": "^9.4.2", "typescript": "*" @@ -30,6 +31,6 @@ "dist/**/*" ], "dependencies": { - "mahjong-utils-entry": "^0.4.0" + "mahjong-utils-entry": "^0.5.2" } } diff --git a/src/coder/hora/hora.ts b/src/coder/hora/hora.ts index dfdd6cb..fe717c8 100644 --- a/src/coder/hora/hora.ts +++ b/src/coder/hora/hora.ts @@ -1,14 +1,14 @@ import { type AbstractHoraHandPattern, type Hora } from 'hora' import { decodeHoraHandPattern } from './hora-hand-pattern' -export function decodeHora( +export function decodeHora ( raw: any, patternType: T ): Hora -export function decodeHora(raw: any): Hora +export function decodeHora (raw: any): Hora -export function decodeHora( +export function decodeHora ( raw: any, patternType?: AbstractHoraHandPattern['type'] ): Hora { diff --git a/src/coder/shanten/shanten-info.ts b/src/coder/shanten/shanten-info.ts index d66cda3..eaf86ba 100644 --- a/src/coder/shanten/shanten-info.ts +++ b/src/coder/shanten/shanten-info.ts @@ -1,5 +1,6 @@ import { type Decoder, type Encoder } from '../../models/types' import { + type Improvement, type AbstractCommonShantenInfo, type AbstractShantenInfo, type ShantenWithFuroChance, @@ -11,13 +12,43 @@ import { InvalidTypeException } from '../errors' import { decodeTatsu, encodeTatsu } from '../models/tatsu' import { decodeTile, encodeTile } from '../models/tile' +export const decodeImprovement: Decoder = (raw) => { + return { + discard: decodeTile(raw.discard), + advance: raw.advance.map(decodeTile), + advanceNum: raw.advanceNum + } +} + +export const encodeImprovement: Encoder = (data) => { + return { + discard: encodeTile(data.discard), + advance: data.advance.map(encodeTile), + advanceNum: data.advanceNum + } +} + export const decodeShantenWithoutGot: Decoder = (raw) => { return { shantenNum: raw.shantenNum, advance: raw.advance.map(decodeTile), - advanceNum: raw.advanceNum ?? undefined, - goodShapeAdvance: raw.goodShapeAdvance?.map(decodeTile), - goodShapeAdvanceNum: raw.goodShapeAdvanceNum ?? undefined + advanceNum: raw.advanceNum, + goodShapeAdvance: raw.goodShapeAdvance?.map(decodeTile) ?? null, + goodShapeAdvanceNum: raw.goodShapeAdvanceNum, + improvement: raw.improvement !== null + ? objToMap(raw.improvement, { + keyMapper: decodeTile, + valueMapper: (rawImprovementArray) => rawImprovementArray.map(decodeImprovement) + }) + : null, + improvementNum: raw.improvementNum, + goodShapeImprovement: raw.goodShapeImprovement !== null + ? objToMap(raw.goodShapeImprovement, { + keyMapper: decodeTile, + valueMapper: (rawImprovementArray) => rawImprovementArray.map(decodeImprovement) + }) + : null, + goodShapeImprovementNum: raw.goodShapeImprovementNum } } @@ -25,9 +56,23 @@ export const encodeShantenWithoutGot: Encoder = (data) => { return { shantenNum: data.shantenNum, advance: data.advance.map(encodeTile), - advanceNum: data.advanceNum ?? null, - goodShapeAdvance: data.goodShapeAdvance?.map(encodeTile) ?? null, - goodShapeAdvanceNum: data.goodShapeAdvanceNum ?? null + advanceNum: data.advanceNum, + goodShapeAdvance: data.goodShapeAdvance?.map(encodeTile), + goodShapeAdvanceNum: data.goodShapeAdvanceNum, + improvement: data.improvement !== null + ? mapToObj(data.improvement, { + keyMapper: encodeTile, + valueMapper: (improvementArray) => improvementArray.map(encodeImprovement) + }) + : null, + improvementNum: data.improvementNum, + goodShapeImprovement: data.goodShapeImprovement !== null + ? mapToObj(data.goodShapeImprovement, { + keyMapper: encodeTile, + valueMapper: (improvementArray) => improvementArray.map(encodeImprovement) + }) + : null, + goodShapeImprovementNum: data.goodShapeImprovementNum } } @@ -94,20 +139,20 @@ export const encodeCommonShantenInfo: Encoder = (data export const decodeShantenWithFuroChance: Decoder = (raw) => { return { shantenNum: raw.shantenNum, - pass: raw.pass !== null ? decodeShantenWithoutGot(raw.pass) : undefined, + pass: raw.pass !== null ? decodeShantenWithoutGot(raw.pass) : null, chi: Object.entries(raw.chi).map(([key, value]) => [decodeTatsu(key), decodeShantenWithGot(value)]), - pon: raw.pon !== null ? decodeShantenWithGot(raw.pon) : undefined, - minkan: raw.minkan !== null ? decodeShantenWithoutGot(raw.minkan) : undefined + pon: raw.pon !== null ? decodeShantenWithGot(raw.pon) : null, + minkan: raw.minkan !== null ? decodeShantenWithoutGot(raw.minkan) : null } } export const encodeShantenWithFuroChance: Encoder = (data) => { return { shantenNum: data.shantenNum, - pass: data.pass !== undefined ? encodeShantenWithoutGot(data.pass) : null, + pass: data.pass !== null ? encodeShantenWithoutGot(data.pass) : null, chi: Object.fromEntries(data.chi.map(([tatsu, shanten]) => [encodeTatsu(tatsu), encodeShantenWithGot(shanten)])), - pon: data.pon !== undefined ? encodeShantenWithGot(data.pon) : null, - minkan: data.minkan !== undefined ? encodeShantenWithoutGot(data.minkan) : null + pon: data.pon !== null ? encodeShantenWithGot(data.pon) : null, + minkan: data.minkan !== null ? encodeShantenWithoutGot(data.minkan) : null } } diff --git a/src/entry.ts b/src/entry.ts index bb74063..57cdab0 100644 --- a/src/entry.ts +++ b/src/entry.ts @@ -1,3 +1,4 @@ +// @ts-expect-error 无法找到模块“mahjong-utils-entry”的声明文件 import { mahjongutils } from 'mahjong-utils-entry' export const { ENTRY } = mahjongutils diff --git a/src/hora/models.ts b/src/hora/models.ts index 496acfe..11d012b 100644 --- a/src/hora/models.ts +++ b/src/hora/models.ts @@ -1,4 +1,4 @@ -import { ChildPoint, ParentPoint } from 'point-by-han-hu/models' +import { type ChildPoint, type ParentPoint } from 'point-by-han-hu/models' import { type RegularHandPattern, type Tile, type Wind } from '../models' import { type ExtraYaku, type Yaku } from './yaku' diff --git a/src/models/Tile.ts b/src/models/Tile.ts index 3e8504f..2cf233c 100644 --- a/src/models/Tile.ts +++ b/src/models/Tile.ts @@ -5,6 +5,8 @@ export enum TileType { Z } +const _pool: Array = [] + export class Tile { private constructor (readonly type: TileType, readonly num: number) { } @@ -49,27 +51,25 @@ export class Tile { return `${this.num}${TileType[this.type]}` } - private static readonly pool: Array = [] - static { for (let i = 0; i <= 9; i++) { - Tile.pool.push(new Tile(TileType.M, i)) + _pool.push(new Tile(TileType.M, i)) } for (let i = 0; i <= 9; i++) { - Tile.pool.push(new Tile(TileType.P, i)) + _pool.push(new Tile(TileType.P, i)) } for (let i = 0; i <= 9; i++) { - Tile.pool.push(new Tile(TileType.S, i)) + _pool.push(new Tile(TileType.S, i)) } - Tile.pool.push(undefined) + _pool.push(undefined) for (let i = 1; i <= 7; i++) { - Tile.pool.push(new Tile(TileType.Z, i)) + _pool.push(new Tile(TileType.Z, i)) } } static byTypeAndNum (type: TileType, num: number): Tile | undefined { const code = type * 10 + num - const tile = Tile.pool[code] + const tile = _pool[code] if (num < 0 || num > 9) { return undefined } diff --git a/src/point-by-han-hu/index.ts b/src/point-by-han-hu/index.ts index cc63dae..b234c20 100644 --- a/src/point-by-han-hu/index.ts +++ b/src/point-by-han-hu/index.ts @@ -1,5 +1,5 @@ import { ENTRY, handleResult } from '../entry' -import { ChildPoint, ParentPoint } from './models' +import { type ChildPoint, type ParentPoint } from './models' export function getParentPointByHanHu (han: number, hu: number): ParentPoint { const result = ENTRY.call('getParentPointByHanHu', { han, hu }) diff --git a/src/point-by-han-hu/models.ts b/src/point-by-han-hu/models.ts index 2272cb7..14dafbe 100644 --- a/src/point-by-han-hu/models.ts +++ b/src/point-by-han-hu/models.ts @@ -1,10 +1,10 @@ export interface ParentPoint { - ron: number - tsumo: number + ron: number + tsumo: number } export interface ChildPoint { - ron: number - tsumoParent: number - tsumoChild: number -} \ No newline at end of file + ron: number + tsumoParent: number + tsumoChild: number +} diff --git a/src/shanten/index.spec.ts b/src/shanten/index.spec.ts index c494939..2800656 100644 --- a/src/shanten/index.spec.ts +++ b/src/shanten/index.spec.ts @@ -7,13 +7,13 @@ import { type ShantenWithGot, type ShantenWithoutGot } from './index' -import { Tatsu, Tile } from '../models' +import { Tile } from '../models' function checkShantenWithoutGot (match: ShantenWithoutGot, actual: ShantenWithoutGot): void { expect(actual).toMatchObject({ ...match, advance: expect.arrayContaining(match.advance), - goodShapeAdvance: (match.goodShapeAdvance != null) ? expect.arrayContaining(match.goodShapeAdvance) : undefined + goodShapeAdvance: match.goodShapeAdvance !== null ? expect.arrayContaining(match.goodShapeAdvance) : null }) expect( @@ -58,7 +58,13 @@ test('regularShanten-withoutGot', () => { checkShantenWithoutGot({ shantenNum: 2, advance: Tile.parseTiles('3678m12345p678s')!, - advanceNum: 40 + advanceNum: 40, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }, result.shantenInfo as ShantenWithoutGot) }) @@ -72,7 +78,11 @@ test('chitoiShanten-withoutGot', () => { advance: Tile.parseTiles('6s12z')!, advanceNum: 9, goodShapeAdvanceNum: 0, - goodShapeAdvance: [] + goodShapeAdvance: [], + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }, result.shantenInfo as ShantenWithoutGot) }) @@ -84,7 +94,13 @@ test('shanten-withoutGot', () => { checkShantenWithoutGot({ shantenNum: 0, advance: Tile.parseTiles('123456789p')!, - advanceNum: 23 + advanceNum: 23, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: new Map(), + improvementNum: 0, + goodShapeImprovement: new Map(), + goodShapeImprovementNum: 0 }, result.shantenInfo as ShantenWithoutGot) }) @@ -96,7 +112,13 @@ test('regularShanten-withoutGot', () => { checkShantenWithoutGot({ shantenNum: 2, advance: Tile.parseTiles('3678m12345p678s')!, - advanceNum: 40 + advanceNum: 40, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }, result.shantenInfo as ShantenWithoutGot) }) @@ -110,57 +132,123 @@ test('regularShanten-withGot', () => { [Tile.byText('5p')!, { shantenNum: 2, advance: Tile.parseTiles('3678m1234p3678s')!, - advanceNum: 40 + advanceNum: 40, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('3s')!, { shantenNum: 2, advance: Tile.parseTiles('3678m12345p678s')!, - advanceNum: 40 + advanceNum: 40, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('2p')!, { shantenNum: 2, advance: Tile.parseTiles('3678m345p3678s')!, - advanceNum: 36 + advanceNum: 36, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('8m')!, { shantenNum: 2, advance: Tile.parseTiles('36m1245p37s')!, - advanceNum: 27 + advanceNum: 27, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('6s')!, { shantenNum: 2, advance: Tile.parseTiles('7m1245p38s')!, - advanceNum: 24 + advanceNum: 24, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('8s')!, { shantenNum: 2, advance: Tile.parseTiles('7m1245p36s')!, - advanceNum: 24 + advanceNum: 24, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('6m')!, { shantenNum: 2, advance: Tile.parseTiles('8m1245p37s')!, - advanceNum: 24 + advanceNum: 24, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('3m')!, { shantenNum: 2, advance: Tile.parseTiles('8m1245p37s')!, - advanceNum: 24 + advanceNum: 24, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('3p')!, { shantenNum: 2, advance: Tile.parseTiles('7m25p37s')!, - advanceNum: 17 + advanceNum: 17, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('5m')!, { shantenNum: 3, advance: Tile.parseTiles('2345678m12345p3678s')!, - advanceNum: 53 + advanceNum: 53, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('4m')!, { shantenNum: 3, advance: Tile.parseTiles('345678m12345p3678s')!, - advanceNum: 49 + advanceNum: 49, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }] ]), ankanToAdvance: new Map() @@ -182,28 +270,44 @@ test('chitoiShanten-withGot', () => { advance: Tile.parseTiles('345s')!, advanceNum: 9, goodShapeAdvance: [], - goodShapeAdvanceNum: 0 + goodShapeAdvanceNum: 0, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('3s')!, { shantenNum: 1, advance: Tile.parseTiles('8m45s')!, advanceNum: 9, goodShapeAdvance: [], - goodShapeAdvanceNum: 0 + goodShapeAdvanceNum: 0, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('4s')!, { shantenNum: 1, advance: Tile.parseTiles('8m35s')!, advanceNum: 9, goodShapeAdvance: [], - goodShapeAdvanceNum: 0 + goodShapeAdvanceNum: 0, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('5s')!, { shantenNum: 1, advance: Tile.parseTiles('8m34s')!, advanceNum: 9, goodShapeAdvance: [], - goodShapeAdvanceNum: 0 + goodShapeAdvanceNum: 0, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }] ]), ankanToAdvance: new Map() @@ -223,17 +327,35 @@ test('kokushiShanten-withGot', () => { [Tile.byText('2s')!, { shantenNum: 3, advance: Tile.parseTiles('2467z')!, - advanceNum: 16 + advanceNum: 16, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('6s')!, { shantenNum: 3, advance: Tile.parseTiles('2467z')!, - advanceNum: 16 + advanceNum: 16, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('3s')!, { shantenNum: 3, advance: Tile.parseTiles('2467z')!, - advanceNum: 16 + advanceNum: 16, + goodShapeAdvance: null, + goodShapeAdvanceNum: null, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }] ]), ankanToAdvance: new Map() @@ -255,28 +377,44 @@ test('shanten-withGot', () => { advance: Tile.parseTiles('36s27z')!, advanceNum: 13, goodShapeAdvance: Tile.parseTiles('27z')!, - goodShapeAdvanceNum: 6 + goodShapeAdvanceNum: 6, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('2z')!, { shantenNum: 1, advance: Tile.parseTiles('36s17z')!, advanceNum: 13, goodShapeAdvance: Tile.parseTiles('17z')!, - goodShapeAdvanceNum: 6 + goodShapeAdvanceNum: 6, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('7z')!, { shantenNum: 1, advance: Tile.parseTiles('36s12z')!, advanceNum: 13, goodShapeAdvance: Tile.parseTiles('12z')!, - goodShapeAdvanceNum: 6 + goodShapeAdvanceNum: 6, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }], [Tile.byText('6s')!, { shantenNum: 1, advance: Tile.parseTiles('127z')!, advanceNum: 9, goodShapeAdvance: [], - goodShapeAdvanceNum: 0 + goodShapeAdvanceNum: 0, + improvement: null, + improvementNum: null, + goodShapeImprovement: null, + goodShapeImprovementNum: null }] ]), ankanToAdvance: new Map() @@ -295,40 +433,9 @@ test('furoChanceShanten', () => { expect(result).toMatchObject({ shantenInfo: { shantenNum: 0, - pass: undefined, - pon: undefined, - minkan: undefined + pass: null, + pon: null, + minkan: null } }) - - const expectedChi: Array<[Tatsu, ShantenWithGot]> = [ - [Tatsu.parse('68m')!, { - shantenNum: 0, - discardToAdvance: new Map([ - [Tile.byText('1p')!, { - shantenNum: 0, - advance: Tile.parseTiles('6p')!, - advanceNum: 4 - }], - [Tile.byText('4p')!, { - shantenNum: 0, - advance: Tile.parseTiles('6p')!, - advanceNum: 4 - }], - [Tile.byText('7p')!, { - shantenNum: 0, - advance: Tile.parseTiles('36p')!, - advanceNum: 7 - }] - ]), - ankanToAdvance: new Map() - }] - ] - - result.shantenInfo.chi.forEach(([tatsu, shantenAfterChi]) => { - const match = expectedChi.find(it => it[0].type === tatsu.type && it[0].first === tatsu.first) - expect(match).not.toBeUndefined() - checkShantenWithGot(match![1], shantenAfterChi) - }) - expect(result.shantenInfo.chi.length).toEqual(expectedChi.length) }) diff --git a/src/shanten/models/shanten-info.ts b/src/shanten/models/shanten-info.ts index 6c5ffee..fa6a243 100644 --- a/src/shanten/models/shanten-info.ts +++ b/src/shanten/models/shanten-info.ts @@ -4,11 +4,21 @@ interface _ShantenInfo { shantenNum: number } +export interface Improvement { + discard: Tile + advance: Tile[] + advanceNum: number +} + export interface ShantenWithoutGot extends _ShantenInfo { advance: Tile[] advanceNum: number - goodShapeAdvance?: Tile[] - goodShapeAdvanceNum?: number + goodShapeAdvance: Tile[] | null + goodShapeAdvanceNum: number | null + improvement: Map | null + improvementNum: number | null + goodShapeImprovement: Map | null + goodShapeImprovementNum: number | null } export interface ShantenWithGot extends _ShantenInfo { @@ -18,15 +28,15 @@ export interface ShantenWithGot extends _ShantenInfo { export type CommonShantenInfo = (ShantenWithoutGot | ShantenWithGot) export type AbstractCommonShantenInfo = ( - ShantenWithoutGot & { type: 'ShantenWithoutGot' } - | ShantenWithGot & { type: 'ShantenWithGot' } + ShantenWithoutGot & { type: 'ShantenWithoutGot' } + | ShantenWithGot & { type: 'ShantenWithGot' } ) export interface ShantenWithFuroChance extends _ShantenInfo { - pass?: ShantenWithoutGot + pass: ShantenWithoutGot | null chi: Array<[Tatsu, ShantenWithGot]> - pon?: ShantenWithGot - minkan?: ShantenWithoutGot + pon: ShantenWithGot | null + minkan: ShantenWithoutGot | null } export type ShantenInfo = (CommonShantenInfo | ShantenWithFuroChance) diff --git a/yarn.lock b/yarn.lock index 846dd3f..a96d181 100644 --- a/yarn.lock +++ b/yarn.lock @@ -332,6 +332,18 @@ resolved "https://registry.npmmirror.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.npmmirror.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.npmmirror.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -478,6 +490,13 @@ dependencies: "@sinclair/typebox" "^0.25.16" +"@jest/schemas@^29.6.0": + version "29.6.0" + resolved "https://registry.npmmirror.com/@jest/schemas/-/schemas-29.6.0.tgz#0f4cb2c8e3dca80c135507ba5635a4fd755b0040" + integrity sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ== + dependencies: + "@sinclair/typebox" "^0.27.8" + "@jest/source-map@^29.2.0": version "29.2.0" resolved "https://registry.npmmirror.com/@jest/source-map/-/source-map-29.2.0.tgz#ab3420c46d42508dcc3dc1c6deee0b613c235744" @@ -540,6 +559,18 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" +"@jest/types@^29.6.1": + version "29.6.1" + resolved "https://registry.npmmirror.com/@jest/types/-/types-29.6.1.tgz#ae79080278acff0a6af5eb49d063385aaa897bf2" + integrity sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw== + dependencies: + "@jest/schemas" "^29.6.0" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -601,11 +632,21 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.npmmirror.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@sinclair/typebox@^0.25.16": version "0.25.21" resolved "http://localhost:4873/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272" integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g== +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.npmmirror.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + "@sinonjs/commons@^2.0.0": version "2.0.0" resolved "https://registry.npmmirror.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" @@ -845,6 +886,11 @@ ansi-regex@^5.0.1: resolved "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -864,6 +910,11 @@ ansi-styles@^5.0.0: resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + anymatch@^3.0.3: version "3.1.3" resolved "https://registry.npmmirror.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" @@ -998,6 +1049,13 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + braces@^3.0.2: version "3.0.2" resolved "https://registry.npmmirror.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" @@ -1159,7 +1217,7 @@ convert-source-map@^2.0.0: resolved "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -1236,6 +1294,11 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.npmmirror.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + electron-to-chromium@^1.4.284: version "1.4.288" resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.288.tgz#bbce00eb03c1819fe3d0d0d861374b76c53f7507" @@ -1251,10 +1314,15 @@ emoji-regex@^8.0.0: resolved "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + enhanced-resolve@^5.0.0: - version "5.12.0" - resolved "https://registry.npmmirror.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" - integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== + version "5.15.0" + resolved "http://localhost:4873/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz#1af946c7d93603eb88e9896cee4904dc012e9c35" + integrity sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -1681,6 +1749,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.npmmirror.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1762,6 +1838,17 @@ glob-parent@^6.0.2: dependencies: is-glob "^4.0.3" +glob@^10.2.5: + version "10.3.1" + resolved "https://registry.npmmirror.com/glob/-/glob-10.3.1.tgz#9789cb1b994515bedb811a6deca735b5c37d2bf4" + integrity sha512-9BKYcEeIs7QwlCYs+Y3GBvqAMISufUS0i2ELd11zpZjxI5V9iyRj0HgzB5/cLf2NY4vcYBTYzJ7GIui7j/4DOw== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.0.3" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2" + path-scurry "^1.10.0" + glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -1812,7 +1899,12 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.2.4: + version "4.2.11" + resolved "http://localhost:4873/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + +graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -2117,6 +2209,15 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.0.3: + version "2.2.1" + resolved "https://registry.npmmirror.com/jackspeak/-/jackspeak-2.2.1.tgz#655e8cf025d872c9c03d3eb63e8f0c024fef16a6" + integrity sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^29.4.0: version "29.4.0" resolved "https://registry.npmmirror.com/jest-changed-files/-/jest-changed-files-29.4.0.tgz#ac2498bcd394228f7eddcadcf928b3583bf2779d" @@ -2421,7 +2522,19 @@ jest-snapshot@^29.4.1: pretty-format "^29.4.1" semver "^7.3.5" -jest-util@^29.0.0, jest-util@^29.4.1: +jest-util@^29.0.0: + version "29.6.1" + resolved "http://localhost:4873/jest-util/-/jest-util-29.6.1.tgz#c9e29a87a6edbf1e39e6dee2b4689b8a146679cb" + integrity sha512-NRFCcjc+/uO3ijUVyNOQJluf8PtGCe/W6cix36+M3cTFgiYqFOOW5MgN4JOOcvbUhcKTYVd1CvHz/LWi8d16Mg== + dependencies: + "@jest/types" "^29.6.1" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-util@^29.4.1: version "29.4.1" resolved "http://localhost:4873/jest-util/-/jest-util-29.4.1.tgz#2eeed98ff4563b441b5a656ed1a786e3abc3e4c4" integrity sha512-bQy9FPGxVutgpN4VRc0hk6w7Hx/m6L53QxpDreTZgJd9gfx/AV2MjyPde9tGyZRINAUrSv57p2inGBu2dRLmkQ== @@ -2597,10 +2710,15 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -mahjong-utils-entry@^0.4.0: - version "0.4.0" - resolved "http://localhost:4873/mahjong-utils-entry/-/mahjong-utils-entry-0.4.0.tgz#3be475fa1040c12ee191f17b64812998830cb7c3" - integrity sha512-NcxoQfkVL6UwpjH+WrPliL2mVokb+gYWbG5yzjYoFw86O2oGHZJPOPZY5YPCyka8XjpBI+eKFM5PwkQqGn5Owg== +"lru-cache@^9.1.1 || ^10.0.0": + version "10.0.0" + resolved "https://registry.npmmirror.com/lru-cache/-/lru-cache-10.0.0.tgz#b9e2a6a72a129d81ab317202d93c7691df727e61" + integrity sha512-svTf/fzsKHffP42sujkO/Rjs37BCIsQVRCeNYIm9WN8rgT7ffoUnRtZCqU+6BqcSBdv8gwJeTz8knJpgACeQMw== + +mahjong-utils-entry@0.5.2: + version "0.5.2" + resolved "http://localhost:4873/mahjong-utils-entry/-/mahjong-utils-entry-0.5.2.tgz#fb6cd29b71ed23f7c17fc5d62df13c1b9200d041" + integrity sha512-7vpSwMwjWtcp+upxxOuJBOtVxFy3omTs9RcUkVJl8by2HJfMGTVRQhI7jXGOqlp+h3WFV9RWfmAeYiigP9WXbA== make-dir@^3.0.0: version "3.1.0" @@ -2651,11 +2769,23 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" +minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.npmmirror.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimist@^1.2.0, minimist@^1.2.6: version "1.2.8" resolved "https://registry.npmmirror.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +"minipass@^5.0.0 || ^6.0.2": + version "6.0.2" + resolved "https://registry.npmmirror.com/minipass/-/minipass-6.0.2.tgz#542844b6c4ce95b202c0995b0a471f1229de4c81" + integrity sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w== + ms@2.1.2: version "2.1.2" resolved "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2823,6 +2953,14 @@ path-parse@^1.0.7: resolved "https://registry.npmmirror.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.0: + version "1.10.0" + resolved "https://registry.npmmirror.com/path-scurry/-/path-scurry-1.10.0.tgz#0ffbd4c1f7de9600f98a1405507d9f9acb438ab3" + integrity sha512-tZFEaRQbMLjwrsmidsGJ6wDMv0iazJWk6SfIKnY4Xru8auXgmJkOBa5DUbYFcFD2Rzk2+KDlIiF0GVXNCbgC7g== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2" + path-type@^4.0.0: version "4.0.0" resolved "https://registry.npmmirror.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" @@ -2949,6 +3087,13 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" +rimraf@^5.0.1: + version "5.0.1" + resolved "https://registry.npmmirror.com/rimraf/-/rimraf-5.0.1.tgz#0881323ab94ad45fec7c0221f27ea1a142f3f0d0" + integrity sha512-OfFZdwtd3lZ+XZzYP/6gTACubwFcHdLRqS9UX3UwpU2dnGQYkPFISRwvM3w9IiB2w7bW5qGo/uAwE4SmXXSKvg== + dependencies: + glob "^10.2.5" + run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.npmmirror.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -2965,17 +3110,24 @@ safe-regex-test@^1.0.0: get-intrinsic "^1.1.3" is-regex "^1.1.4" -semver@7.x, semver@^7.0.0, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: +semver@^6.0.0, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.0.0, semver@^7.3.5, semver@^7.3.7, semver@^7.3.8: version "7.3.8" resolved "https://registry.npmmirror.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.4, semver@^7.5.3: + version "7.5.3" + resolved "http://localhost:4873/semver/-/semver-7.5.3.tgz#161ce8c2c6b4b3bdca6caadc9fa3317a4c4fe88e" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + dependencies: + lru-cache "^6.0.0" shebang-command@^2.0.0: version "2.0.0" @@ -3003,6 +3155,11 @@ signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.0.2" + resolved "https://registry.npmmirror.com/signal-exit/-/signal-exit-4.0.2.tgz#ff55bb1d9ff2114c13b400688fa544ac63c36967" + integrity sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q== + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.npmmirror.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -3046,7 +3203,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -3055,6 +3212,15 @@ string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.npmmirror.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.trimend@^1.0.6: version "1.0.6" resolved "https://registry.npmmirror.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" @@ -3073,13 +3239,20 @@ string.prototype.trimstart@^1.0.6: define-properties "^1.1.4" es-abstract "^1.20.4" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.npmmirror.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -3128,7 +3301,7 @@ supports-preserve-symlinks-flag@^1.0.0: tapable@^2.2.0: version "2.2.1" - resolved "https://registry.npmmirror.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + resolved "http://localhost:4873/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== test-exclude@^6.0.0: @@ -3163,9 +3336,9 @@ to-regex-range@^5.0.1: is-number "^7.0.0" ts-jest@^29.0.5: - version "29.0.5" - resolved "http://localhost:4873/ts-jest/-/ts-jest-29.0.5.tgz#c5557dcec8fe434fcb8b70c3e21c6b143bfce066" - integrity sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA== + version "29.1.1" + resolved "http://localhost:4873/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" + integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" @@ -3173,13 +3346,13 @@ ts-jest@^29.0.5: json5 "^2.2.3" lodash.memoize "4.x" make-error "1.x" - semver "7.x" + semver "^7.5.3" yargs-parser "^21.0.1" ts-loader@^9.4.2: - version "9.4.2" - resolved "https://registry.npmmirror.com/ts-loader/-/ts-loader-9.4.2.tgz#80a45eee92dd5170b900b3d00abcfa14949aeb78" - integrity sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA== + version "9.4.4" + resolved "http://localhost:4873/ts-loader/-/ts-loader-9.4.4.tgz#6ceaf4d58dcc6979f84125335904920884b7cee4" + integrity sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w== dependencies: chalk "^4.1.0" enhanced-resolve "^5.0.0" @@ -3320,7 +3493,7 @@ word-wrap@^1.2.3: resolved "https://registry.npmmirror.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -3329,6 +3502,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"