Sha256: ebb345ff1b07f7e338f040713e44e7d5f627112f12bd7ccde3b8bd7f1f136524
Contents?: true
Size: 598 Bytes
Versions: 28
Compression:
Stored size: 598 Bytes
Contents
var generate = require('css-tree').generate; function Index() { this.seed = 0; this.map = Object.create(null); } Index.prototype.resolve = function(str) { var index = this.map[str]; if (!index) { index = ++this.seed; this.map[str] = index; } return index; }; module.exports = function createDeclarationIndexer() { var ids = new Index(); return function markDeclaration(node) { var id = generate(node); node.id = ids.resolve(id); node.length = id.length; node.fingerprint = null; return node; }; };
Version data entries
28 entries across 27 versions & 9 rubygems