Module
FFI.Simple.Objects
- Package
- purescript-ffi-simple
- Repository
- garganscript/purescript-ffi-simple
#instanceOf Source
instanceOf :: forall a b. a -> b -> Boolean
Checks whether an object is an instance of an invokable
#hasOwnProperty Source
hasOwnProperty :: forall o. String -> o -> Boolean
Does this object have the given property itself (i.e. not inherited)?
#getProperty Source
getProperty :: forall o v. String -> o -> v
Get the property with the given name form the given object
If property does not exist, will be undefined (see F.S.Undef
)
#getProperty' Source
getProperty' :: forall o v. o -> String -> v
flip getProperty
#(.?) Source
Operator alias for FFI.Simple.Objects.maybeGetProperty' (left-associative / precedence 9)
#maybeGetProperty Source
maybeGetProperty :: forall o v. String -> o -> Maybe v
Attempts to get a property from an object, returning Nothing if it was undefined
#maybeGetProperty' Source
maybeGetProperty' :: forall o v. o -> String -> Maybe v
flip maybeGetProperty
#setProperty Source
setProperty :: forall o v. String -> o -> v -> o
Sets a property on an object Notes:
- Will probably throw an error if you try to set a readonly property
- Is meant to be used in Effect
#setProperty' Source
setProperty' :: forall o v. o -> String -> v -> o
flip setProperty
#defineProperty Source
defineProperty :: forall o v. String -> o -> v -> o
Defines a new readonly property. Useful for e.g. name
which is a readonly prop
#defineProperty' Source
defineProperty' :: forall o v. o -> String -> v -> o
#removeProperty Source
removeProperty :: forall o. String -> o -> o
#removeProperty' Source
removeProperty' :: forall o. o -> String -> o