package melange

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Provide utilities for JS dictionary object

Provides a simple key-value dictionary abstraction over native JavaScript objects

type 'a t

The dict type

type key = string

The key type, an alias of string

val unsafeGet : 'a t -> key -> 'a

unsafeGet dict key returns the value associated with key in dict

This function will return an invalid value (undefined) if key does not exist in dict. It will not throw an error.

val (.!()) : 'a t -> key -> 'a
val get : 'u t -> key -> 'u option

get dict key returns the value associated with key in dict

val set : 'a t -> key -> 'a -> unit

set dict key value sets the value of key in dict to value

val keys : 'a t -> key array

keys dict returns an array of all the keys in dict

val empty : unit -> 'a t

empty () creates an empty dictionary

val unsafeDeleteKey : (string t -> string -> unit) Js__.Js_internal.Fn.arity2
val unsafeCreate : int -> 'a array
val entries : 'a t -> (key * 'a) array
val values : 'a t -> 'a array
val fromList : (key * 'a) list -> 'a t
val fromArray : (key * 'a) array -> 'a t
val map : ('a -> 'b) Js__.Js_internal.Fn.arity1 -> 'a t -> 'b t
OCaml

Innovation. Community. Security.