0.1.12 • Published 5 years ago
melf-share v0.1.12
MelfShare
(A)Synchronous remote references based on melf.
{serialize, instantiate, reflect, ownerof, discard} = require("melf-share")(melf, {synchronous, namespace})
melf :: melf.Melf
synchronous :: boolean | undefined
namespace :: string | undefined
data = serialize(value, hint)
value :: *
hint :: Hint
data :: JSON
value = instantiate(data)
data :: JSON
value :: *
reflect :: object
alias = ownerof(value)
value :: object | symbol
alias :: string
success = discard(value)
value :: object | symbol
success :: boolean
Hints
"number"
,"string"
or"default"
: Will try to transform the given value into a primitive using the standard steps.- Array of hint: Will try to serialize the elements of the given value using the elements of the hint. The instantiation will result to a new local array if successful else a remote array.
- Object of hint: Will try to serialize the enumerable properties of the given value using the properties of the hint. The instantiation will result to a new local object if successful else a remote object.
- Others:
Others hint values are ignored and can be used for documentation purpose.
After instantiation:
- Non-symbolic primitives will refer to the same value (
undefined
,NaN
,+Infinity
,-Infinity
,-0
are supported). - Well-known and global symbol will refer the local corresponding well-known/global symbol.
- Other symbols will refer to a dedicated symbol with the same string representation.
- Arrays will refer to a remote array.
- Non-constructors will refer to a remote arrow.
- Constructors will refer to a remote function.
- Objects will refer to a remote object.
- Non-symbolic primitives will refer to the same value (
0.1.12
5 years ago
0.1.11
5 years ago
0.1.10
5 years ago
0.1.9
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago
0.0.19
5 years ago
0.0.17
5 years ago
0.0.16
5 years ago
0.0.15
5 years ago
0.0.14
5 years ago
0.0.13
5 years ago
0.0.12
5 years ago
0.0.11
5 years ago
0.0.10
6 years ago
0.0.9
6 years ago
0.0.8
6 years ago
0.0.7
6 years ago
0.0.6
6 years ago
0.0.5
6 years ago
0.0.4
6 years ago
0.0.3
6 years ago
0.0.2
6 years ago
0.0.1
6 years ago
0.0.0
6 years ago