package prr

  1. Overview
  2. Docs

int properties accessors.

val find : t -> prop -> int option

find o p is find_map to_int o p. This is unsafe, only use if you know that if o defines p it is guaranteed to be a JavaScript number.

val get : t -> prop -> int

get o p is to_int (get o p). This is unsafe, only use if you know o has p and it is guaranteed to be a JavaScript number.

val set : t -> prop -> int -> unit

set o p b is set o p (of_int b).

val set_if_some : t -> prop -> int option -> unit

set_if_some o p b is set_if_some o p (Option.map of_int b).

OCaml

Innovation. Community. Security.