Skip to content

Commit

Permalink
Fixed issue in node v10 build
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickroberts committed Sep 25, 2020
1 parent 166151d commit d2947da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions features/support/world.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ export default class World extends Map<string, any> implements IWorldOptions {
parseProps (dataTable: DataTable): any {
const entries = dataTable.raw();

return Object.fromEntries(
entries.map(
([key, token]) => [key, this.parse(token)]
)
return entries.map(
([key, token]) => [key, this.parse(token)]
).reduce(
(props, [key, value]) => Object.assign(props, { [key]: value }),
{}
);
}

private parse (token: string): any {
const arrayMatch = token.match(array);

if (arrayMatch !== null) {
return arrayMatch[1].split(',').map(value => this.parse(value.trim()));
return arrayMatch[1].split(',').map(
value => this.parse(value.trim())
);
}

if (literal.test(token)) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suspense-service",
"version": "0.0.1-rc",
"version": "0.0.2-rc",
"description": "Suspense integration library for React",
"repository": "github:patrickroberts/suspense-service",
"main": "dst/cjs/suspense-service.js",
Expand Down

0 comments on commit d2947da

Please sign in to comment.