0.1.12 • Published 6 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.Melfsynchronous :: boolean | undefinednamespace :: string | undefineddata = serialize(value, hint)value :: *hint :: Hintdata :: JSON
value = instantiate(data)data :: JSONvalue :: *
reflect :: objectalias = ownerof(value)value :: object | symbolalias :: string
success = discard(value)value :: object | symbolsuccess :: 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,-0are 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
6 years ago
0.1.11
7 years ago
0.1.10
7 years ago
0.1.9
7 years ago
0.1.8
7 years ago
0.1.7
7 years ago
0.1.6
7 years ago
0.1.5
7 years ago
0.1.4
7 years ago
0.1.3
7 years ago
0.1.2
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.19
7 years ago
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago
0.0.0
7 years ago