pacc 4.41.3 → 4.41.5
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/package.json +2 -2
- package/src/properties.mjs +2 -2
- package/src/types.mjs +8 -1
- package/types/types.d.mts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacc",
|
|
3
|
-
"version": "4.41.
|
|
3
|
+
"version": "4.41.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"ava": "^6.4.1",
|
|
42
|
-
"browser-ava": "^2.3.
|
|
42
|
+
"browser-ava": "^2.3.45",
|
|
43
43
|
"c8": "^10.1.3",
|
|
44
44
|
"documentation": "^14.0.3",
|
|
45
45
|
"semantic-release": "^25.0.2",
|
package/src/properties.mjs
CHANGED
|
@@ -29,9 +29,9 @@ export function definePropertiesFromAttributes(
|
|
|
29
29
|
attribute.default;
|
|
30
30
|
|
|
31
31
|
if (value !== undefined) {
|
|
32
|
-
|
|
33
|
-
value = prepareValue(value, attribute);
|
|
32
|
+
value = prepareValue(value, attribute);
|
|
34
33
|
|
|
34
|
+
if (path.length === 1) {
|
|
35
35
|
const property = properties[name];
|
|
36
36
|
|
|
37
37
|
if (property?.set) {
|
package/src/types.mjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { attributeIterator } from "./attributes.mjs";
|
|
2
2
|
|
|
3
|
+
const emptyStringIsUndefined = value =>
|
|
4
|
+
typeof value === "string" && value.length === 0 ? undefined : value;
|
|
5
|
+
|
|
3
6
|
export const types = {
|
|
4
7
|
string: { name: "string", primitive: true },
|
|
5
8
|
number: {
|
|
@@ -32,7 +35,11 @@ export const types = {
|
|
|
32
35
|
prepareValue: value =>
|
|
33
36
|
typeof value === "string" ? parseFloat(value) : value
|
|
34
37
|
},
|
|
35
|
-
url: {
|
|
38
|
+
url: {
|
|
39
|
+
name: "url",
|
|
40
|
+
prepareValue: emptyStringIsUndefined,
|
|
41
|
+
primitive: true
|
|
42
|
+
},
|
|
36
43
|
object: { name: "object" }
|
|
37
44
|
};
|
|
38
45
|
|