@dra2020/baseclient 1.0.148 → 1.0.149
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 +6 -1
- package/dist/baseclient.js.map +1 -1
- package/dist/util/util.d.ts +1 -0
- package/lib/util/util.ts +7 -0
- package/package.json +1 -1
package/dist/util/util.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare class Deadline {
|
|
|
29
29
|
done(): boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare function createGuid(): string;
|
|
32
|
+
export declare function isGuid(s: string): boolean;
|
|
32
33
|
export declare function createKeyedGuid(key: string): string;
|
|
33
34
|
export declare function guidKey(guid: string): string;
|
|
34
35
|
export declare function sizeof(a: any): number;
|
package/lib/util/util.ts
CHANGED
|
@@ -132,6 +132,13 @@ export function createGuid(): string
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
const reGuid = /.*-.*-.*-.*-/;
|
|
136
|
+
|
|
137
|
+
export function isGuid(s: string): boolean
|
|
138
|
+
{
|
|
139
|
+
return reGuid.test(s) && s.length >= 36
|
|
140
|
+
}
|
|
141
|
+
|
|
135
142
|
export function createKeyedGuid(key: string): string
|
|
136
143
|
{
|
|
137
144
|
return `xxxxxxxx-xxxx-${key}xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g, function(c) {
|