Skip to content

Commit 8e7801a

Browse files
refactor(hacker): use helpers.fake() instead of helpers.mustache() in phrase() (#3736)
Co-authored-by: DivisionByZero <leyla.jaehnig@gmx.de>
1 parent 7afa8b5 commit 8e7801a

8 files changed

Lines changed: 46 additions & 61 deletions

File tree

src/definitions/hacker.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ export type HackerDefinition = LocaleEntry<{
2525
noun: string[];
2626

2727
/**
28-
* Some phrases that will be injected with random hacker words.
29-
* May use any of the HackerDefinition keys wrapped in double braces
30-
* (e.g. `I'm {{ingverb}} {{adjective}} {{noun}}`).
31-
*
32-
* @see faker.helpers.mustache(): For more information about how the phrases are generated.
28+
* A list of faker patterns to generate a hacker phrase.
3329
*/
3430
phrase: string[];
3531

src/locales/en/hacker/phrase.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export default [
2-
"I'll {{verb}} the {{adjective}} {{abbreviation}} {{noun}}, that should {{noun}} the {{abbreviation}} {{noun}}!",
3-
'If we {{verb}} the {{noun}}, we can get to the {{abbreviation}} {{noun}} through the {{adjective}} {{abbreviation}} {{noun}}!',
4-
'The {{abbreviation}} {{noun}} is down, {{verb}} the {{adjective}} {{noun}} so we can {{verb}} the {{abbreviation}} {{noun}}!',
5-
'Try to {{verb}} the {{abbreviation}} {{noun}}, maybe it will {{verb}} the {{adjective}} {{noun}}!',
6-
'Use the {{adjective}} {{abbreviation}} {{noun}}, then you can {{verb}} the {{adjective}} {{noun}}!',
7-
'We need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!',
8-
"You can't {{verb}} the {{noun}} without {{ingverb}} the {{adjective}} {{abbreviation}} {{noun}}!",
9-
"{{ingverb}} the {{noun}} won't do anything, we need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!",
2+
"I'll {{hacker.verb}} the {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}, that should {{hacker.noun}} the {{hacker.abbreviation}} {{hacker.noun}}!",
3+
'If we {{hacker.verb}} the {{hacker.noun}}, we can get to the {{hacker.abbreviation}} {{hacker.noun}} through the {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!',
4+
'The {{hacker.abbreviation}} {{hacker.noun}} is down, {{hacker.verb}} the {{hacker.adjective}} {{hacker.noun}} so we can {{hacker.verb}} the {{hacker.abbreviation}} {{hacker.noun}}!',
5+
'Try to {{hacker.verb}} the {{hacker.abbreviation}} {{hacker.noun}}, maybe it will {{hacker.verb}} the {{hacker.adjective}} {{hacker.noun}}!',
6+
'Use the {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}, then you can {{hacker.verb}} the {{hacker.adjective}} {{hacker.noun}}!',
7+
'We need to {{hacker.verb}} the {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!',
8+
"You can't {{hacker.verb}} the {{hacker.noun}} without {{hacker.ingverb}} the {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!",
9+
"{{hacker.ingverb}} the {{hacker.noun}} won't do anything, we need to {{hacker.verb}} the {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!",
1010
];

src/locales/eo/hacker/phrase.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
export default [
2-
'La {{abbreviation}}-{{noun}} ne funkcias, provu {{verb}} la {{adjective}}n {{noun}}n, por ke ni povu {{verb}} la {{abbreviation}}-{{noun}}n!',
3-
'Mi provos {{verb}} la {{adjective}}n {{abbreviation}}-{{noun}}n, tio devus {{verb}} la {{abbreviation}}-{{noun}}n!',
4-
'Ne funkcios {{ingverb}} de la {{noun}}, ni devas {{verb}} la {{adjective}}n {{abbreviation}}-{{noun}}n!',
5-
'Ne gravas, se ni ne povus {{verb}} la {{noun}}n, ni devas nur {{verb}} la {{adjective}}n {{abbreviation}}-{{noun}}!',
6-
'Ni devas {{verb}} la {{adjective}}n {{abbreviation}}-{{noun}}n!',
7-
'Provu {{verb}} la {{abbreviation}}-{{noun}}n, eble ni sukcesos {{verb}} la {{adjective}}n {{noun}}n!',
8-
'Se ni povus {{verb}} la {{noun}}n, ni povus aliri la {{abbreviation}}-{{noun}}n per la {{adjective}} {{abbreviation}}-{{noun}}!',
9-
'Uzu la {{adjective}}n {{abbreviation}}-{{noun}}n, poste vi povos {{verb}} la {{adjective}}n {{noun}}n!',
10-
'Vi ne povas {{verb}} la {{noun}}n sen {{ingverb}} de la {{adjective}} {{abbreviation}}-{{noun}}!',
2+
'La {{hacker.abbreviation}}-{{hacker.noun}} ne funkcias, provu {{hacker.verb}} la {{hacker.adjective}}n {{hacker.noun}}n, por ke ni povu {{hacker.verb}} la {{hacker.abbreviation}}-{{hacker.noun}}n!',
3+
'Mi provos {{hacker.verb}} la {{hacker.adjective}}n {{hacker.abbreviation}}-{{hacker.noun}}n, tio devus {{hacker.verb}} la {{hacker.abbreviation}}-{{hacker.noun}}n!',
4+
'Ne funkcios {{hacker.ingverb}} de la {{hacker.noun}}, ni devas {{hacker.verb}} la {{hacker.adjective}}n {{hacker.abbreviation}}-{{hacker.noun}}n!',
5+
'Ne gravas, se ni ne povus {{hacker.verb}} la {{hacker.noun}}n, ni devas nur {{hacker.verb}} la {{hacker.adjective}}n {{hacker.abbreviation}}-{{hacker.noun}}!',
6+
'Ni devas {{hacker.verb}} la {{hacker.adjective}}n {{hacker.abbreviation}}-{{hacker.noun}}n!',
7+
'Provu {{hacker.verb}} la {{hacker.abbreviation}}-{{hacker.noun}}n, eble ni sukcesos {{hacker.verb}} la {{hacker.adjective}}n {{hacker.noun}}n!',
8+
'Se ni povus {{hacker.verb}} la {{hacker.noun}}n, ni povus aliri la {{hacker.abbreviation}}-{{hacker.noun}}n per la {{hacker.adjective}} {{hacker.abbreviation}}-{{hacker.noun}}!',
9+
'Uzu la {{hacker.adjective}}n {{hacker.abbreviation}}-{{hacker.noun}}n, poste vi povos {{hacker.verb}} la {{hacker.adjective}}n {{hacker.noun}}n!',
10+
'Vi ne povas {{hacker.verb}} la {{hacker.noun}}n sen {{hacker.ingverb}} de la {{hacker.adjective}} {{hacker.abbreviation}}-{{hacker.noun}}!',
1111
];

src/locales/nl/hacker/phrase.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export default [
2-
'Als we de {{noun}} {{verb}}, dan kunnen we naar de {{abbreviation}} {{noun}} via de {{adjective}} {{abbreviation}} {{noun}}!',
3-
'De {{abbreviation}} {{noun}} ligt eruit, jullie moeten de {{adjective}} {{noun}} {{verb}} zodat we de {{abbreviation}} {{noun}} kunnen {{verb}}!',
4-
'Gebruik de {{adjective}} {{abbreviation}} {{noun}}, dan kan je de {{adjective}} {{noun}} {{verb}}!',
5-
'Het maakt niet uit of we de {{noun}} {{verb}}, we moeten de {{adjective}} {{abbreviation}} {{noun}} {{verb}}!',
6-
'Ik ga de {{adjective}} {{abbreviation}} {{noun}} {{verb}}, dat zou de {{noun}} moeten {{verb}}!',
7-
'Je kan de {{noun}} niet {{verb}} zonder de {{adjective}} {{abbreviation}} {{noun}} te {{verb}}!',
8-
'Probeer om de {{abbreviation}} {{noun}} te {{verb}}, misschien gaat dat de {{adjective}} {{noun}} {{verb}}!',
9-
'We moeten de {{adjective}} {{abbreviation}} {{noun}} {{verb}}!',
2+
'Als we de {{hacker.noun}} {{hacker.verb}}, dan kunnen we naar de {{hacker.abbreviation}} {{hacker.noun}} via de {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!',
3+
'De {{hacker.abbreviation}} {{hacker.noun}} ligt eruit, jullie moeten de {{hacker.adjective}} {{hacker.noun}} {{hacker.verb}} zodat we de {{hacker.abbreviation}} {{hacker.noun}} kunnen {{hacker.verb}}!',
4+
'Gebruik de {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}, dan kan je de {{hacker.adjective}} {{hacker.noun}} {{hacker.verb}}!',
5+
'Het maakt niet uit of we de {{hacker.noun}} {{hacker.verb}}, we moeten de {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}} {{hacker.verb}}!',
6+
'Ik ga de {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}} {{hacker.verb}}, dat zou de {{hacker.noun}} moeten {{hacker.verb}}!',
7+
'Je kan de {{hacker.noun}} niet {{hacker.verb}} zonder de {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}} te {{hacker.verb}}!',
8+
'Probeer om de {{hacker.abbreviation}} {{hacker.noun}} te {{hacker.verb}}, misschien gaat dat de {{hacker.adjective}} {{hacker.noun}} {{hacker.verb}}!',
9+
'We moeten de {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}} {{hacker.verb}}!',
1010
];

src/locales/ru/hacker/phrase.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export default [
2-
'{{abbreviation}} {{noun}} недоступен, требуется {{verb}} {{adjective}} {{noun}}, чтобы мы могли {{verb}} {{abbreviation}} {{noun}}!',
3-
'{{ingverb}} не работает, попробуйте {{verb}} {{adjective}} {{abbreviation}} {{noun}}!',
4-
'Вы не можете {{verb}} {{noun}}, требуется {{ingverb}} или {{ingverb}}!',
5-
'Используйте {{adjective}} {{abbreviation}} {{noun}}, для того чтобы {{verb}} {{adjective}} {{noun}}!',
6-
'Необходимо {{verb}} {{adjective}} {{abbreviation}} {{noun}}!',
7-
'Попробуйте {{verb}} {{abbreviation}} {{noun}}, возможно это позволит {{verb}} {{adjective}} {{noun}}!',
8-
'Чтобы {{verb}} {{noun}}, мы можем получить {{abbreviation}} {{noun}} через {{adjective}} {{abbreviation}} {{noun}}!',
9-
'Я планирую {{verb}} {{adjective}} {{abbreviation}} {{noun}}, это должно помочь {{verb}} {{abbreviation}} {{noun}}!',
2+
'{{hacker.abbreviation}} {{hacker.noun}} недоступен, требуется {{hacker.verb}} {{hacker.adjective}} {{hacker.noun}}, чтобы мы могли {{hacker.verb}} {{hacker.abbreviation}} {{hacker.noun}}!',
3+
'{{hacker.ingverb}} не работает, попробуйте {{hacker.verb}} {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!',
4+
'Вы не можете {{hacker.verb}} {{hacker.noun}}, требуется {{hacker.ingverb}} или {{hacker.ingverb}}!',
5+
'Используйте {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}, для того чтобы {{hacker.verb}} {{hacker.adjective}} {{hacker.noun}}!',
6+
'Необходимо {{hacker.verb}} {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!',
7+
'Попробуйте {{hacker.verb}} {{hacker.abbreviation}} {{hacker.noun}}, возможно это позволит {{hacker.verb}} {{hacker.adjective}} {{hacker.noun}}!',
8+
'Чтобы {{hacker.verb}} {{hacker.noun}}, мы можем получить {{hacker.abbreviation}} {{hacker.noun}} через {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}!',
9+
'Я планирую {{hacker.verb}} {{hacker.adjective}} {{hacker.abbreviation}} {{hacker.noun}}, это должно помочь {{hacker.verb}} {{hacker.abbreviation}} {{hacker.noun}}!',
1010
];

src/locales/zh_CN/hacker/phrase.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
export default [
2-
'{{abbreviation}}{{noun}}已关闭,因为{{adjective}}{{noun}}所以我们能{{verb}}{{abbreviation}}{{noun}}!',
3-
'{{verb}}{{noun}}是无济于事的,我们需要{{verb}}{{adjective}}{{abbreviation}}{{noun}}!',
4-
'使用{{adjective}}{{abbreviation}}{{noun}},然后你就能{{verb}}{{adjective}}{{noun}}!',
5-
'倘若我们{{verb}}{{noun}},我们就可以通过{{adjective}}{{abbreviation}}{{noun}}获得{{abbreviation}}{{noun}}!',
6-
'在没有{{verb}}{{adjective}}{{abbreviation}}{{noun}}的情况下,你不能{{verb}}{{noun}}!',
7-
'尝试{{verb}}{{abbreviation}}{{noun}},也许会{{verb}}{{adjective}}{{noun}}!',
8-
'我们需要{{verb}}{{adjective}}{{abbreviation}}{{noun}}!',
9-
'我将{{verb}}{{adjective}}{{abbreviation}}{{noun}},那是应该{{noun}}{{abbreviation}}{{noun}}!',
2+
'{{hacker.abbreviation}}{{hacker.noun}}已关闭,因为{{hacker.adjective}}{{hacker.noun}}所以我们能{{hacker.verb}}{{hacker.abbreviation}}{{hacker.noun}}!',
3+
'{{hacker.verb}}{{hacker.noun}}是无济于事的,我们需要{{hacker.verb}}{{hacker.adjective}}{{hacker.abbreviation}}{{hacker.noun}}!',
4+
'使用{{hacker.adjective}}{{hacker.abbreviation}}{{hacker.noun}},然后你就能{{hacker.verb}}{{hacker.adjective}}{{hacker.noun}}!',
5+
'倘若我们{{hacker.verb}}{{hacker.noun}},我们就可以通过{{hacker.adjective}}{{hacker.abbreviation}}{{hacker.noun}}获得{{hacker.abbreviation}}{{hacker.noun}}!',
6+
'在没有{{hacker.verb}}{{hacker.adjective}}{{hacker.abbreviation}}{{hacker.noun}}的情况下,你不能{{hacker.verb}}{{hacker.noun}}!',
7+
'尝试{{hacker.verb}}{{hacker.abbreviation}}{{hacker.noun}},也许会{{hacker.verb}}{{hacker.adjective}}{{hacker.noun}}!',
8+
'我们需要{{hacker.verb}}{{hacker.adjective}}{{hacker.abbreviation}}{{hacker.noun}}!',
9+
'我将{{hacker.verb}}{{hacker.adjective}}{{hacker.abbreviation}}{{hacker.noun}},那是应该{{hacker.noun}}{{hacker.abbreviation}}{{hacker.noun}}!',
1010
];

src/modules/hacker/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,6 @@ export class HackerModule extends ModuleBase {
9292
* @since 2.0.1
9393
*/
9494
phrase(): string {
95-
const data = {
96-
abbreviation: this.abbreviation,
97-
adjective: this.adjective,
98-
ingverb: this.ingverb,
99-
noun: this.noun,
100-
verb: this.verb,
101-
};
102-
103-
const phrase = this.faker.helpers.arrayElement(
104-
this.faker.definitions.hacker.phrase
105-
);
106-
return this.faker.helpers.mustache(phrase, data);
95+
return this.faker.helpers.fake(this.faker.definitions.hacker.phrase);
10796
}
10897
}

test/modules/__snapshots__/hacker.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exports[`hacker > 42 > ingverb 1`] = `"copying"`;
88

99
exports[`hacker > 42 > noun 1`] = `"driver"`;
1010

11-
exports[`hacker > 42 > phrase 1`] = `"The VGA bandwidth is down, reboot the online bandwidth so we can navigate the SQL application!"`;
11+
exports[`hacker > 42 > phrase 1`] = `"The SQL bandwidth is down, bypass the online alarm so we can quantify the CSS circuit!"`;
1212

1313
exports[`hacker > 42 > verb 1`] = `"generate"`;
1414

@@ -20,7 +20,7 @@ exports[`hacker > 1211 > ingverb 1`] = `"synthesizing"`;
2020

2121
exports[`hacker > 1211 > noun 1`] = `"system"`;
2222

23-
exports[`hacker > 1211 > phrase 1`] = `"transmitting the panel won't do anything, we need to program the cross-platform USB panel!"`;
23+
exports[`hacker > 1211 > phrase 1`] = `"compressing the panel won't do anything, we need to program the optical SSL program!"`;
2424

2525
exports[`hacker > 1211 > verb 1`] = `"synthesize"`;
2626

@@ -32,6 +32,6 @@ exports[`hacker > 1337 > ingverb 1`] = `"connecting"`;
3232

3333
exports[`hacker > 1337 > noun 1`] = `"card"`;
3434

35-
exports[`hacker > 1337 > phrase 1`] = `"The COM circuit is down, transmit the multi-byte interface so we can program the FTP card!"`;
35+
exports[`hacker > 1337 > phrase 1`] = `"The FTP circuit is down, connect the primary feed so we can calculate the JBOD program!"`;
3636

3737
exports[`hacker > 1337 > verb 1`] = `"connect"`;

0 commit comments

Comments
 (0)