kss-modern 1.6.0 → 1.6.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.
@@ -792,12 +792,13 @@ function extractMarkdownPath(input) {
792
792
  }
793
793
  return path2;
794
794
  }
795
+ function compareReferences(a, b) {
796
+ return a.localeCompare(b, void 0, { numeric: true });
797
+ }
795
798
  async function parse(input, contentDir) {
796
799
  const data = kssParser(input).sections.filter((section) => Boolean(section.reference));
797
800
  const overwrittenSectionsIds = [];
798
- const sortedData = data.sort((a, b) => {
799
- return a.reference.localeCompare(b.reference);
800
- });
801
+ const sortedData = data.sort((a, b) => compareReferences(a.reference, b.reference));
801
802
  let output = [];
802
803
  async function computeDescription(description, rootHeadingLevel) {
803
804
  if (!description || !description.includes("Markdown:"))
@@ -960,7 +961,7 @@ async function parse(input, contentDir) {
960
961
  output.forEach((firstLevelSection) => {
961
962
  firstLevelSection.sections = firstLevelSection.sections.filter((section) => Boolean(section));
962
963
  firstLevelSection.sections.forEach((secondLevelSection) => {
963
- secondLevelSection.sections = secondLevelSection.sections.filter((section) => Boolean(section)).sort((a, b) => a.id.localeCompare(b.id));
964
+ secondLevelSection.sections = secondLevelSection.sections.filter((section) => Boolean(section)).sort((a, b) => compareReferences(a.id, b.id));
964
965
  });
965
966
  });
966
967
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kss-modern",
3
3
  "type": "module",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "description": "Modern KSS compatible styleguide generator",
6
6
  "keywords": [
7
7
  "kss",