parseCssClassNames.js 766 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.parseCssClassNames = void 0;
  4. const parseCssVars_1 = require("./parseCssVars");
  5. const cssClassNameReg = /(?=([\.]{1}[a-zA-Z_]+[\w\_\-]*)[\s\.\+\{\>#\:]{1})/g;
  6. function* parseCssClassNames(styleContent) {
  7. styleContent = (0, parseCssVars_1.clearComments)(styleContent);
  8. const matches = styleContent.matchAll(cssClassNameReg);
  9. for (const match of matches) {
  10. if (match.index !== undefined) {
  11. const matchText = match[1];
  12. if (matchText !== undefined) {
  13. yield { offset: match.index, text: matchText };
  14. }
  15. }
  16. }
  17. }
  18. exports.parseCssClassNames = parseCssClassNames;
  19. //# sourceMappingURL=parseCssClassNames.js.map