svelte-common 4.22.9 → 4.22.11

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.
package/README.md CHANGED
@@ -82,15 +82,16 @@ Returns **any** value associated with the given property name
82
82
 
83
83
  ## getAttributeAndOperator
84
84
 
85
- Deliver attribute value.
86
- The name may be a property path like 'a.b.c'.
85
+ Deliver attribute value and operator.
86
+ The name may be a property path like 'a.b.c <='.
87
87
 
88
88
  ### Parameters
89
89
 
90
90
  * `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
91
- * `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
91
+ * `expression` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
92
+ * `getters` (optional, default `{}`)
92
93
 
93
- Returns **any** value associated with the given property name
94
+ Returns **\[any, [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)]** value associated with the given property name
94
95
 
95
96
  ## filter
96
97
 
@@ -99,7 +100,7 @@ Generate filter function.
99
100
  ### Parameters
100
101
 
101
102
  * `filterBy` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
102
- * `getters` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
103
+ * `getters` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
103
104
 
104
105
  Returns **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)**&#x20;
105
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "4.22.9",
3
+ "version": "4.22.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,7 +23,7 @@
23
23
  "prepare": "vite build",
24
24
  "start": "vite",
25
25
  "test": "npm run test:ava && npm run test:cafe",
26
- "test:cafe": "testcafe $BROWSER:headless tests/cafe/*.js -s build/test --page-request-timeout 5000 --app-init-delay 9000 --app \"vite\"",
26
+ "test:cafe": "testcafe --experimental-esm $BROWSER:headless tests/cafe/*.*js -s build/test --page-request-timeout 5000 --app-init-delay 8000 --app vite",
27
27
  "test:ava": "ava --timeout 2m tests/*-ava.mjs tests/*-ava-node.mjs",
28
28
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
29
29
  "docs": "documentation readme --section=API ./src/**/*.mjs",
@@ -40,18 +40,18 @@
40
40
  "@semantic-release/commit-analyzer": "^9.0.2",
41
41
  "@semantic-release/exec": "^6.0.3",
42
42
  "@semantic-release/release-notes-generator": "^10.0.3",
43
- "@sveltejs/vite-plugin-svelte": "^2.0.2",
44
- "ava": "^5.1.1",
45
- "c8": "^7.12.0",
43
+ "@sveltejs/vite-plugin-svelte": "^2.0.3",
44
+ "ava": "^5.2.0",
45
+ "c8": "^7.13.0",
46
46
  "documentation": "^14.0.1",
47
- "mf-styling": "^1.7.43",
48
- "npm-pkgbuild": "^11.2.8",
49
- "semantic-release": "^20.1.0",
50
- "stylelint": "^14.16.1",
51
- "stylelint-config-standard": "^29.0.0",
52
- "svelte": "^3.55.1",
53
- "testcafe": "^2.3.0",
54
- "vite": "^4.1.1"
47
+ "mf-styling": "^1.7.49",
48
+ "npm-pkgbuild": "^11.5.18",
49
+ "semantic-release": "^20.1.3",
50
+ "stylelint": "^15.3.0",
51
+ "stylelint-config-standard": "^31.0.0",
52
+ "svelte": "^3.57.0",
53
+ "testcafe": "^2.4.0",
54
+ "vite": "^4.2.1"
55
55
  },
56
56
  "optionalDependencies": {
57
57
  "mf-hosting-cloudflare": "^1.0.5",
package/src/attribute.mjs CHANGED
@@ -168,10 +168,14 @@ export function getAttributeAndOperator(object, expression, getters = {}) {
168
168
  if (object === undefined) {
169
169
  break;
170
170
  }
171
- if (object[token] !== undefined) {
172
- object = object[token];
171
+
172
+ const g = getters[token];
173
+ if (g) {
174
+ object = g(object);
173
175
  } else {
174
- object = getters[token];
176
+ if (object[token] !== undefined) {
177
+ object = object[token];
178
+ }
175
179
  }
176
180
  }
177
181
  }
@@ -19,13 +19,13 @@
19
19
  <tr>
20
20
  <td />
21
21
  <td>Version</td>
22
- <td>{#if server && server.version}{server.version}{:else}<div class="error">down</div>{/if}</td>
22
+ <td>{#if server?.version}{server.version}{:else}<div class="error">down</div>{/if}</td>
23
23
  </tr>
24
24
  <tr>
25
25
  <td />
26
26
  <td>Uptime</td>
27
27
  <td>
28
- {#if server && server.uptime >= 0}
28
+ {#if server?.uptime >= 0}
29
29
  <Duration seconds={server.uptime} />
30
30
  {:else}<div class="error">down</div>{/if}
31
31
  </td>
@@ -34,6 +34,6 @@
34
34
  <tr>
35
35
  <td />
36
36
  <td>{title}</td>
37
- <td>{#if server && server.memory}<Bytes value={server.memory[key]}/>{:else}<div class="error">down</div>{/if}</td>
37
+ <td>{#if server?.memory}<Bytes value={server.memory[key]}/>{:else}<div class="error">down</div>{/if}</td>
38
38
  </tr>
39
39
  {/each}
@@ -10,7 +10,7 @@
10
10
  <tr>
11
11
  <td />
12
12
  <td>Username</td>
13
- <td>{session.username ? session.username : ""}</td>
13
+ <td>{session.username || ""}</td>
14
14
  </tr>
15
15
  <tr>
16
16
  <td />