mogged
v0.1.0
Published
Tiny, extremely fast score-comparison utilities.
Maintainers
Readme
mogged
Tiny, extremely fast score-comparison utilities.
mogged is a lightweight TypeScript library for checking whether one score is decisively outclassed ("mogged") by another score.
Install
bun add moggedUsage
import { isMogged, mog, mogMany } from "mogged";
isMogged(95, 100); // true
mog(95, 100); // { mogged: true, gap: 5 }
mogMany([75, 110, 99], 100); // Uint8Array([1, 0, 1])API
mogDiff(subjectScore, opponentScore): numberisMogged(subjectScore, opponentScore, threshold?): booleanmog(subjectScore, opponentScore, threshold?): { mogged: boolean; gap: number }mogMany(subjectScores, opponentScore, threshold?): Uint8Array
Development
bun install
bun run typecheck
bun test
bun run build
bun run benchPublish To npm
- Authenticate once:
bunx npm login - Set token in your shell:
setx NPM_TOKEN "your_token_here"(new terminal required) - Update package version:
bunx npm version patch(orminor/major) - Build and verify:
bun run build && bun test - Dry run package:
bunx npm pack --dry-run - Publish:
bunx npm publish --access public
Notes
.npmrcis configured to useNPM_TOKENfor secure publishing.- Output includes ESM, CJS, and TypeScript declarations in
dist/.
