1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/vue-style-loader/lib/listToStyles.js

28 lines
637 B
JavaScript

/**
* 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
}