Skip to content

docs: improve hacker jsdocs #436

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

Merged
merged 4 commits into from
Feb 6, 2022
Merged
Changes from 2 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
34 changes: 22 additions & 12 deletions src/hacker.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { Faker } from '.';

/**
* Module to generate hacker/IT words and phrases.
*/
export class Hacker {
constructor(private readonly faker: Faker) {
// Bind `this` so namespaced is working correctly
Expand All @@ -12,9 +15,10 @@ export class Hacker {
}

/**
* abbreviation
* Returns a random hacker/IT abbreviation.
*
* @method faker.hacker.abbreviation
* @example
* faker.hacker.abbreviation() // 'THX'
*/
abbreviation(): string {
return this.faker.random.arrayElement(
Expand All @@ -23,9 +27,10 @@ export class Hacker {
}

/**
* adjective
* Returns a random hacker/IT adjective.
*
* @method faker.hacker.adjective
* @example
* faker.hacker.adjective() // 'cross-platform'
*/
adjective(): string {
return this.faker.random.arrayElement(
Expand All @@ -34,27 +39,30 @@ export class Hacker {
}

/**
* noun
* Returns a random hacker/IT noun.
*
* @method faker.hacker.noun
* @example
* faker.hacker.noun() // 'system'
*/
noun(): string {
return this.faker.random.arrayElement(this.faker.definitions.hacker.noun);
}

/**
* verb
* Returns a random hacker/IT verb.
*
* @method faker.hacker.verb
* @example
* faker.hacker.verb() // 'copy'
*/
verb(): string {
return this.faker.random.arrayElement(this.faker.definitions.hacker.verb);
}

/**
* ingverb
* Returns a random hacker/IT verb for continuous actions (en: ing suffix; e.g. hacking).
*
* @method faker.hacker.ingverb
* @example
* faker.hacker.ingverb() // 'navigating'
*/
ingverb(): string {
return this.faker.random.arrayElement(
Expand All @@ -63,9 +71,11 @@ export class Hacker {
}

/**
* phrase
* Generates a random hacker/IT phrase.
*
* @method faker.hacker.phrase
* @example
* faker.hacker.phrase()
* // 'If we override the card, we can get to the HDD feed through the back-end HDD sensor!'
*/
phrase(): string {
const data = {
Expand Down