@casomoltd/tooling 0.32.0 → 0.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -613,7 +613,8 @@ function isBaseBlock(css, index) {
613
613
  return depth === 1 && (head === ":root" || /^@theme(\s|$)/.test(head));
614
614
  }
615
615
 
616
- /** The head of the block enclosing `index`, or "" at the top level. */
616
+ /** The head of the block enclosing `index`, or "" at the top level. A
617
+ * comment before the head is not part of it, even one holding a `;`. */
617
618
  function enclosing(css, index) {
618
619
  let depth = 0;
619
620
  for (let i = index; i >= 0; i -= 1) {
@@ -621,8 +622,9 @@ function enclosing(css, index) {
621
622
  if (css[i] === "{") {
622
623
  if (depth === 0) {
623
624
  const head = css.slice(0, i);
624
- return head.slice(Math.max(head.lastIndexOf("}"),
625
- head.lastIndexOf(";"), head.lastIndexOf("{")) + 1).trim();
625
+ const tail = head.slice(Math.max(head.lastIndexOf("}"),
626
+ head.lastIndexOf(";"), head.lastIndexOf("{")) + 1);
627
+ return stripComments(tail).replace(/^[\s\S]*\*\//, "").trim();
626
628
  }
627
629
  depth -= 1;
628
630
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@casomoltd/tooling",
3
- "version": "0.32.0",
3
+ "version": "0.32.1",
4
4
  "description": "Casomo's shared dev config: ESLint, Prettier, commitlint, knip & jscpd presets and dev CLIs (git hooks, readability, screenshots, design specs)",
5
5
  "license": "MIT",
6
6
  "repository": {