diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/index.js | 4 | ||||
| -rw-r--r-- | lib/locales/en/vehicle/fuel.js | 6 | ||||
| -rw-r--r-- | lib/locales/en/vehicle/index.js | 7 | ||||
| -rw-r--r-- | lib/locales/en/vehicle/manufacturer.js | 30 | ||||
| -rw-r--r-- | lib/locales/en/vehicle/model.js | 54 | ||||
| -rw-r--r-- | lib/locales/en/vehicle/vehicle_type.js | 13 | ||||
| -rw-r--r-- | lib/locales/en/vehicle/vin.js | 27 | ||||
| -rw-r--r-- | lib/vehicle.js | 78 |
8 files changed, 219 insertions, 0 deletions
diff --git a/lib/index.js b/lib/index.js index 58f0012e..1d557ef9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -99,6 +99,9 @@ function Faker (opts) { var System = require('./system'); self.system = bindAll(new System(self)); + var Vehicle = require('./vehicle') + self.vehicle = bindAll(new Vehicle(self)) + var _definitions = { "name": ["first_name", "last_name", "prefix", "suffix", "gender", "title", "male_first_name", "female_first_name", "male_middle_name", "female_middle_name", "male_last_name", "female_last_name"], "address": ["city_prefix", "city_suffix", "street_suffix", "county", "country", "country_code", "state", "state_abbr", "street_prefix", "postcode"], @@ -112,6 +115,7 @@ function Faker (opts) { "database": ["collation", "column", "engine", "type"], "system": ["mimeTypes"], "date": ["month", "weekday"], + "vehicle": ["manufacturer", "model", "type", "fuel", "vin"], "title": "", "separator": "" }; diff --git a/lib/locales/en/vehicle/fuel.js b/lib/locales/en/vehicle/fuel.js new file mode 100644 index 00000000..dfea6984 --- /dev/null +++ b/lib/locales/en/vehicle/fuel.js @@ -0,0 +1,6 @@ +module["exports"] = [ + "Diesel", + "Electric", + "Gasoline", + "Hybrid" +] diff --git a/lib/locales/en/vehicle/index.js b/lib/locales/en/vehicle/index.js new file mode 100644 index 00000000..23286869 --- /dev/null +++ b/lib/locales/en/vehicle/index.js @@ -0,0 +1,7 @@ +var vehicle = {}; +module["exports"] = vehicle; +vehicle.manufacturer = require("./manufacturer") +vehicle.model = require("./model") +vehicle.type = require("./vehicle_type") +vehicle.fuelType = require("./fuel") +vehicle.vin = require("./vin"); diff --git a/lib/locales/en/vehicle/manufacturer.js b/lib/locales/en/vehicle/manufacturer.js new file mode 100644 index 00000000..c3ed0ef2 --- /dev/null +++ b/lib/locales/en/vehicle/manufacturer.js @@ -0,0 +1,30 @@ +module["exports"] = [ + "Chevrolet", + "Cadillac", + "Ford", + "Chrysler", + "Dodge", + "Jeep", + "Tesla", + "Toyota", + "Honda", + "Nissan", + "Audi", + "Mercedes Benz", + "BMW", + "Volkswagen", + "Porsche", + "Jaguar", + "Aston Martin", + "Land Rover", + "Bentley", + "Mini", + "Rolls Royce", + "Fiat", + "Lamborghini", + "Maserati", + "Ferrari", + "Bugatti", + "Kia", + "Hyandai" +] diff --git a/lib/locales/en/vehicle/model.js b/lib/locales/en/vehicle/model.js new file mode 100644 index 00000000..fb5fce46 --- /dev/null +++ b/lib/locales/en/vehicle/model.js @@ -0,0 +1,54 @@ +module["exports"] = [ + "Fiesta", + "Focus", + "Taurus", + "Mustang", + "Explorer", + "Expedition", + "F-150", + "Model T", + "Ranchero", + "Volt", + "Cruze", + "Malibu", + "Impala", + "Camaro", + "Corvette", + "Colorado", + "Silverado", + "El Camino", + "CTS", + "XTS", + "ATS", + "Escalade", + "Alpine", + "Charger", + "LeBaron", + "PT Cruiser", + "Challenger", + "Durango", + "Grand Caravan", + "Wrangler", + "Grand Cherokee", + "Roadster", + "Model S", + "Model 3", + "Camry", + "Prius", + "Land Cruiser", + "Accord", + "Civic", + "Element", + "Sentra", + "Altima", + "A8", + "A4", + "Beetle", + "Jetta", + "Golf", + "911", + "Spyder", + "Countach", + "Mercielago", + "Aventador", +] diff --git a/lib/locales/en/vehicle/vehicle_type.js b/lib/locales/en/vehicle/vehicle_type.js new file mode 100644 index 00000000..ffb75ee2 --- /dev/null +++ b/lib/locales/en/vehicle/vehicle_type.js @@ -0,0 +1,13 @@ +module["exports"] = [ + "Cargo Van", + "Convertible", + "Coupe", + "Crew Cab Pickup", + "Extended Cab Pickup", + "Hatchback", + "Minivan", + "Passenger Van", + "SUV", + "Sedan", + "Wagon" +] diff --git a/lib/locales/en/vehicle/vin.js b/lib/locales/en/vehicle/vin.js new file mode 100644 index 00000000..df9acf9f --- /dev/null +++ b/lib/locales/en/vehicle/vin.js @@ -0,0 +1,27 @@ +module["exports"] = [ + "YV1MH682762184654", + "3C7WRMBJ2EG208836", + "1XKWDR9X42J863498", + "2FMDA57654BA77288", + "JHLRD1847YC821344", + "1G6DR57V590113710", + "1FTSS34S86HB84565", + "1FV6GFAC5PL451813", + "KNAHG8A84C7316995", + "1HTGGAET8XH665987", + "JH4DB7547RS045548", + "1FV6HFAA6TL540750", + "4MZKP58C5Y3588905", + "1FUWDMDAXYMG33095", + "3C63DRBL6CG348745", + "3FALP6538TM150377", + "1FALP1285SW356662", + "1FTSF21Y88ED71476", + "5KMMSG1ZX55130658", + "1HTSCABP52H511324", + "1J4GW58N2XC780094", + "4T1BG28K0YU968668", + "1GCDT349788280094", + "2FDHF38M0RCA15805", + "2GTEK19J971693201" +] diff --git a/lib/vehicle.js b/lib/vehicle.js new file mode 100644 index 00000000..bd15b0aa --- /dev/null +++ b/lib/vehicle.js @@ -0,0 +1,78 @@ +/** + * + * @namespace faker.vehicle + */ +var Vehicle = function (faker) { + var self = this; + /** + * manufacturer + * + * @method faker.database.manufacturer + */ + self.manufacturer = function () { + return faker.random.arrayElement(faker.definitions.vehicle.manufacturer); + }; + + self.manufacturer.schema = { + "description": "Generates a manufacturer name.", + "sampleResults": ["Ford", "Jeep", "Tesla"] + }; + + /** + * model + * + * @method faker.vehicle.model + */ + self.model = function () { + return faker.random.arrayElement(faker.definitions.vehicle.model); + }; + + self.model.schema = { + "description": "Generates a vehicle model.", + "sampleResults": ["Explorer", "Camry", "Ranchero"] + }; + + /** + * type + * + * @method faker.vehicle.type + */ + self.type = function () { + return faker.random.arrayElement(faker.definitions.vehicle.type); + }; + + self.type.schema = { + "description": "Generates a vehicle type.", + "sampleResults": ["Coupe", "Convertable", "Sedan", "SUV"] + }; + + /** + * fuel + * + * @method faker.vehicle.fuel + */ + self.fuel = function () { + return faker.random.arrayElement(faker.definitions.vehicle.fuel); + }; + + self.fuel.schema = { + "description": "Generates a fuel type.", + "sampleResults": ["Electric", "Gasoline", "Diesel"] + }; + + /** + * vin + * + * @method faker.vehicle.vin + */ + self.vin = function () { + return faker.random.arrayElement(faker.definitions.vehicle.vin); + }; + + self.vin.schema = { + "description": "Generates a VIN number.", + "sampleResults": ["YV1MH682762184654", "3C7WRMBJ2EG208836"] + }; +}; + +module["exports"] = Vehicle; |
