Faker.js: Calling random.uuid results in self.number is not a function (4.1)

Created on 6 Jun 2019  路  3Comments  路  Source: Marak/faker.js

I believe this is connected to #368 and #377
. It seems as if the source has been changed to faker.random.number which solved the problem, however, 4.1 changed back to

  this.uuid = function () {
      var self = this;
      var RFC4122_TEMPLATE = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
      var replacePlaceholders = function (placeholder) {
          var random = self.number({ min: 0, max: 15 });
          var value = placeholder == 'x' ? random : (random &0x3 | 0x8);
          return value.toString(16);
      };
      return RFC4122_TEMPLATE.replace(/[xy]/g, replacePlaceholders);
  }

Is there any known solution to this problem?

Most helpful comment

Looks like this is fixed in master, but not 4.1.

master version: https://github.com/Marak/faker.js/blob/master/lib/random.js#L145
4.1 version: https://github.com/Marak/faker.js/blob/v4.1.0/lib/random.js#L93

I'm seeing this issue when configuring faker with a seed.

All 3 comments

Invalid issue report.

You are referencing a previous version of the library.

Code is here: https://github.com/Marak/faker.js/blob/d3ce6f1a2a9359574e7f31f14d4901648047c45a/lib/random.js#L142

Looks like this is fixed in master, but not 4.1.

master version: https://github.com/Marak/faker.js/blob/master/lib/random.js#L145
4.1 version: https://github.com/Marak/faker.js/blob/v4.1.0/lib/random.js#L93

I'm seeing this issue when configuring faker with a seed.

Same here. I had to pin the github repo instead of npm release, when using it with seed.

@Marak can you release new version please?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jnardone picture jnardone  路  6Comments

aadamsx picture aadamsx  路  6Comments

chenweiyj picture chenweiyj  路  4Comments

marcelorl picture marcelorl  路  4Comments

clarmso picture clarmso  路  3Comments