Skip to content

unify isSoft()

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

Checks if a value is wrapped as "soft".

Introduction

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

import {soft, isSoft} from 'deep6/unify.js';

const wrapped = soft({a: 1});
isSoft(wrapped); // true
isSoft(open({a: 1})); // false - different wrap type
isSoft({a: 1}); // false - plain object
isSoft(null); // false

API

isSoft(o)

Arguments:

  • o — any value to check.

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

Details

Useful for:

  • Distinguishing between "open" and "soft" wrapped objects
  • Debugging pattern structures
  • Type checking before unification

See Also

Clone this wiki locally