diff --git a/src/address.ts b/src/address.ts index eff72f2f58c..ec137ad27c7 100644 --- a/src/address.ts +++ b/src/address.ts @@ -171,10 +171,6 @@ export class Address { return result; } - // - // TODO: change all these methods that accept a boolean to instead accept an options hash. - // - /** * Generates a random localized street address. * @@ -308,13 +304,10 @@ export class Address { /** * Returns a random localized state from this country. * - * @param useAbbr This parameter does nothing. - * * @example * faker.address.state() // 'Georgia' */ - // TODO @Shinigami92 2022-01-13: useAbbr not in use - state(useAbbr?: boolean): string { + state(): string { return this.faker.random.arrayElement(this.faker.definitions.address.state); } diff --git a/src/faker.ts b/src/faker.ts index 572bbaf2338..e2530f1642c 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -70,8 +70,6 @@ export class Faker { readonly finance = new Finance(this); readonly git: Git = new Git(this); readonly hacker: Hacker = new Hacker(this); - // TODO @Shinigami92 2022-01-12: iban was not used - // readonly iban = new (require('./iban'))(this); readonly image: Image = new Image(this); readonly internet: Internet = new Internet(this); readonly lorem: Lorem = new Lorem(this); diff --git a/src/internet.ts b/src/internet.ts index f80059f90ed..f247f06b4a9 100644 --- a/src/internet.ts +++ b/src/internet.ts @@ -203,8 +203,18 @@ export class Internet { * @example * faker.internet.ip() // '245.108.222.0' */ - // TODO @Shinigami92 2022-01-23: Add ipv4 alias ip(): string { + // TODO @Shinigami92 2022-03-21: We may want to return a IPv4 or IPv6 address here in a later major release + return this.ipv4(); + } + + /** + * Generates a random IPv4 address. + * + * @example + * faker.internet.ipv4() // '245.108.222.0' + */ + ipv4(): string { const randNum = () => { return this.faker.datatype.number(255).toFixed(0); }; diff --git a/src/lorem.ts b/src/lorem.ts index 296c88b50c0..4612fe2d1f6 100644 --- a/src/lorem.ts +++ b/src/lorem.ts @@ -64,21 +64,15 @@ export class Lorem { * Generates a space separated list of words beginning a capital letter and ending with a dot. * * @param wordCount The number of words, that should be in the sentence. Defaults to a random number between `3` and `10`. - * @param range Currently this parameter does nothing. * * @example * faker.lorem.sentence() // 'Voluptatum cupiditate suscipit autem eveniet aut dolorem aut officiis distinctio.' * faker.lorem.sentence(5) // 'Laborum voluptatem officiis est et.' */ - // TODO @Shinigami92 2022-01-11: `range` is not in use - sentence(wordCount?: number, range?: number): string { + sentence(wordCount?: number): string { if (typeof wordCount === 'undefined') { wordCount = this.faker.datatype.number({ min: 3, max: 10 }); } - // if (typeof range == 'undefined') { range = 7; } - - // strange issue with the node_min_test failing for capitalize, please fix and add faker.lorem.back - //return faker.lorem.words(wordCount + Helpers.randomNumber(range)).join(' ').capitalize(); const sentence = this.faker.lorem.words(wordCount); return sentence.charAt(0).toUpperCase() + sentence.slice(1) + '.'; @@ -174,8 +168,6 @@ export class Lorem { /** * Generates a random text based on a random lorem method. * - * @param times This parameter does nothing. - * * @example * faker.lorem.text() // 'Doloribus autem non quis vero quia.' * faker.lorem.text() @@ -185,8 +177,7 @@ export class Lorem { * // Iure nam officia optio cumque. * // Dolor tempora iusto.' */ - // TODO @Shinigami92 2022-01-11: `times` is not in use - text(times?: number): string { + text(): string { const loremMethods = [ 'lorem.word', 'lorem.words',