Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ultirequiem/stable-fn

🦾 Ensure the same input always produces the same output
https://github.com/ultirequiem/stable-fn

deno javas npm testing typescript

Last synced: 2 months ago
JSON representation

🦾 Ensure the same input always produces the same output

Awesome Lists containing this project

README

        

# stable-fn

[![codecov](https://codecov.io/gh/ultirequiem/stable-fn/branch/main/graph/badge.svg)](https://codecov.io/gh/ultirequiem/stable-fn)
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/stable_fn/mod.ts)

> Ensure the same input always produces the same output.

Useful for stress testing functions in your unit tests to make sure their
behaviors are consistent.

## Usage

### [Deno 🚀](https://deno.land/x/stable_fn)

```typescript
import { stableFunction } from "https://deno.land/x/stable_fn/mod.ts";
import { randomItem } from "https://deno.land/x/random_item/mod.ts";

stableFunction(() => true); //=> true
stableFunction(() => randomItem(["a", "b", "c"])); //=> false
```

### [Node.js 🐢](https://www.npmjs.com/package/@ultirequiem/stable-fn)

```ts
import { stableFunction } from "@ultirequiem/stable-fn";
```

### Browser

Using
[type module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules)
🍱

- [esm.sh](https://esm.sh/@ultirequiem/stable-fn)

- [skypack](https://cdn.skypack.dev/@ultirequiem/stable-fn)

Using a plain
[script tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) 👇

- [jsdelivr](https://cdn.jsdelivr.net/npm/@ultirequiem/stable-fn)

- [unpkg](https://unpkg.com/@ultirequiem/stable-fn)

You have the same API on all of this platforms.

## Documentation

[Autogenerated Documentation](https://doc.deno.land/https://deno.land/x/stable_fn/mod.ts)
😎

## Support

Open an Issue, I will check it a soon as possible 👀

If you want to hurry me up a bit
[send me a tweet](https://twitter.com/intent/tweet?text=%40UltiRequiem%20) 😆

Consider [supporting me on Patreon](https://patreon.com/UltiRequiem) if you like
my work 🚀

Don't forget to start the repo ⭐

## Licence

Licensed under the MIT License.