Transpiled ES5 code to ES6/ES7

This commit is contained in:
Liyas Thomas
2020-06-11 19:55:40 +05:30
parent 9bc0ae975a
commit 0644a8c9fb
16 changed files with 108 additions and 123 deletions

View File

@@ -64,14 +64,11 @@ export default {
computed: {
fieldString() {
const args = (this.gqlField.args || []).reduce((acc, arg, index) => {
return (
acc +
`${arg.name}: ${arg.type.toString()}${
index !== this.gqlField.args.length - 1 ? ", " : ""
}`
)
}, "")
const args = (this.gqlField.args || []).reduce(
(acc, { name, type }, index) =>
acc + `${name}: ${type.toString()}${index !== this.gqlField.args.length - 1 ? ", " : ""}`,
""
)
const argsString = args.length > 0 ? `(${args})` : ""
return `${this.gqlField.name}${argsString}: ${this.gqlField.type.toString()}`
},