Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/cleanup uuid #1596

Merged
merged 4 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions packages/abstractions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@
"url": "https://github.com/microsoft/kiota-typescript/issues"
},
"homepage": "https://github.com/microsoft/kiota#readme",
"devDependencies": {
"@types/uuid": "^10.0.0"
},
"dependencies": {
"@opentelemetry/api": "^1.7.0",
"@std-uritemplate/std-uritemplate": "^2.0.0",
"tinyduration": "^3.3.0",
"tslib": "^2.6.2",
"uuid": "^11.0.2"
"tslib": "^2.6.2"
},
"publishConfig": {
"access": "public"
},
"browserslist": [
"defaults"
]
}
],
"devDependencies": {
"@types/uuid": "^10.0.0",
"uuid": "^11.0.5"
}
}
5 changes: 2 additions & 3 deletions packages/abstractions/src/store/inMemoryBackingStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { v4 as uuidv4 } from "uuid";

import type { BackingStore } from "./backingStore";
import { createGuid } from "../utils";

interface storeEntryWrapper {
changed: boolean;
Expand Down Expand Up @@ -65,7 +64,7 @@ export class InMemoryBackingStore implements BackingStore {
if (!callback) {
throw new Error("callback cannot be undefined");
}
subscriptionId = subscriptionId ?? uuidv4();
subscriptionId = subscriptionId ?? createGuid();
this.subscriptions.set(subscriptionId, callback);
return subscriptionId;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/abstractions/src/utils/guidUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
export type Guid = string;

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");
const guidValidator = /^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$/i;

/**
* Checks if the string is a valid GUID.
Expand Down
6 changes: 5 additions & 1 deletion packages/serialization/text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@
},
"browserslist": [
"defaults"
]
],
"devDependencies": {
"@types/uuid": "^10.0.0",
"uuid": "^11.0.5"
}
}
Loading