Skip to content

Commit

Permalink
docs: improve examples for objectKey,objectValue,objectEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmayer committed Dec 20, 2024
1 parent e0016ad commit 1c7893f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/modules/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ export class SimpleHelpersModule extends SimpleModuleBase {

/**
* Returns a random key from given object.
* Returns a random key from the given object.
*
* @template T The type of the object to select from.
*
Expand All @@ -780,7 +781,7 @@ export class SimpleHelpersModule extends SimpleModuleBase {
* @throws If the given object is empty.
*
* @example
* faker.helpers.objectKey({ myProperty: 'myValue' }) // 'myProperty'
* faker.helpers.objectKey({ Cheetah: 120, Falcon: 390, Snail: 0.03 }) // 'Falcon'
*
* @since 6.3.0
*/
Expand All @@ -790,7 +791,7 @@ export class SimpleHelpersModule extends SimpleModuleBase {
}

/**
* Returns a random value from given object.
* Returns a random value from the given object.
*
* @template T The type of object to select from.
*
Expand All @@ -799,7 +800,7 @@ export class SimpleHelpersModule extends SimpleModuleBase {
* @throws If the given object is empty.
*
* @example
* faker.helpers.objectValue({ myProperty: 'myValue' }) // 'myValue'
* faker.helpers.objectValue({ Cheetah: 120, Falcon: 390, Snail: 0.03 }) // 390
*
* @since 6.3.0
*/
Expand All @@ -818,7 +819,7 @@ export class SimpleHelpersModule extends SimpleModuleBase {
* @throws If the given object is empty.
*
* @example
* faker.helpers.objectEntry({ prop1: 'value1', prop2: 'value2' }) // ['prop1', 'value1']
* faker.helpers.objectEntry({ Cheetah: 120, Falcon: 390, Snail: 0.03 }) // [ 'Snail', 0.03 ]
*
* @since 8.0.0
*/
Expand Down

0 comments on commit 1c7893f

Please sign in to comment.