teamplay 0.5.0-alpha.0 → 0.5.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/orm/SignalBase.d.ts
CHANGED
|
@@ -23,6 +23,12 @@ export declare class Signal<TValue = unknown> extends Function {
|
|
|
23
23
|
path(): string;
|
|
24
24
|
/** Return the last segment of this signal path, or an empty string for the root signal. */
|
|
25
25
|
leaf(): string;
|
|
26
|
+
/** Return the signal path when JavaScript coerces this signal to a primitive value. */
|
|
27
|
+
[Symbol.toPrimitive](_hint?: string): string;
|
|
28
|
+
/** Return a debug label for this signal. Primitive coercion returns only the path. */
|
|
29
|
+
toString(): string;
|
|
30
|
+
/** Customize Object.prototype.toString.call($signal) for debugging. */
|
|
31
|
+
get [Symbol.toStringTag](): string;
|
|
26
32
|
/**
|
|
27
33
|
* Return the parent signal `levels` above this signal.
|
|
28
34
|
* @param levels Number of parent levels to walk upward. Defaults to `1`.
|
package/dist/orm/SignalBase.js
CHANGED
|
@@ -134,6 +134,19 @@ export class Signal extends Function {
|
|
|
134
134
|
throw Error('Signal.leaf() does not accept any arguments');
|
|
135
135
|
return getSignalLeaf(this);
|
|
136
136
|
}
|
|
137
|
+
/** Return the signal path when JavaScript coerces this signal to a primitive value. */
|
|
138
|
+
[Symbol.toPrimitive](_hint) {
|
|
139
|
+
return getSignalPath(this);
|
|
140
|
+
}
|
|
141
|
+
/** Return a debug label for this signal. Primitive coercion returns only the path. */
|
|
142
|
+
toString() {
|
|
143
|
+
const path = getSignalPath(this);
|
|
144
|
+
return `[Signal ${path || '<root>'}]`;
|
|
145
|
+
}
|
|
146
|
+
/** Customize Object.prototype.toString.call($signal) for debugging. */
|
|
147
|
+
get [Symbol.toStringTag]() {
|
|
148
|
+
return 'Signal';
|
|
149
|
+
}
|
|
137
150
|
/**
|
|
138
151
|
* Return the parent signal `levels` above this signal.
|
|
139
152
|
* @param levels Number of parent levels to walk upward. Defaults to `1`.
|
|
@@ -10,7 +10,7 @@ export function transformRootDollarAlias(segments, key, aliases = ROOT_DOLLAR_AL
|
|
|
10
10
|
if (REGEX_LEADING_DOLLAR.test(key))
|
|
11
11
|
key = key.slice(1);
|
|
12
12
|
if (segments.length === 0)
|
|
13
|
-
return aliases[key]
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(aliases, key) ? aliases[key] : key;
|
|
14
14
|
return key;
|
|
15
15
|
}
|
|
16
16
|
export function maybeTransformToArrayIndex(key) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export interface SignalMetadataMethods {
|
|
2
2
|
path: () => string;
|
|
3
3
|
leaf: () => string;
|
|
4
|
+
[Symbol.toPrimitive]: (hint?: string) => string;
|
|
5
|
+
toString: () => string;
|
|
6
|
+
readonly [Symbol.toStringTag]: string;
|
|
4
7
|
parent: (levels?: number) => unknown;
|
|
5
8
|
id: () => string;
|
|
6
9
|
getId: () => string | number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
3
|
+
"version": "0.5.0-alpha.2",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@nx-js/observer-util": "^4.1.3",
|
|
71
71
|
"@startupjs/sharedb-mingo-memory": "^4.0.0-2",
|
|
72
|
-
"@teamplay/backend": "^0.5.0-alpha.
|
|
72
|
+
"@teamplay/backend": "^0.5.0-alpha.1",
|
|
73
73
|
"@teamplay/cache": "^0.5.0-alpha.0",
|
|
74
74
|
"@teamplay/channel": "^0.5.0-alpha.0",
|
|
75
75
|
"@teamplay/debug": "^0.5.0-alpha.0",
|
|
76
|
-
"@teamplay/schema": "^0.5.0-alpha.
|
|
76
|
+
"@teamplay/schema": "^0.5.0-alpha.1",
|
|
77
77
|
"@teamplay/utils": "^0.5.0-alpha.0",
|
|
78
|
-
"babel-plugin-teamplay": "^0.5.0-alpha.
|
|
78
|
+
"babel-plugin-teamplay": "^0.5.0-alpha.1",
|
|
79
79
|
"diff-match-patch": "^1.0.5",
|
|
80
80
|
"events": "^3.3.0",
|
|
81
81
|
"json0-ot-diff": "^1.1.2",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
]
|
|
129
129
|
},
|
|
130
130
|
"license": "MIT",
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "6d03dc309c39801dac31320a089dc30327613123"
|
|
132
132
|
}
|