svelte-common 6.8.7 → 6.9.0

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 +8 -8
  2. package/src/filter.mjs +16 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.8.7",
3
+ "version": "6.9.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,7 +32,7 @@
32
32
  "start": "vite",
33
33
  "test": "npm run test:ava && npm run test:cafe",
34
34
  "test:cafe": "testcafe $BROWSER:headless tests/cafe/*-cafe.mjs -s build/test --page-request-timeout 5000 --app-init-delay 8000 --app vite",
35
- "test:ava": "ava --timeout 2m tests/*-ava.mjs tests/*-ava-node.mjs && ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
35
+ "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
36
36
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
37
37
  "docs": "documentation readme --section=API ./src/**/*.mjs",
38
38
  "lint": "npm run lint:css && npm run lint:docs",
@@ -41,21 +41,21 @@
41
41
  "preview": "vite preview"
42
42
  },
43
43
  "dependencies": {
44
- "pacc": "^1.0.0",
44
+ "pacc": "^2.0.0",
45
45
  "svelte-command": "^1.1.50",
46
46
  "svelte-entitlement": "^1.2.66"
47
47
  },
48
48
  "devDependencies": {
49
- "@semantic-release/commit-analyzer": "^11.0.0",
49
+ "@semantic-release/commit-analyzer": "^11.1.0",
50
50
  "@semantic-release/exec": "^6.0.3",
51
- "@semantic-release/release-notes-generator": "^12.0.0",
51
+ "@semantic-release/release-notes-generator": "^12.1.0",
52
52
  "@sveltejs/vite-plugin-svelte": "^2.4.6",
53
53
  "ava": "^5.3.1",
54
54
  "c8": "^8.0.1",
55
55
  "documentation": "^14.0.2",
56
- "mf-styling": "^3.1.0",
57
- "npm-pkgbuild": "^12.3.1",
58
- "semantic-release": "^22.0.6",
56
+ "mf-styling": "^3.1.1",
57
+ "npm-pkgbuild": "^13.0.2",
58
+ "semantic-release": "^22.0.7",
59
59
  "stylelint": "^15.11.0",
60
60
  "stylelint-config-standard": "^34.0.0",
61
61
  "svelte": "^4.2.2",
package/src/filter.mjs CHANGED
@@ -1,4 +1,12 @@
1
- import { getAttributeAndOperator } from "pacc";
1
+ import {
2
+ getAttributeAndOperator,
3
+ EQUAL,
4
+ NOT_EQUAL,
5
+ LESS,
6
+ LESS_EQUAL,
7
+ GREATER,
8
+ GREATER_EQUAL
9
+ } from "pacc";
2
10
 
3
11
  function dateOp(value, against, op) {
4
12
  return numberOp(value.getTime(), against.getTime(), op);
@@ -74,7 +82,7 @@ function allOp(value, against, op) {
74
82
  return numberOp(value.length !== 0, against, op);
75
83
  case "string":
76
84
  if (
77
- op === "=" &&
85
+ op === EQUAL &&
78
86
  (against.length === 0 || value.indexOf(against) >= 0)
79
87
  ) {
80
88
  return true;
@@ -166,17 +174,17 @@ function allOp(value, against, op) {
166
174
 
167
175
  function numberOp(value, against, op) {
168
176
  switch (op) {
169
- case "!=":
177
+ case NOT_EQUAL:
170
178
  return value != against;
171
- case "=":
179
+ case EQUAL:
172
180
  return value == against;
173
- case ">":
181
+ case GREATER:
174
182
  return value > against;
175
- case "<":
183
+ case LESS:
176
184
  return value < against;
177
- case ">=":
185
+ case GREATER_EQUAL:
178
186
  return value >= against;
179
- case "<=":
187
+ case LESS_EQUAL:
180
188
  return value <= against;
181
189
  }
182
190
  }