wishthis/node_modules/html2canvas/dist/lib/css/property-descriptors/counter-increment.js
2022-11-19 16:34:10 +01:00

31 lines
No EOL
1.1 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.counterIncrement = void 0;
var parser_1 = require("../syntax/parser");
exports.counterIncrement = {
name: 'counter-increment',
initialValue: 'none',
prefix: true,
type: 1 /* LIST */,
parse: function (_context, tokens) {
if (tokens.length === 0) {
return null;
}
var first = tokens[0];
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
return null;
}
var increments = [];
var filtered = tokens.filter(parser_1.nonWhiteSpace);
for (var i = 0; i < filtered.length; i++) {
var counter = filtered[i];
var next = filtered[i + 1];
if (counter.type === 20 /* IDENT_TOKEN */) {
var increment = next && parser_1.isNumberToken(next) ? next.number : 1;
increments.push({ counter: counter.value, increment: increment });
}
}
return increments;
}
};
//# sourceMappingURL=counter-increment.js.map