+ /**
+ * Returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level.
+ * TODO(stephenwade): Replace this with array.flatMap when we drop support for Node v10
+ * @param {any[]} array The array to process
+ * @param {Function} fn The function to use
+ * @returns {any[]} The result array
+ */
+ function flatMap(array, fn) {
+ const mapped = array.map(fn);
+ const flattened = [].concat(...mapped);
+
+ return flattened;
+ }
+
+ const lineDirectives = flatMap(directives, directive => {