Skip to main content

Variable: opaque()

const opaque: <Value>(iterable) => Iterable<Value>

Defined in: core.d.ts:511

Returns an iterable equivalent, but not referentially equal, to iterable.

Type Parameters​

Value​

Value

Parameters​

iterable​

Iterable<Value>

Returns​

Iterable<Value>

Example​

import { opaque } from 'lfi'

const array = [`sloth`, `lazy`, `sleep`]
const iterable = opaque(array)

console.log(array === iterable)
//=> false

console.log([...iterable])
//=> [ 'sloth', 'lazy', 'sleep' ]
Playground

Since​

v2.0.0