open-index/open-npm huggingface dataset:
npm package: @johuang/texas
Description: Texas Hold'em hand evaluator for Node.js.
Author: André Costa
Latest version: 0.4.1

# texas

Texas is a library to provide 5 to 7 card hands evaluation for Texas Hold'em on Node.js.
It uses the look-up table method created by users of the
[Two Plus Two forum](https://web.archive.org/web/20121115021606/http://archives1.twoplustwo.com/showflat.php?Cat=0&Number=8513906&page=0&fpart=all&vc=1).

## Installing

```
npm install texas
```

## Using

### Evaluator

The following example generates a random hand and evaluates it:

```javascript
import _ from 'lodash';
import * as texas from 'texas';

const hand = _.first(texas.deck(), 7);
console.log(_.map(hand, texas.abbr));
console.log(texas.evaluate(hand));
```

Which will output something like:

```
[ '5h', '3s', '4d', '7s', '5d', 'Jd', '6d' ]
{ name: 'Straight', value: 20483 }
```

### Odds

The following example calculates the odds of a 2-player game after the flop:

```javascript
import * as texas from 'texas';

const odds = texas.odds(
  [
    ['As', 'Ac'],
    ['Ks', 'Qc'],
  ],
  ['3d', 'Qc', 'Kd'],
);
console.log(odds);
```

Which will output something like:

```
[ { win: 0.2608695652173913, split: 0 },
  { win: 0.7391304347826086, split: 0 } ]
```

## Formats

### Extended

```
> texas.extended(3)
'Two of Hearts'
```

### Abbreviated

```
> texas.abbr(15)
'5h'
```

### Unicode

```
> texas.unicode(42)
'Q♦'
```

## Benchmark

A benchmark function is included in the library. It evaluates every possible 7 card hands.

```
> texas.benchmark()
Invalid: 0
High Card: 23294460
One Pair: 58627800
Two Pairs: 31433400
Three of a Kind: 6461620
Straight: 6180020
Flush: 4047644
Full House: 3473184
Four of a Kind: 224848
Straight Flush: 41584
Total: 133784560
891ms // On a Mid 2011 13" MacBook Air
```
npm package: @johv/immutable-extras
Description: Small utility library for use with Immutable.js
Author: Jonas Hvid
Latest version: 1.1.1

# Immutable Extras

[![NPM version badge](https://img.shields.io/npm/v/@johv/immutable-extras)](https://www.npmjs.com/package/@johv/immutable-extras)

This is just a small library with some extensions for [Immutable.js](https://immutable-js.github.io/immutable-js/). I don't really expect this to be useful for anyone other than myself.

See the source code in `src/index.ts` for API and documentation.
npm package: @johv/miscjs
Description: Library of miscellaneous utility functions
Author: Jonas Hvid
Latest version: 1.9.0

# Misc.js

[![NPM version badge](https://img.shields.io/npm/v/@johv/miscjs)](https://www.npmjs.com/package/@johv/miscjs)

This is just a small library with various utility functions that I use for some of my personal projects, such as [Thinktool](https://github.com/c2d7fa/thinktool).

See the source code in `src/index.ts` for API and documentation.
npm package: @johv/sass-labmix
Description: Pure-Sass color mixing in Lab, LCh and related color spaces
Latest version: 1.0.1

# `@johv/sass-labmix`

This pure-Sass library provides an alternative to some of the features that will be added in [CSS Color Module Level 5](https://www.w3.org/TR/css-color-5/), namely `mix` as an alternative to `color-mix()` and support for Lab and LCh color spaces through the `lab` and `lch` functions.

When these functions become commonly available through CSS, this library will be deprecated. See the *Alternatives* section below for more information.

The library is a fork of Tobias Bengfort's [sass-planifolia](https://github.com/xi/sass-planifolia/). The aim of this fork is to strip it down to just the color-manipulation functions and bring it up to date with the current version of Sass. Read [this pull request](https://github.com/xi/sass-planifolia/pull/6) to understand why this fork exists.

See the [full documentation](https://c2d7fa.github.io/sass-labmix/) for more details.

## Quick start

Install the library:

    npm install --save-dev @johv/sass-labmix

Import it in your Sass files (most bundlers support the tilde-syntax; otherwise use `node_modules/@johv/sass-labmix` explicitly):

```scss
@use "~@johv/sass-labmix" as labmix;

.test {
    background-color: red;

    // pick between two colors (default: black and white) to get good contrast
    color: labmix.contrast-color(red);

    // mix orange with black or white to get good contrast to red
    border-color: labmix.contrast-stretch(red, orange);

    // mix red with black in a perceptually uniform color space
    box-shadow: 0 0 1em labmix.shade(red, 0.5, 'lab');
}
```

## Alternatives

- [CSS Color Module Level 5](https://www.w3.org/TR/css-color-5/) will provide native support for Lab and related color spaces and will support color mixing with `colox-mix()`. However, as of May 2022, it is not yet widely available.
- [Parcel's CSS transformer](https://github.com/parcel-bundler/parcel-css) implements some of the functionality of CSS Color Module Level 5, including `color-mix()` and `lch()`. If you're already using Parcel, just use that instead!
- [PostCSS](https://postcss.org/) supports Lab and related color spaces through [postcss-preset-env](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env), but [as of May 2022, it does not support `color-mix()`](https://github.com/csstools/postcss-plugins/issues/177).
- This library is a fork of [sass-planifolia](https://github.com/xi/sass-planifolia/). This fork has less functionality, but aims to be compatible with Dart Sass (without triggering any deprecation warnings). Changes made here may or may not be upstreamed into Planifolia in the future.
- [oddbird/blend](https://github.com/oddbird/blend) also provides early access to some of the functionality of the CSS Color Module Level 5 features, but unless I'm missing something, there is no equivalent of `mix`.
npm package: @joi-extensions/joi-extensions
Description: Joi extensions
Latest version: 1.2.0

<h1 align="center">
	<img width="320" src="media/logo.jpeg" alt="Joi extensions">
	<br>
	<br>
</h1>

Extensions for Joi validator.

[![Build Status](https://travis-ci.org/joi-extensions/joi-extensions.svg?branch=master)](https://travis-ci.org/joi-extensions/joi-extensions.svg?branch=master)
[![npm](https://img.shields.io/npm/v/@joi-extensions/joi-extensions.svg)](https://www.npmjs.com/package/@joi-extensions/joi-extensions) 
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/AlbertHambardzumyan/fraction-js/master/LICENSE)
[![GitHub issues](https://img.shields.io/github/issues/joi-extensions/joi-extensions.svg)](https://github.com/joi-extensions/joi-extensions/issues)

# Installation 
```bash
 npm install @joi-extensions/joi-extensions
```

# Usage

Usage is a two steps process. First, a schema is constructed using the provided types and constraints:

```js
const BaseJoi = require('joi')
const {AnyExtensions} = require('@joi-extensions/joi-extensions')
const Joi = BaseJoi.extend(AnyExtensions)

const schema = Joi.any().sizeof(20)
````

```js
const BaseJoi = require('joi')
const {StringExtensions} = require('@joi-extensions/joi-extensions')
const Joi = BaseJoi.extend(StringExtensions)

const schema = Joi.string().objectId()
````

```js
const BaseJoi = require('joi')
const {ArrayExtensions} = require('@joi-extensions/joi-extensions')
const Joi = BaseJoi.extend(ArrayExtensions)

const schema = Joi.array().even()
````

# API
See the detailed [API Reference](API.md).
npm package: @joi-tools/translator
Description: Translated messages from Joi validation errors
Author: Jesús Jimenez Tapia
Latest version: 0.1.0

<center>

![NPM License](https://img.shields.io/npm/l/%40joi-tools%2Ftranslator)
![npm](https://img.shields.io/npm/v/@joi-tools%2Ftranslator)
<a href="https://github.com/jesusjimeneztapia" rel="nofollow"><img src="https://img.shields.io/badge/created%20by-jesusjimeneztapia-6d28d9?logo=github" alt="Created by Colin McDonnell"></a>

</center>

# Translation for Joi

Translated messages from [Joi](https://joi.dev/) validation errors. Base on the Portuguese translated package [joi-translation-pt-br](https://www.npmjs.com/package/joi-translation-pt-br).

## Install

It should be noted that this package is not a replacement for the Joi package, on the contrary, it is a complement to it. So, have Joi installed in the app.

Use the following command for installation:

```
npm install @joi-tools/translator
```

> Please note that this package supports Joi versions between 17.4.0 and 17.13.3

## Supported languages

| Language | Key |         |
| -------- | :-: | :-----: |
| English  | en  | default |
| Español  | es  |         |

## Examples of use

### Validating with schema

Validating the Joi schema by creating its validation options with the language.

```js
import Joi from 'joi'
import { createValidationOptions } from '@joi-tools/translator'

const loginSchema = Joi.object({
  username: joi.string().required(),
  password: joi.string().required().min(8),
})

const language = 'es'
const data = { username: 'someone', password: '123' }

const { error } = loginSchema.validate(data, createValidationOptions(language))

if (error) {
  console.log(error.details)
}
```

The function `createValidationOptions` receives the `language` as the first parameter, the language can be one of the languages ​​supported in this package, and as the second parameter it receives the Joi validation options.

### Specify translated messages

You can also pass translated messages to Joi validation.

```js
import Joi from 'joi'
import { messages } from '@joi-tools/translator'

...
const { error } = loginSchema.validate(data, { messages: messages.es })
```

> If the specified language is not supported by the package, messages will be in English by default.

## Changelog

View the changelog at [CHANGELOG.md](https://github.com/jesusjimeneztapia/joi-tools/blob/master/packages/translator/CHANGELOG.md)