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: 9 months ago
JSON representation
🦾 Ensure the same input always produces the same output
- Host: GitHub
- URL: https://github.com/ultirequiem/stable-fn
- Owner: UltiRequiem
- License: mit
- Created: 2022-03-21T18:15:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-28T17:37:06.000Z (about 1 year ago)
- Last Synced: 2025-10-09T02:37:34.563Z (9 months ago)
- Topics: deno, javas, npm, testing, typescript
- Language: TypeScript
- Homepage: https://stable-fn.js.org
- Size: 18.6 KB
- Stars: 8
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# stable-fn
[](https://codecov.io/gh/ultirequiem/stable-fn)
[](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.