Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/deep/protected.ts

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
import * as rimbu from "https://deno.land/x/rimbu@1.0.4/deep/protected.ts";

Type Aliases

A deep readonly typed version of given type T. Makes all properties or elements read only. It maps types using the following rules:

  • arrays and tuples become readonly counterparts, and all element types are wrapped in Protected if applicable
  • Maps of key type K and value type V become Maps of key type Protected<K> and value type Protected<V>
  • Sets of element type E become Sets of element type Protected<E>
  • Promises of value type E become Promises of value type Protected<E>
  • Objects that have only simple properties (no functions or iterators) will have all the properties as Protected if applicable
  • Any other type will not be mapped