svelte-common 4.22.13 → 4.22.15

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 +13 -13
  2. package/src/attribute.mjs +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "4.22.13",
3
+ "version": "4.22.15",
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 --experimental-esm $BROWSER:headless tests/cafe/*.*js -s build/test --page-request-timeout 5000 --app-init-delay 8000 --app vite",
26
+ "test:cafe": "testcafe $BROWSER:headless tests/cafe/*.*js --esm -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",
@@ -34,28 +34,28 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "svelte-command": "^1.1.39",
37
- "svelte-entitlement": "^1.2.49"
37
+ "svelte-entitlement": "^1.2.50"
38
38
  },
39
39
  "devDependencies": {
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.3",
43
+ "@sveltejs/vite-plugin-svelte": "^2.1.0",
44
44
  "ava": "^5.2.0",
45
45
  "c8": "^7.13.0",
46
46
  "documentation": "^14.0.1",
47
- "mf-styling": "^1.7.49",
48
- "npm-pkgbuild": "^11.5.18",
49
- "semantic-release": "^21.0.0",
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"
47
+ "mf-styling": "^1.7.54",
48
+ "npm-pkgbuild": "^11.7.16",
49
+ "semantic-release": "^21.0.1",
50
+ "stylelint": "^15.6.0",
51
+ "stylelint-config-standard": "^33.0.0",
52
+ "svelte": "^3.58.0",
53
+ "testcafe": "^2.5.0",
54
+ "vite": "^4.3.1"
55
55
  },
56
56
  "optionalDependencies": {
57
57
  "mf-hosting-cloudflare": "^1.0.5",
58
- "mf-hosting-frontend": "^1.7.1"
58
+ "mf-hosting-frontend": "^1.9.0"
59
59
  },
60
60
  "repository": {
61
61
  "type": "git",
package/src/attribute.mjs CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * @typedef {Object} AttributeDefinition
3
+ *
4
+ * @property {string} type
5
+ * @property {boolean} writable
6
+ * @property {boolean} [private] should the value be shown
7
+ * @property {string} [depends] name of an attribute we depend on
8
+ * @property {string[]} additionalAttributes extra attributes that are present in case our attribute is set
9
+ * @property {string} description
10
+ * @property {any} [default] the default value
11
+ * @property {Function} [set] set the value
12
+ * @property {Function} [get] get the value can be used to calculate default values
13
+ * @property {string|string[]} [env] environment variable use to provide the value
14
+ */
15
+
1
16
  /**
2
17
  * Split property path into tokens
3
18
  * @param {string} string
@@ -114,7 +129,7 @@ export function setAttribute(object, name, value) {
114
129
  * @returns {any} value associated with the given property name
115
130
  */
116
131
  export function getAttribute(object, name) {
117
- if (object && object[name] !== undefined) {
132
+ if (object?.[name] !== undefined) {
118
133
  return object[name];
119
134
  }
120
135