-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from helpscout/security-and-avatar
Update packages & es module only
- Loading branch information
Showing
37 changed files
with
8,271 additions
and
5,150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
{ | ||
"presets": ["./scripts/babel-preset-env"], | ||
"env": { | ||
"development": { | ||
"presets": ["es2015"], | ||
}, | ||
"umd": { | ||
"plugins": [ | ||
"transform-es2015-modules-umd" | ||
] | ||
} | ||
} | ||
"presets": [ | ||
[ | ||
"@babel/env", | ||
{ | ||
"targets": ">0.25%" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,40 +2,37 @@ | |
|
||
A hook to adjust the fixture output (`object`) of the HelixSpec that is called right after the fixture is [generated](./generate.md). | ||
|
||
|
||
### Arguments | ||
|
||
| Argument | Type | Description | | ||
| --- | --- | --- | | ||
| `callback` | `function` | Callback function to adjust the fixture data. | | ||
| `data` | `object` | Generated fixture data passed into the `callback`. | | ||
|
||
| Argument | Type | Description | | ||
| ---------- | ---------- | -------------------------------------------------- | | ||
| `callback` | `function` | Callback function to adjust the fixture data. | | ||
| `data` | `object` | Generated fixture data passed into the `callback`. | | ||
|
||
### Returns | ||
|
||
`HelixSpec`: Returns itself. | ||
|
||
|
||
### Example | ||
|
||
```js | ||
const Dinosaur = createSpec({ | ||
id: faker.random.number(), | ||
id: faker.datatype.number(), | ||
name: faker.name.firstName(), | ||
location: faker.address.country() | ||
}) | ||
location: faker.address.country(), | ||
}); | ||
|
||
Dinosaur.afterGenerate(data => { | ||
const { name } = data | ||
Dinosaur.afterGenerate((data) => { | ||
const { name } = data; | ||
return { | ||
name, | ||
location: 'Mexico', | ||
status: 'Happy', | ||
email: '[email protected]' | ||
} | ||
}) | ||
location: "Mexico", | ||
status: "Happy", | ||
email: "[email protected]", | ||
}; | ||
}); | ||
|
||
Dinosaur.generate() | ||
Dinosaur.generate(); | ||
// { | ||
// name: 'Alice', | ||
// location: 'Mexico' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.