aboutsummaryrefslogtreecommitdiff
path: root/node_modules/vue-style-loader/lib/listToStyles.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/vue-style-loader/lib/listToStyles.js')
-rw-r--r--node_modules/vue-style-loader/lib/listToStyles.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/node_modules/vue-style-loader/lib/listToStyles.js b/node_modules/vue-style-loader/lib/listToStyles.js
new file mode 100644
index 00000000..bc86bb40
--- /dev/null
+++ b/node_modules/vue-style-loader/lib/listToStyles.js
@@ -0,0 +1,27 @@
+/**
+ * Translates the list format produced by css-loader into something
+ * easier to manipulate.
+ */
+export default function listToStyles (parentId, list) {
+ var styles = []
+ var newStyles = {}
+ for (var i = 0; i < list.length; i++) {
+ var item = list[i]
+ var id = item[0]
+ var css = item[1]
+ var media = item[2]
+ var sourceMap = item[3]
+ var part = {
+ id: parentId + ':' + i,
+ css: css,
+ media: media,
+ sourceMap: sourceMap
+ }
+ if (!newStyles[id]) {
+ styles.push(newStyles[id] = { id: id, parts: [part] })
+ } else {
+ newStyles[id].parts.push(part)
+ }
+ }
+ return styles
+}