Skip to content

env: isUnifier()

Eugene Lazutkin edited this page Jan 10, 2022 · 3 revisions

This function is used to determine if an object supports a Unifier protocol. It can be used by custom unifiers in some rare cases. It is used internally by unify().

isUnifier() is defined in env and can be accessed like that:

import {isUnifier} from 'deep6/env.js';

The current implementation:

const isUnifier = x => x instanceof Unifier;

Example of use:

import {isUnifier, variable} from 'deep6/env.js';

const x = variable();

isUnifier(x); // true
isUnifier(1); // false
Clone this wiki locally