Skip to content

Commit bae32f3

Browse files
authored
Merge pull request #1596 from microsoft/fix/cleanup-uuid
fix/cleanup uuid
2 parents ba189e6 + 095ecc3 commit bae32f3

File tree

5 files changed

+24
-15
lines changed

5 files changed

+24
-15
lines changed

package-lock.json

+9-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/abstractions/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@
3030
"url": "https://github.com/microsoft/kiota-typescript/issues"
3131
},
3232
"homepage": "https://github.com/microsoft/kiota#readme",
33-
"devDependencies": {
34-
"@types/uuid": "^10.0.0"
35-
},
3633
"dependencies": {
3734
"@opentelemetry/api": "^1.7.0",
3835
"@std-uritemplate/std-uritemplate": "^2.0.0",
3936
"tinyduration": "^3.3.0",
40-
"tslib": "^2.6.2",
41-
"uuid": "^11.0.2"
37+
"tslib": "^2.6.2"
4238
},
4339
"publishConfig": {
4440
"access": "public"
4541
},
4642
"browserslist": [
4743
"defaults"
48-
]
49-
}
44+
],
45+
"devDependencies": {
46+
"@types/uuid": "^10.0.0",
47+
"uuid": "^11.0.5"
48+
}
49+
}

packages/abstractions/src/store/inMemoryBackingStore.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
* See License in the project root for license information.
55
* -------------------------------------------------------------------------------------------
66
*/
7-
import { v4 as uuidv4 } from "uuid";
8-
97
import type { BackingStore } from "./backingStore";
8+
import { createGuid } from "../utils";
109

1110
interface storeEntryWrapper {
1211
changed: boolean;
@@ -65,7 +64,7 @@ export class InMemoryBackingStore implements BackingStore {
6564
if (!callback) {
6665
throw new Error("callback cannot be undefined");
6766
}
68-
subscriptionId = subscriptionId ?? uuidv4();
67+
subscriptionId = subscriptionId ?? createGuid();
6968
this.subscriptions.set(subscriptionId, callback);
7069
return subscriptionId;
7170
}

packages/abstractions/src/utils/guidUtils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
export type Guid = string;
88

9-
const guidValidator = new RegExp("^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$", "i");
9+
const guidValidator = /^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/i;
1010

1111
/**
1212
* Checks if the string is a valid GUID.

packages/serialization/text/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,9 @@
4747
},
4848
"browserslist": [
4949
"defaults"
50-
]
50+
],
51+
"devDependencies": {
52+
"@types/uuid": "^10.0.0",
53+
"uuid": "^11.0.5"
54+
}
5155
}

0 commit comments

Comments
 (0)