@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.
@@ -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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.148",
3
+ "version": "1.0.149",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",