# uncurried-intrinsics

> Combines es-intrinsic-cache and uncurry-x to get and uncurry JavaScript intrinsics in one step

Latest version **1.0.3** (published 2026-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install uncurried-intrinsics
pnpm add uncurried-intrinsics
yarn add uncurried-intrinsics
bun add uncurried-intrinsics
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2026-01-10 |
| First published | 2025-12-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Fox Jones xsfj |
| Maintainers | xsfj |
| Keywords | intrinsics, uncurried, cache, es, call-bind, call-bound, intrinsic |

## Links

- npm: https://www.npmjs.com/package/uncurried-intrinsics
- Repository: https://github.com/xsfj/uncurried-intrinsics
- Homepage: https://github.com/xsfj/uncurried-intrinsics#readme
- Issues: https://github.com/xsfj/uncurried-intrinsics/issues
- npm.io page: https://npm.io/package/uncurried-intrinsics

## Dependencies (2)

- [uncurry-x](https://npm.io/package/uncurry-x.md) ^1.0.1
- [es-intrinsic-cache](https://npm.io/package/es-intrinsic-cache.md) ^1.0.1

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2026-01-10
- 1.0.2 — 2025-12-24
- 1.0.1 — 2025-12-23
- 1.0.0 — 2025-12-23

## README

# uncurried-intrinsics

Get an uncurried version of an intrinsic function by name.

## Description

Combines `es-intrinsic-cache` and `uncurry-x` to get and uncurry JavaScript intrinsics in one step.

## Installation

```bash
npm install uncurried-intrinsics
```

## Usage

```javascript
var uncurryIntrinsic = require("uncurried-intrinsics")

// Get uncurried Array.prototype.slice
var slice = uncurryIntrinsic("Array.prototype.slice")
slice([1, 2, 3, 4, 5], 1, 3) // [2, 3]

// Get uncurried String.prototype.split
var split = uncurryIntrinsic("String.prototype.split")
split("foo-bar-baz", "-") // ["foo", "bar", "baz"]

// Get uncurried Array.prototype.map
var map = uncurryIntrinsic("Array.prototype.map")
var doubled = map([1, 2, 3], function (x) {
  return x * 2
}) // [2, 4, 6]
```

## API

### `uncurryIntrinsic(intrinsicName[, allowMissing])`

Gets an intrinsic by name and returns its uncurried version where `this` becomes the first parameter.

**Parameters:**

- `intrinsicName` (string): The name of the intrinsic to get and uncurry (e.g., `"Array.prototype.slice"`)
- `allowMissing` (boolean, optional): If `true`, returns `null` or `undefined` for missing intrinsics instead of throwing an error. Default: `false`

**Returns:**

- (Function|null|undefined): The uncurried intrinsic function, or `null`/`undefined` if `allowMissing` is `true` and the intrinsic doesn't exist

**Throws:**

- Error if the intrinsic is not available and `allowMissing` is `false`

## Examples

### Array methods

```javascript
var uncurryIntrinsic = require("uncurried-intrinsics")

var push = uncurryIntrinsic("Array.prototype.push")
var join = uncurryIntrinsic("Array.prototype.join")

var arr = [1, 2, 3]
push(arr, 4, 5) // 5
join(arr, ", ") // "1, 2, 3, 4, 5"
```

### String methods

```javascript
var uncurryIntrinsic = require("uncurried-intrinsics")

var charAt = uncurryIntrinsic("String.prototype.charAt")
var toUpperCase = uncurryIntrinsic("String.prototype.toUpperCase")

charAt("hello", 0) // "h"
toUpperCase("hello") // "HELLO"
```

### Object methods

```javascript
var uncurryIntrinsic = require("uncurried-intrinsics")

var hasOwnProperty = uncurryIntrinsic("Object.prototype.hasOwnProperty")

var obj = { foo: 1, bar: 2 }
hasOwnProperty(obj, "foo") // true
hasOwnProperty(obj, "baz") // false
```

### Handling missing intrinsics

```javascript
var uncurryIntrinsic = require("uncurried-intrinsics")

// Throws an error if the intrinsic doesn't exist
try {
  var missing = uncurryIntrinsic("NonExistent.prototype.method")
} catch (e) {
  console.log(e.message) // 'Intrinsic "NonExistent.prototype.method" is not available'
}

// Returns null/undefined if allowMissing is true
var maybeExists = uncurryIntrinsic("Reflect.apply", true)
if (maybeExists) {
  // Use the intrinsic
} else {
  // Handle missing intrinsic
}
```

## See Also

- [uncurry-x](https://www.npmjs.com/package/uncurry-x) - Uncurry a function
- [es-intrinsic-cache](https://www.npmjs.com/package/es-intrinsic-cache) - Get cached JavaScript intrinsics

## License

MIT

---
_Source: https://npm.io/package/uncurried-intrinsics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
