Skip to content

unify isOpen()

Eugene Lazutkin edited this page Apr 3, 2026 · 1 revision

Checks if a value is wrapped as "open".

Introduction

Type guard function to check if a value was wrapped with open().

import {open, isOpen} from 'deep6/unify.js';

const wrapped = open({a: 1});
isOpen(wrapped); // true
isOpen({a: 1}); // false - plain object
isOpen(null); // false

API

isOpen(o)

Arguments:

  • o — any value to check.

Returns true if o is a Wrap instance with type 'open', false otherwise.

Details

Useful for:

  • Type checking before unification
  • Debugging pattern structures
  • Conditional logic based on open/closed semantics

See Also

Clone this wiki locally