@dra2020/baseclient 1.0.118 → 1.0.120
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/baseclient.js +12 -1
- package/dist/baseclient.js.map +1 -1
- package/dist/ot-js/otsession.d.ts +1 -0
- package/dist/util/util.d.ts +2 -0
- package/lib/ot-js/otsession.ts +1 -0
- package/lib/util/util.ts +13 -0
- package/package.json +1 -1
package/dist/util/util.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export declare class Deadline {
|
|
|
29
29
|
done(): boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare function createGuid(): string;
|
|
32
|
+
export declare function createKeyedGuid(key: string): string;
|
|
33
|
+
export declare function guidKey(guid: string): string;
|
|
32
34
|
export declare function sizeof(a: any): number;
|
|
33
35
|
export declare function depthof(a: any): number;
|
|
34
36
|
export declare function isEmpty(o: any): boolean;
|
package/lib/ot-js/otsession.ts
CHANGED
package/lib/util/util.ts
CHANGED
|
@@ -132,6 +132,19 @@ export function createGuid(): string
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
export function createKeyedGuid(key: string): string
|
|
136
|
+
{
|
|
137
|
+
return `xxxxxxxx-xxxx-${key}xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, function(c) {
|
|
138
|
+
var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);
|
|
139
|
+
return v.toString(16);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function guidKey(guid: string): string
|
|
144
|
+
{
|
|
145
|
+
return guid.substr(14, 1); // See above
|
|
146
|
+
}
|
|
147
|
+
|
|
135
148
|
type LoopTest = WeakMap<any,boolean>;
|
|
136
149
|
|
|
137
150
|
function _sizeof(a: any, loops: LoopTest): number
|