Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Marak/faker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fariborzemami committed Aug 2, 2020
2 parents 2749f77 + a0eefbb commit 61e3ee3
Showing 79 changed files with 7,360 additions and 1,045 deletions.
10 changes: 5 additions & 5 deletions CODE_OF_MERIT.MD
Original file line number Diff line number Diff line change
@@ -6,10 +6,10 @@ of the project, technical or otherwise, including overruling previous decisions.
There are no limitations to this decisional power.

2. Contributions are an expected result of your membership on the project.
Don't expect others to do your work or help you with your work forever.
Don't expect others to do your work or help you with your work forever.

3. All members have the same opportunities to seek any challenge they want
within the project.
within the project.

4. Authority or position in the project will be proportional
to the accrued contribution. Seniority must be earned.
@@ -39,8 +39,8 @@ of the originator to provide requested context.
in the scope of the project. This Code of Merit does not take precedence over
governing law.

12. This Code of Merit governs the technical procedures of the project not the
activities outside of it.
12. This Code of Merit governs the technical procedures of the project not the
activities outside of it.

13. Participation on the project equates to agreement of this Code of Merit.

@@ -49,4 +49,4 @@ to the project. Any intent to deviate the project from its original purpose
of existence will constitute grounds for remedial action which may include
expulsion from the project.

This document is the Code of Merit (http://code-of-merit.org), version 1.0.
This document is the Code of Merit (https://codeofmerit.org/), version 1.0.
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -90,6 +90,7 @@ This will interpolate the format string with the value of methods `name.lastName
* productAdjective
* productMaterial
* product
* productDescription
* company
* suffixes
* companyName
@@ -259,6 +260,7 @@ faker.locale = "de";
* en_GB
* en_IE
* en_IND
* en_NG
* en_US
* en_ZA
* en_au_ocker
9 changes: 9 additions & 0 deletions lib/commerce.js
Original file line number Diff line number Diff line change
@@ -113,6 +113,15 @@ var Commerce = function (faker) {
return faker.random.arrayElement(faker.definitions.commerce.product_name.product);
};

/**
* productDescription
*
* @method faker.commerce.productDescription
*/
self.productDescription = function() {
return faker.random.arrayElement(faker.definitions.commerce.product_description);
};

return self;
};

19 changes: 18 additions & 1 deletion lib/finance.js
Original file line number Diff line number Diff line change
@@ -110,8 +110,9 @@ var Finance = function (faker) {
dec = dec === undefined ? 2 : dec;
symbol = symbol || '';
var randValue = faker.random.number({ max: max, min: min, precision: Math.pow(10, -dec) });
var stringNumber = symbol + randValue.toFixed(dec);

return symbol + randValue.toFixed(dec);
return Number(stringNumber);
};

/**
@@ -171,6 +172,22 @@ var Finance = function (faker) {
return address;
}

/**
* litecoinAddress
*
* @method faker.finance.litecoinAddress
*/
self.litecoinAddress = function () {
var addressLength = faker.random.number({ min: 26, max: 33 });

var address = faker.random.arrayElement(['L', 'M', '3']);

for (var i = 0; i < addressLength - 1; i++)
address += faker.random.arrayElement('123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'.split(''));

return address;
}

/**
* Credit card number
* @method faker.finance.creditCardNumber
4 changes: 2 additions & 2 deletions lib/image.js
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ var Image = function (faker) {
if (typeof https !== 'undefined' && https === true) {
protocol = 'https://';
}
var url = protocol + 'lorempixel.com/' + width + '/' + height;
var url = protocol + 'placeimg.com/' + width + '/' + height;
if (typeof category !== 'undefined') {
url += '/' + category;
}
@@ -224,4 +224,4 @@ var Image = function (faker) {
}


module["exports"] = Image;
module["exports"] = Image;
2 changes: 1 addition & 1 deletion lib/image_providers/lorempixel.js
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ var Lorempixel = function (faker) {
var width = width || 640;
var height = height || 480;

var url ='http://lorempixel.com/' + width + '/' + height;
var url ='https://lorempixel.com/' + width + '/' + height;
if (typeof category !== 'undefined') {
url += '/' + category;
}
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
@@ -83,6 +83,9 @@ function Faker (opts) {
var _Date = require('./date');
self.date = new _Date(self);

var _Time = require('./time');
self.time = new _Time(self);

var Commerce = require('./commerce');
self.commerce = new Commerce(self);

@@ -104,7 +107,7 @@ function Faker (opts) {
"phone_number": ["formats"],
"finance": ["account_type", "transaction_type", "currency", "iban", "credit_card"],
"internet": ["avatar_uri", "domain_suffix", "free_email", "example_email", "password"],
"commerce": ["color", "department", "product_name", "price", "categories"],
"commerce": ["color", "department", "product_name", "price", "categories", "product_description"],
"database": ["collation", "column", "engine", "type"],
"system": ["mimeTypes", "directoryPaths"],
"date": ["month", "weekday"],
2 changes: 1 addition & 1 deletion lib/internet.js
Original file line number Diff line number Diff line change
@@ -351,7 +351,7 @@ var Internet = function (faker) {
* Copyright(c) 2011-2013 Bermi Ferrer <[email protected]>
* MIT Licensed
*/
var consonant, letter, password, vowel;
var consonant, letter, vowel;
letter = /[a-zA-Z]$/;
vowel = /[aeiouAEIOU]$/;
consonant = /[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]$/;
2 changes: 1 addition & 1 deletion lib/locales/ar/address/country.js
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ module["exports"] = [
"جزيرة عيد الميلاد",
"جزر كوكوس",
"كولومبيا",
"Comoros",
"جزر القمر",
"كونجو",
"جزر كوك",
"كوستا ريكا",
5 changes: 4 additions & 1 deletion lib/locales/ar/address/secondary_address.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module["exports"] = [
"### عمارة",
"### طابق"
"### طابق",
"### شقة",
"### بناية",
"### بيت"
];
4 changes: 2 additions & 2 deletions lib/locales/ar/address/street_name.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module["exports"] = [
"#{street_preffix} #{Name.first_name}",
"#{street_preffix} #{Name.last_name}"
"#{street_prefix} #{Name.first_name}",
"#{street_prefix} #{Name.last_name}"
];
45 changes: 23 additions & 22 deletions lib/locales/ar/commerce/color.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
module["exports"] = [
"أحمر",
"أحمر غامق",
"أحمر فاتح",
"أخضر",
"أخضر غامق",
"أخضر فاتح",
"زيتوني",
"فيروزي",
"أزرق",
"أزرق غامق",
"أزرق فاتح",
"تركواز",
"أزرق سماوي",
"أصفر",
"purple",
"mint green",
"teal",
"ليموني",
"أرجواني",
"بنفسجي",
"أرجواني فاتح",
"أرجواني خفيف",
"أبيض",
"أسود",
"برتقالي",
"pink",
"زهري",
"بني",
"maroon",
"بنفسجي",
"turquoise",
"tan",
"sky blue",
"salmon",
"plum",
"orchid",
"olive",
"magenta",
"lime",
"ivory",
"indigo",
"كستنائي",
"أسمر",
"عاجي",
"نيلي",
"ذهبي",
"fuchsia",
"cyan",
"azure",
"lavender",
"فضي"
"فضي",
"رمادي",
"رصاصي"
];
12 changes: 6 additions & 6 deletions lib/locales/ar/commerce/department.js
Original file line number Diff line number Diff line change
@@ -4,19 +4,19 @@ module["exports"] = [
"إلكترونيات",
"حواسيب",
"بيت",
"Garden",
"حديقة",
"أدوات",
"Grocery",
"بقالة",
"صحة",
"جمال",
"Toys",
"ألعاب",
"أطفال",
"رضع",
"ملابس",
"أحذية",
"Jewelery",
"مجوهرات",
"أغراض رياضية",
"Outdoors",
"Automotive",
"في الهواء الطلق",
"السيارات",
"صناعة"
];
5 changes: 3 additions & 2 deletions lib/locales/ar/commerce/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
var commerce = {};
module['exports'] = commerce;
module["exports"] = commerce;
commerce.color = require("./color");
commerce.department = require("./department");
commerce.department = require("./department");
commerce.product_name = require("./product_name");
59 changes: 59 additions & 0 deletions lib/locales/ar/commerce/product_name.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module["exports"] = {
"adjective": [
"صغير",
"مريح",
"ريفي",
"ذكي",
"رائع",
"لا يصدق",
"عملي",
"أملس",
"ممتاز",
"عام",
"يدويا",
"صنع يدوي",
"مرخص",
"مشتق",
"بدون علامة",
"طيب المذاق"
],
"material": [
"فولاذ",
"خشبي",
"خرسانة",
"بلاستيك",
"قطن",
"صوان",
"مطاط",
"معدن",
"ناعم",
"طازج",
"مجمد"
],
"product": [
"كرسي",
"سيارة",
"حاسوب",
"لوحة المفاتيح",
"فأر",
"دراجة هوائية",
"كرة",
"قفازات",
"بنطال",
"قميص",
"طاولة",
"أحذية",
"قبعة",
"مناشف",
"صابون",
"تونة",
"دجاج",
"سمك",
"جبن",
"لحم خنزير مقدد",
"بيتزا",
"سلطة",
"سجق",
"رقائق بطاطس"
]
};
6 changes: 4 additions & 2 deletions lib/locales/ar/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
var ar = {};
module['exports'] = ar;
module["exports"] = ar;
ar.title = "Arabic";
ar.separator = " & ";
ar.address = require("./address");
ar.phone_number = require("./phone_number");
ar.cell_phone = require("./cell_phone");
ar.commerce = require("./commerce");
ar.commerce = require("./commerce");
ar.vehicle = require("./vehicle");
ar.team = require("./team");
Loading
Oops, something went wrong.

0 comments on commit 61e3ee3

Please sign in to comment.