aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2022-02-06 12:05:40 +0100
committerGitHub <[email protected]>2022-02-06 12:05:40 +0100
commitec5550657b6b4e2f62032e9f4175ec2ac8307ee0 (patch)
tree7945af2af9a566fc8a2ffc0c774c01066c4a6be6 /src
parent98bd988305db71e438c3ea5ce31d9bf4c3df0843 (diff)
downloadfaker-ec5550657b6b4e2f62032e9f4175ec2ac8307ee0.tar.xz
faker-ec5550657b6b4e2f62032e9f4175ec2ac8307ee0.zip
docs: improve hacker jsdocs (#436)
Diffstat (limited to 'src')
-rw-r--r--src/hacker.ts34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/hacker.ts b/src/hacker.ts
index dac9b4f6..3ec91820 100644
--- a/src/hacker.ts
+++ b/src/hacker.ts
@@ -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
@@ -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(
@@ -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(
@@ -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(
@@ -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 = {