From 97cad7db3b61c7ba19bd573d14bd53648133d707 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 3 Oct 2017 12:14:51 -0400 Subject: [PATCH] save copy of es6 code --- es6app.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 es6app.js diff --git a/es6app.js b/es6app.js new file mode 100644 index 0000000..0619e6c --- /dev/null +++ b/es6app.js @@ -0,0 +1,27 @@ +const cartesian = arr => arr.reduce((a, b) => a.map(x => b.map(y => x.concat(y))).reduce((a, b) => a.concat(b), []), [[]]) +const vm = new Vue({ + el: '#app', + data: { + prefix: "* ", + delimiter: " \\\\ ", + suffix: " \\\\ \\\\", + n: "# Country\nDTUS\nDTCAN\n\n# Routing number\nValid routing number\nInvalid routing number\n\n# Service call\nIncluded in service call\nNot included in service call\n\n# Payment type/source\nOne time (Payment Central)\nPay plan (Pay Plan Maintenance Screen)\nScan/Import Screen" + }, + methods: { + pluralize: (noun, count) => + `${noun}${count == 1 ? '' : 's'}` + }, + computed: { + combos() { + return cartesian( + this.n.trim().split('\n\n') + .map(e => + e.split('\n') + .map(e => e.trim()) + .filter(e => e[0] !== '#') + ) + ).map(e => `${this.prefix}${e.join(this.delimiter)}${this.suffix}`) + } + } +}) +