@unmock/jaymock
Advanced tools
Comparing version 1.0.5 to 1.0.6
declare namespace jaymock { | ||
type ExtensionName = string | {[key: string]: Function}; | ||
type Functions = {[key: string]: Function}; | ||
type Instance = {template: jaymock.Template, functions: jaymock.Functions} | ||
interface Template { | ||
@@ -11,33 +10,32 @@ [key: string]: string | number | Template; | ||
} | ||
interface Method { | ||
/** | ||
Populates the template object with fake data. | ||
@param template - A [`template`](https://github.com/unmock/jaymock#template) object to populate. | ||
@returns An `object` populated with fake data. | ||
*/ | ||
populate(template: jaymock.Template): jaymock.Populated; | ||
} | ||
/** | ||
Adds a custom data generation function that can be called in the `populate` `template` object using the value of its `name`. | ||
@param name - A `string` used to refer to the `body` function. | ||
@param body - A `function` that can be referred to in the `template` object. | ||
*/ | ||
extend(name: jaymock.ExtensionName, body?: Function): void; | ||
declare function jaymock(): { | ||
/** | ||
Populates the template object with fake data. | ||
@param template - A [`template`](https://github.com/unmock/jaymock#template) object to populate. | ||
@returns An `object` populated with fake data. | ||
*/ | ||
populate(template: jaymock.Template): jaymock.Populated; | ||
/** | ||
Sets `Faker.js`'s language locale. | ||
@param locale - `Faker.js` locale. | ||
*/ | ||
setFakerLocale(locale: string): void; | ||
/** | ||
Adds a custom data generation function that can be called in the `populate` `template` object using the value of its `name`. | ||
@param name - A `string` used to refer to the `body` function. | ||
@param body - A `function` that can be referred to in the `template` object. | ||
*/ | ||
extend(name: jaymock.ExtensionName, body?: Function): void; | ||
/** | ||
Sets `Faker.js`'s randomness seed. | ||
@param seed - `Faker.js` randomness seed. | ||
*/ | ||
setFakerSeed(seed: number): void; | ||
} | ||
} | ||
/** | ||
Sets `Faker.js`'s language locale. | ||
@param locale - `Faker.js` locale. | ||
*/ | ||
setFakerLocale(locale: string): void; | ||
declare function jaymock(): jaymock.Instance & jaymock.Method; | ||
/** | ||
Sets `Faker.js`'s randomness seed. | ||
@param seed - `Faker.js` randomness seed. | ||
*/ | ||
setFakerSeed(seed: number): void; | ||
}; | ||
export = jaymock; |
{ | ||
"name": "@unmock/jaymock", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Minimal fake JSON test data generator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11300
224