svelte-common 4.12.0 → 4.12.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/sorting.mjs +9 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "4.12.0",
3
+ "version": "4.12.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -44,7 +44,7 @@
44
44
  "documentation": "^14.0.0",
45
45
  "mf-styling": "^1.4.0",
46
46
  "npm-pkgbuild": "^10.14.8",
47
- "semantic-release": "^19.0.4",
47
+ "semantic-release": "^19.0.5",
48
48
  "stylelint": "^14.11.0",
49
49
  "stylelint-config-standard": "^28.0.0",
50
50
  "svelte": "^3.49.0",
package/src/sorting.mjs CHANGED
@@ -66,14 +66,15 @@ export function sortable(node, store) {
66
66
  * @param {Object} sortBy
67
67
  * @return {Function} sorter
68
68
  */
69
- export function sorter(sortBy)
70
- {
71
- for(const [key,value] of Object.entries(sortBy)) {
72
- switch(value) {
73
- case SORT_ASCENDING:
74
- return (a,b) => a[key].localeCompare(b[key]);
75
- case SORT_DESCENDING:
76
- return (b,a) => a[key].localeCompare(b[key]);
69
+ export function sorter(sortBy) {
70
+ if (sortBy) {
71
+ for (const [key, value] of Object.entries(sortBy)) {
72
+ switch (value) {
73
+ case SORT_ASCENDING:
74
+ return (a, b) => a[key].localeCompare(b[key]);
75
+ case SORT_DESCENDING:
76
+ return (b, a) => a[key].localeCompare(b[key]);
77
+ }
77
78
  }
78
79
  }
79
80
  }