dashboardjavacloudcoapiotiot-analyticsiot-platformiot-solutionskafkalwm2mmicroservicesmiddlewaremqttnettyplatformsnmpthingsboardvisualizationwebsocketswidgets
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
467 B
20 lines
467 B
'use strict';
|
|
|
|
const _ = require('lodash');
|
|
|
|
/**
|
|
* Get the index of a declaration's value
|
|
*
|
|
* @param {import('postcss').Declaration} decl
|
|
*
|
|
* @returns {number}
|
|
*/
|
|
module.exports = function(decl) {
|
|
return [
|
|
_.get(decl, 'raws.prop.prefix'),
|
|
_.get(decl, 'raws.prop.raw', decl.prop),
|
|
_.get(decl, 'raws.prop.suffix'),
|
|
_.get(decl, 'raws.between', ':'),
|
|
_.get(decl, 'raws.value.prefix'),
|
|
].reduce((count, str) => (str ? count + str.length : count), 0);
|
|
};
|
|
|