-
Notifications
You must be signed in to change notification settings - Fork 246
feat(compass-collection): Add descriptions to FakerJS methods - CLOUDP-358516 #7561
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,85 +52,178 @@ export const MongoDBFieldTypeValues: MongoDBFieldType[] = [ | |||||
| */ | ||||||
| export const MONGO_TYPE_TO_FAKER_METHODS: Record< | ||||||
| MongoDBFieldType, | ||||||
| Array<string> | ||||||
| Array<{ method: string; description?: string }> | ||||||
| > = { | ||||||
| String: [ | ||||||
| 'lorem.word', | ||||||
| 'lorem.words', | ||||||
| 'lorem.sentence', | ||||||
| 'lorem.paragraph', | ||||||
| 'person.firstName', | ||||||
| 'person.lastName', | ||||||
| 'person.fullName', | ||||||
| 'person.jobTitle', | ||||||
| 'internet.displayName', | ||||||
| 'internet.email', | ||||||
| 'internet.emoji', | ||||||
| 'internet.password', | ||||||
| 'internet.url', | ||||||
| 'internet.domainName', | ||||||
| 'internet.userName', | ||||||
| 'phone.number', | ||||||
| 'location.city', | ||||||
| 'location.country', | ||||||
| 'location.streetAddress', | ||||||
| 'location.zipCode', | ||||||
| 'location.state', | ||||||
| 'company.name', | ||||||
| 'company.catchPhrase', | ||||||
| 'color.human', | ||||||
| 'commerce.productName', | ||||||
| 'commerce.department', | ||||||
| 'finance.accountName', | ||||||
| 'finance.currencyCode', | ||||||
| 'git.commitSha', | ||||||
| 'string.uuid', | ||||||
| 'string.alpha', | ||||||
| 'string.alphanumeric', | ||||||
| 'system.fileName', | ||||||
| 'system.filePath', | ||||||
| 'system.mimeType', | ||||||
| 'book.title', | ||||||
| 'music.songName', | ||||||
| 'food.dish', | ||||||
| 'animal.type', | ||||||
| 'vehicle.model', | ||||||
| 'hacker.phrase', | ||||||
| 'science.chemicalElement', | ||||||
| { method: 'lorem.word', description: 'Single word' }, | ||||||
| { method: 'lorem.words', description: 'Multiple words' }, | ||||||
| { method: 'lorem.sentence', description: 'Short sentence' }, | ||||||
| { method: 'lorem.paragraph', description: 'Paragraph of text' }, | ||||||
| { method: 'person.firstName' }, | ||||||
| { method: 'person.lastName' }, | ||||||
| { method: 'person.fullName' }, | ||||||
| { method: 'person.jobTitle' }, | ||||||
| { | ||||||
| method: 'internet.displayName', | ||||||
| description: 'Username-style display name', | ||||||
| }, | ||||||
| { method: 'internet.email' }, | ||||||
| { method: 'internet.emoji' }, | ||||||
| { method: 'internet.password', description: 'Randomly generated password' }, | ||||||
| { method: 'internet.url' }, | ||||||
| { method: 'internet.domainName' }, | ||||||
| { method: 'internet.userName' }, | ||||||
| { method: 'phone.number' }, | ||||||
| { method: 'location.city' }, | ||||||
| { method: 'location.country' }, | ||||||
| { method: 'location.streetAddress' }, | ||||||
| { method: 'location.zipCode' }, | ||||||
| { method: 'location.state' }, | ||||||
| { method: 'company.name' }, | ||||||
| { | ||||||
| method: 'company.catchPhrase', | ||||||
| description: 'Corporate-style marketing slogan', | ||||||
| }, | ||||||
| { method: 'color.human', description: 'Human-readable color name' }, | ||||||
| { | ||||||
| method: 'commerce.productName', | ||||||
| description: 'Product name from a commerce catalog', | ||||||
| }, | ||||||
| { | ||||||
| method: 'commerce.department', | ||||||
| description: 'Commerce category or department name', | ||||||
| }, | ||||||
| { | ||||||
| method: 'finance.accountName', | ||||||
| description: 'Financial account type or name', | ||||||
| }, | ||||||
| { | ||||||
| method: 'finance.currencyCode', | ||||||
| description: 'ISO 4217 currency code like USD or EUR', | ||||||
| }, | ||||||
| { method: 'git.commitSha', description: 'Git commit SHA hash' }, | ||||||
| { method: 'string.uuid' }, | ||||||
| { method: 'string.alpha', description: 'Alphabetic string' }, | ||||||
| { method: 'string.alphanumeric', description: 'Alphanumeric string' }, | ||||||
| { | ||||||
| method: 'system.fileName', | ||||||
| description: 'File name with optional extension', | ||||||
| }, | ||||||
| { method: 'system.filePath', description: 'System-like file path' }, | ||||||
| { | ||||||
| method: 'system.mimeType', | ||||||
| description: 'MIME type string like image/png', | ||||||
| }, | ||||||
| { method: 'book.title' }, | ||||||
| { method: 'music.songName' }, | ||||||
| { method: 'food.dish' }, | ||||||
| { method: 'animal.type' }, | ||||||
| { method: 'vehicle.model' }, | ||||||
| { method: 'hacker.phrase', description: 'Hacker-style phrase' }, | ||||||
| { | ||||||
| method: 'science.chemicalElement', | ||||||
| description: 'Chemical element with name and symbol', | ||||||
| }, | ||||||
| ], | ||||||
|
|
||||||
| Number: [ | ||||||
| 'number.binary', | ||||||
| 'number.octal', | ||||||
| 'number.hex', | ||||||
| 'commerce.price', | ||||||
| 'date.weekday', | ||||||
| 'internet.port', | ||||||
| 'number.int', | ||||||
| 'number.float', | ||||||
| 'finance.amount', | ||||||
| 'location.latitude', | ||||||
| 'location.longitude', | ||||||
| { method: 'number.binary', description: 'Binary number string' }, | ||||||
| { method: 'number.octal', description: 'Octal number string' }, | ||||||
| { method: 'number.hex', description: 'Hexadecimal number string' }, | ||||||
| { method: 'commerce.price', description: 'Monetary price with decimals' }, | ||||||
| { method: 'date.weekday', description: 'Day of the week' }, | ||||||
|
||||||
| { method: 'date.weekday', description: 'Day of the week' }, | |
| { method: 'date.weekday', description: 'Numeric index of day of the week (0=Sunday, 6=Saturday)' }, |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description 'Short line of code' is inaccurate for lorem.sentence, which generates Lorem Ipsum text, not actual code. Consider 'Short sentence as code placeholder' or similar to clarify that it's placeholder text being used in a code context.
| description: 'Short line of code', | |
| description: 'Short sentence as code placeholder', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The descriptions for binary, octal, and hex methods are misleading. These methods return numeric values, not strings. The descriptions should be updated to 'Binary number', 'Octal number', and 'Hexadecimal number' respectively to accurately reflect the return type, or clarified as 'Number in binary format' if they return formatted strings.