-
Notifications
You must be signed in to change notification settings - Fork 416
chore: remove uuid dependency
#3130
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,8 +17,8 @@ | |||||||||
|
|
||||||||||
| import { PrefixedFirebaseError } from '../utils/error'; | ||||||||||
| import { CloudEvent } from './cloudevent'; | ||||||||||
| import { v4 as uuid } from 'uuid'; | ||||||||||
| import * as validator from '../utils/validator'; | ||||||||||
| import { randomUUID } from 'node:crypto'; | ||||||||||
|
Comment on lines
20
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Following standard TypeScript conventions, built-in modules (like
Suggested change
|
||||||||||
|
|
||||||||||
| // List of CloudEvent properties that are handled "by hand" and should be skipped by | ||||||||||
| // automatic attribute copy. | ||||||||||
|
|
@@ -50,7 +50,7 @@ export function toCloudEventProtoFormat(ce: CloudEvent): any { | |||||||||
| } | ||||||||||
| const out: Record<string, any> = { | ||||||||||
| '@type': 'type.googleapis.com/io.cloudevents.v1.CloudEvent', | ||||||||||
| 'id': ce.id ?? uuid(), | ||||||||||
| 'id': ce.id ?? randomUUID(), | ||||||||||
| 'type': ce.type, | ||||||||||
| 'specVersion': ce.specversion ?? '1.0', | ||||||||||
| 'source': source | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -26,9 +26,8 @@ import { | |||||||||||
| NamedCondition, | ||||||||||||
| OneOfCondition, | ||||||||||||
| } from '../../../src/remote-config/remote-config-api'; | ||||||||||||
| import { v4 as uuidv4 } from 'uuid'; | ||||||||||||
| import { clone } from 'lodash'; | ||||||||||||
| import * as crypto from 'crypto'; | ||||||||||||
| import * as crypto from 'node:crypto'; | ||||||||||||
|
Comment on lines
29
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Built-in Node.js modules should ideally be grouped at the top of the import section, before external dependencies like
Suggested change
|
||||||||||||
|
|
||||||||||||
| const expect = chai.expect; | ||||||||||||
|
|
||||||||||||
|
|
@@ -907,7 +906,7 @@ describe('ConditionEvaluator', () => { | |||||||||||
| ...clone(condition), | ||||||||||||
| seed: 'seed' | ||||||||||||
| }; | ||||||||||||
| const context = { randomizationId: uuidv4() } | ||||||||||||
| const context = { randomizationId: crypto.randomUUID() } | ||||||||||||
| if (conditionEvaluator.evaluateConditions([{ | ||||||||||||
| name: 'is_enabled', | ||||||||||||
| condition: { percent: clonedCondition } | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.