Skip to content

Commit d0a473f

Browse files
authored
fix: solve various todos (#649)
1 parent fe62c19 commit d0a473f

File tree

4 files changed

+14
-22
lines changed

4 files changed

+14
-22
lines changed

src/address.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,6 @@ export class Address {
171171
return result;
172172
}
173173

174-
//
175-
// TODO: change all these methods that accept a boolean to instead accept an options hash.
176-
//
177-
178174
/**
179175
* Generates a random localized street address.
180176
*
@@ -308,13 +304,10 @@ export class Address {
308304
/**
309305
* Returns a random localized state from this country.
310306
*
311-
* @param useAbbr This parameter does nothing.
312-
*
313307
* @example
314308
* faker.address.state() // 'Georgia'
315309
*/
316-
// TODO @Shinigami92 2022-01-13: useAbbr not in use
317-
state(useAbbr?: boolean): string {
310+
state(): string {
318311
return this.faker.random.arrayElement(this.faker.definitions.address.state);
319312
}
320313

src/faker.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ export class Faker {
7070
readonly finance = new Finance(this);
7171
readonly git: Git = new Git(this);
7272
readonly hacker: Hacker = new Hacker(this);
73-
// TODO @Shinigami92 2022-01-12: iban was not used
74-
// readonly iban = new (require('./iban'))(this);
7573
readonly image: Image = new Image(this);
7674
readonly internet: Internet = new Internet(this);
7775
readonly lorem: Lorem = new Lorem(this);

src/internet.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,18 @@ export class Internet {
203203
* @example
204204
* faker.internet.ip() // '245.108.222.0'
205205
*/
206-
// TODO @Shinigami92 2022-01-23: Add ipv4 alias
207206
ip(): string {
207+
// TODO @Shinigami92 2022-03-21: We may want to return a IPv4 or IPv6 address here in a later major release
208+
return this.ipv4();
209+
}
210+
211+
/**
212+
* Generates a random IPv4 address.
213+
*
214+
* @example
215+
* faker.internet.ipv4() // '245.108.222.0'
216+
*/
217+
ipv4(): string {
208218
const randNum = () => {
209219
return this.faker.datatype.number(255).toFixed(0);
210220
};

src/lorem.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,15 @@ export class Lorem {
6464
* Generates a space separated list of words beginning a capital letter and ending with a dot.
6565
*
6666
* @param wordCount The number of words, that should be in the sentence. Defaults to a random number between `3` and `10`.
67-
* @param range Currently this parameter does nothing.
6867
*
6968
* @example
7069
* faker.lorem.sentence() // 'Voluptatum cupiditate suscipit autem eveniet aut dolorem aut officiis distinctio.'
7170
* faker.lorem.sentence(5) // 'Laborum voluptatem officiis est et.'
7271
*/
73-
// TODO @Shinigami92 2022-01-11: `range` is not in use
74-
sentence(wordCount?: number, range?: number): string {
72+
sentence(wordCount?: number): string {
7573
if (typeof wordCount === 'undefined') {
7674
wordCount = this.faker.datatype.number({ min: 3, max: 10 });
7775
}
78-
// if (typeof range == 'undefined') { range = 7; }
79-
80-
// strange issue with the node_min_test failing for capitalize, please fix and add faker.lorem.back
81-
//return faker.lorem.words(wordCount + Helpers.randomNumber(range)).join(' ').capitalize();
8276

8377
const sentence = this.faker.lorem.words(wordCount);
8478
return sentence.charAt(0).toUpperCase() + sentence.slice(1) + '.';
@@ -174,8 +168,6 @@ export class Lorem {
174168
/**
175169
* Generates a random text based on a random lorem method.
176170
*
177-
* @param times This parameter does nothing.
178-
*
179171
* @example
180172
* faker.lorem.text() // 'Doloribus autem non quis vero quia.'
181173
* faker.lorem.text()
@@ -185,8 +177,7 @@ export class Lorem {
185177
* // Iure nam officia optio cumque.
186178
* // Dolor tempora iusto.'
187179
*/
188-
// TODO @Shinigami92 2022-01-11: `times` is not in use
189-
text(times?: number): string {
180+
text(): string {
190181
const loremMethods = [
191182
'lorem.word',
192183
'lorem.words',

0 commit comments

Comments
 (0)