open-index/open-npm huggingface dataset:
npm package: @pokepay/pokepay-partner-sdk
Description: Pokepay Partner SDK for NodeJS
Author: dev@pokepay.jp
Latest version: 1.4.15

# Pokepay Partner SDK for NodeJS

### How to test it
```
$ npm install
$ npm run dev -- config.ini
```

To run full tests, put settings and testdata to `~/.pokepay/test-config.ini`. then,

```
$ npm run test
```

test-confg.ini is like below inifile.

```
CLIENT_ID        = xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
CLIENT_SECRET    = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
API_BASE_URL     = https://partnerapi-dev.pokepay.jp
SSL_KEY_FILE     = /path/to/key.pem
SSL_CERT_FILE    = /path/to/cert.pem

TIMEZONE         = Asia/Tokyo
CONNECTTIMEOUT   = 10
TIMEOUT          = 10
MAX_RETRIES      = 0

[testdata]
shop_id = zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz
customer_id = wwwwwwww-wwww-wwww-wwww-wwwwwwwwwwww
private_money_id = vvvvvvvv-vvvv-vvvv-vvvv-vvvvvvvvvvvv
```

### Minimum supported Node LTS
- Node v8.17.0 (LTS)

### How to use
- [Document](https://github.com/pokepay/pokepay-partner-node-sdk/blob/main/docs/index.md)
npm package: @poker-apprentice/hand-range-notation
Description: Convert poker hand range notation to and from poker hands
Author: Matt Huggins
Latest version: 1.0.0

# Hand Range Notation

Convert poker hand range notation to and from actual poker hands.

## Installation

Add `@poker-apprentice/hand-range-notation` as a dependency.

- yarn:
  ```bash
  yarn add @poker-apprentice/hand-range-notation
  ```
- npm:
  ```bash
  npm install @poker-apprentice/hand-range-notation --save
  ```

## Usage

### `expandNotation`

This function is used to parse a string representing a [hand range notation](https://betandbeat.com/poker/terminology/hand-range-notation/). If a hand range notation cannot be parsed, it will throw an `InvalidHandRangeNotationError`.

```ts
// specific suited hands
const hands = expandNotation('AKs');
console.log(hands); // [['As', 'Ks'], ['Ah', 'Kh'], ['Ad', 'Kd'], ['Ac', 'Kc']]

// specific unsuited hands
const hands = expandNotation('AKo');
console.log(hands); // [['As', 'Kh'], ['As', 'Kd'], ['As', 'Kc'], /* ... */]

// specific hands regardless of suitedness
const hands = expandNotation('AK');
console.log(hands); // [['As', 'Ks'], ['As', 'Kh'], ['As', 'Kd'], /* ... */]

// specific hands with specific suits
const hands = expandNotation('AcKd');
console.log(hands); // [['Ac', 'Kd']]

// pocket pairs
const hands = expandNotation('TT');
console.log(hands); // [['Ts', 'Th'], ['Ts', 'Td'], ['Ts', 'Tc'], /* ... */]

// hand ranges
const hands = expandNotation('AKs-A2s');
const hands = expandNotation('KQo-KJo');
const hands = expandNotation('AK-AT');
const hands = expandNotation('99-22');

// hand minimums
const hands = expandNotation('AT+');
const hands = expandNotation('ATs+');
const hands = expandNotation('TT+');

// multiple ranges
const hands = expandNotation('ATs+, 99-22, AA, KQ, KJs, AcTd');
```

### `notate`

This function is used to generate a [hand range notation](https://betandbeat.com/poker/terminology/hand-range-notation/) string representing a collection of hands.

Only two-card Texas Hold'em hands are supported. Providing hands of any other length will result in an `InvalidHandError` being thrown.

```ts
const notation = notate([
  ['As', 'Ks'],
  ['Ah', 'Kh'],
  ['Ad', 'Kd'],
  ['Ac', 'Kc'],
  ['As', 'Qs'],
  ['Ah', 'Qh'],
  ['Ad', 'Qd'],
  ['Ac', 'Qc'],
  ['Js', 'Jh'],
  ['Js', 'Jd'],
  ['Js', 'Jc'],
  ['Jh', 'Jd'],
  ['Jh', 'Jc'],
  ['Jd', 'Jc'],
  ['Ts', 'Th'],
  ['Ts', 'Td'],
  ['Ts', 'Tc'],
  ['Th', 'Td'],
  ['Th', 'Tc'],
  ['Td', 'Tc'],
]);
console.log(notation); // 'JJ-TT,AQs+'
```

### `normalizeNotation`

This function converts the provided notation into a predictable/deterministic format.

```ts
const notation = normalizeNotation('AKs,TT,QAo,AA'));
console.log(notation); // 'AA,TT,AKs,AQo'

const hands = expandNotation('7d2c,3h2s,KQo,AQo,AKo,ATs+,TT+,A2s-A5s');
const notation = notate(hands);
console.log(notation); // 'TT+,ATs+,A5s-A2s,AQo+,KQo,7d2c,3h2s'
```
npm package: @poker-apprentice/typed-event-emitter
Description: Strictly typed Node.js event emitter for TypeScript
Author: Matt Huggins
Latest version: 1.0.2

# `@poker-apprentice/typed-event-emitter`

Strictly typed Node.js event emitter for TypeScript.

## Motivation

The built-in `EventEmitter` class in Node.js is useful for notifying other parts of an application that an event has taken place.  However, events can be emitted using any name whether or not that event is intended to be active listeners.  This means that a simple typo in an event name (e.g.: "import" instead of "imported") could result in an event being emitted that a listener is mistakenly not configured to receive.

By providing strict type validation corresponding to the function signature that is intended for listener associated with that event type, we can help ensure that our events being emitted are being received by their intended targets.

## Getting Started

### Installation

```bash
yarn add @poker-apprentice/typed-event-emitter
```

### Usage

Given an emitter defined as follows:

```ts
import { TypedEventEmitter } from '@poker-apprentice/typed-event-emitter';

interface MyEvents {
  message: (event: { username: string; body: string }) => void;
  ping: () => void;
  add: (a: number, b: number) => void
}

const emitter = new TypedEventEmitter<MyEvents>;
```

Listeners could be registered, and events could be emitted, via the following:

```ts
// VALID listeners:
emitter.on('message', ({ username, body }) => {
  // `username` and `body` are both inferred as type `string`
  console.log(`${username}: ${body}`);
});

emitter.on('ping', () => {
  console.log('pong');
});

emitter.on('add', (a, b) => {
  // `a` and `b` are both inferred as type `number`
  console.log(a + b);
});

// VALID emitted events:
emitter.emit('message', { username: 'Joe', body: 'Hi there!' });
emitter.emit('ping');
emitter.emit('add', 5, 10);
```

However, trying to register listeners or emit events with types that do not match the structure previously defined in the `MyEvents` type included above for demonstration purposed would result in type errors:

```ts
// INVALID listeners:
emitter.on('message', ({ from, subject, body }) => {});
emitter.on('ping', (timestamp) => {});
emitter.on('add', (numbers) => {});

// INVALID emitted events:
emitter.emit('message', 'Hi there!');
emitter.emit('ping', 20);
emitter.emit('add', '5', '10');
emitter.emit('not-a-legitimate-key-in-MyEvents');
```