-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from horita-yuya/feature/npm
NPM Publish
- Loading branch information
Showing
4 changed files
with
45 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# mahjong-kun | ||
|
||
```shell | ||
npm install mahjong-kun | ||
``` | ||
|
||
麻雀の点数計算君 | ||
|
||
```typescript | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1 @@ | ||
import type { | ||
Calculate, | ||
Hand, | ||
HuAll, | ||
WinningStyle, | ||
YakuAll, | ||
YakuChitoitsu, | ||
YakuPinhu, | ||
} from "./types"; | ||
import type { Position } from "./types/field"; | ||
|
||
export type MahjongKun< | ||
HAND extends Hand, | ||
WINNING extends HAND[number], | ||
NAKI extends HAND[number][], | ||
STYLE extends WinningStyle, | ||
POSITION extends Position, | ||
> = Calculate< | ||
YakuAll<HAND, WINNING, NAKI>, | ||
HuAll<HAND, WINNING, NAKI, STYLE>, | ||
STYLE, | ||
POSITION, | ||
YakuChitoitsu<HAND, WINNING> extends [1, 1] | ||
? "chitoitsu" | ||
: STYLE extends "tumo" | ||
? YakuPinhu<HAND, WINNING, NAKI> extends [1] | ||
? "pin-tumo" | ||
: null | ||
: null | ||
>; | ||
export * from "./types" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,25 @@ | ||
{ | ||
"name": "mahjong-kun", | ||
"version": "1.0.0", | ||
"main": "index.ts", | ||
"version": "1.5.0", | ||
"author": "[email protected]", | ||
"license": "MIT", | ||
"files": ["dist", "package.json", "README.md"], | ||
"scripts": { | ||
"test": "tsc --noEmit", | ||
"build": "tsc ./index.ts --declaration --outDir ./dist --emitDeclarationOnly" | ||
"build": "tsc ./index.ts --declaration --outDir ./dist --emitDeclarationOnly", | ||
"pub": "yarn build && npm publish --access public" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.9.4", | ||
"esbuild": "^0.24.0", | ||
"typescript": "^5.6.3" | ||
} | ||
}, | ||
"exports": { | ||
".": { | ||
"import": { | ||
"types": "./dist/index.d.ts" | ||
} | ||
} | ||
}, | ||
"types": "./dist/index.d.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters