pinia-orm-edge 2.0.0-29071779.1c02d4e → 2.0.0-29071780.bb25248
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/dist/casts.cjs +2 -32
- package/dist/casts.mjs +2 -32
- package/dist/index.cjs +3 -1
- package/dist/index.mjs +3 -1
- package/dist/shared/pinia-orm.BF29nyB3.cjs +36 -0
- package/dist/shared/pinia-orm.CgyvBCb2.mjs +34 -0
- package/package.json +2 -2
package/dist/casts.cjs
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const CastAttribute = require('./shared/pinia-orm.DWjxIbAJ.cjs');
|
4
|
+
const BooleanCast = require('./shared/pinia-orm.BF29nyB3.cjs');
|
4
5
|
|
5
6
|
class ArrayCast extends CastAttribute.CastAttribute {
|
6
7
|
/**
|
@@ -38,37 +39,6 @@ class StringCast extends CastAttribute.CastAttribute {
|
|
38
39
|
}
|
39
40
|
}
|
40
41
|
|
41
|
-
class BooleanCast extends CastAttribute.CastAttribute {
|
42
|
-
/**
|
43
|
-
* Create a new String attribute instance.
|
44
|
-
*/
|
45
|
-
constructor(attributes) {
|
46
|
-
super(attributes);
|
47
|
-
}
|
48
|
-
get(value) {
|
49
|
-
if (typeof value === "boolean" || value === void 0 || value === null) {
|
50
|
-
return value;
|
51
|
-
}
|
52
|
-
if (typeof value === "string") {
|
53
|
-
if (value.length === 0) {
|
54
|
-
return false;
|
55
|
-
}
|
56
|
-
const int = Number.parseInt(value, 0);
|
57
|
-
return Number.isNaN(int) ? true : !!int;
|
58
|
-
}
|
59
|
-
if (typeof value === "number") {
|
60
|
-
return !!value;
|
61
|
-
}
|
62
|
-
return false;
|
63
|
-
}
|
64
|
-
/**
|
65
|
-
* Make the value for the attribute.
|
66
|
-
*/
|
67
|
-
set(value) {
|
68
|
-
return this.get(value);
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
42
|
class NumberCast extends CastAttribute.CastAttribute {
|
73
43
|
/**
|
74
44
|
* Create a new String attribute instance.
|
@@ -123,8 +93,8 @@ class DateCast extends CastAttribute.CastAttribute {
|
|
123
93
|
}
|
124
94
|
}
|
125
95
|
|
96
|
+
exports.BooleanCast = BooleanCast.BooleanCast;
|
126
97
|
exports.ArrayCast = ArrayCast;
|
127
|
-
exports.BooleanCast = BooleanCast;
|
128
98
|
exports.DateCast = DateCast;
|
129
99
|
exports.NumberCast = NumberCast;
|
130
100
|
exports.StringCast = StringCast;
|
package/dist/casts.mjs
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { C as CastAttribute } from './shared/pinia-orm.C7bM_uXu.mjs';
|
2
|
+
export { B as BooleanCast } from './shared/pinia-orm.CgyvBCb2.mjs';
|
2
3
|
|
3
4
|
class ArrayCast extends CastAttribute {
|
4
5
|
/**
|
@@ -36,37 +37,6 @@ class StringCast extends CastAttribute {
|
|
36
37
|
}
|
37
38
|
}
|
38
39
|
|
39
|
-
class BooleanCast extends CastAttribute {
|
40
|
-
/**
|
41
|
-
* Create a new String attribute instance.
|
42
|
-
*/
|
43
|
-
constructor(attributes) {
|
44
|
-
super(attributes);
|
45
|
-
}
|
46
|
-
get(value) {
|
47
|
-
if (typeof value === "boolean" || value === void 0 || value === null) {
|
48
|
-
return value;
|
49
|
-
}
|
50
|
-
if (typeof value === "string") {
|
51
|
-
if (value.length === 0) {
|
52
|
-
return false;
|
53
|
-
}
|
54
|
-
const int = Number.parseInt(value, 0);
|
55
|
-
return Number.isNaN(int) ? true : !!int;
|
56
|
-
}
|
57
|
-
if (typeof value === "number") {
|
58
|
-
return !!value;
|
59
|
-
}
|
60
|
-
return false;
|
61
|
-
}
|
62
|
-
/**
|
63
|
-
* Make the value for the attribute.
|
64
|
-
*/
|
65
|
-
set(value) {
|
66
|
-
return this.get(value);
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
40
|
class NumberCast extends CastAttribute {
|
71
41
|
/**
|
72
42
|
* Create a new String attribute instance.
|
@@ -121,4 +91,4 @@ class DateCast extends CastAttribute {
|
|
121
91
|
}
|
122
92
|
}
|
123
93
|
|
124
|
-
export { ArrayCast,
|
94
|
+
export { ArrayCast, DateCast, NumberCast, StringCast };
|
package/dist/index.cjs
CHANGED
@@ -4,6 +4,7 @@ const Utils = require('./shared/pinia-orm.CO4kZz81.cjs');
|
|
4
4
|
const pinia = require('pinia');
|
5
5
|
const normalizr = require('@pinia-orm/normalizr');
|
6
6
|
const vue = require('vue');
|
7
|
+
const BooleanCast = require('./shared/pinia-orm.BF29nyB3.cjs');
|
7
8
|
const CastAttribute = require('./shared/pinia-orm.DWjxIbAJ.cjs');
|
8
9
|
|
9
10
|
class Attribute {
|
@@ -2034,7 +2035,8 @@ class Boolean extends Type {
|
|
2034
2035
|
* Make the value for the attribute.
|
2035
2036
|
*/
|
2036
2037
|
make(value) {
|
2037
|
-
|
2038
|
+
const booleanCast = new BooleanCast.BooleanCast(value);
|
2039
|
+
return booleanCast.get(this.makeReturn("boolean", value));
|
2038
2040
|
}
|
2039
2041
|
}
|
2040
2042
|
|
package/dist/index.mjs
CHANGED
@@ -2,6 +2,7 @@ import { i as isArray, t as throwError, a as assert, g as generateId, b as isNul
|
|
2
2
|
import { defineStore, acceptHMRUpdate } from 'pinia';
|
3
3
|
import { schema, normalize } from '@pinia-orm/normalizr';
|
4
4
|
import { ref } from 'vue';
|
5
|
+
import { B as BooleanCast } from './shared/pinia-orm.CgyvBCb2.mjs';
|
5
6
|
export { C as CastAttribute } from './shared/pinia-orm.C7bM_uXu.mjs';
|
6
7
|
|
7
8
|
class Attribute {
|
@@ -2032,7 +2033,8 @@ class Boolean extends Type {
|
|
2032
2033
|
* Make the value for the attribute.
|
2033
2034
|
*/
|
2034
2035
|
make(value) {
|
2035
|
-
|
2036
|
+
const booleanCast = new BooleanCast(value);
|
2037
|
+
return booleanCast.get(this.makeReturn("boolean", value));
|
2036
2038
|
}
|
2037
2039
|
}
|
2038
2040
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
const CastAttribute = require('./pinia-orm.DWjxIbAJ.cjs');
|
4
|
+
|
5
|
+
class BooleanCast extends CastAttribute.CastAttribute {
|
6
|
+
/**
|
7
|
+
* Create a new String attribute instance.
|
8
|
+
*/
|
9
|
+
constructor(attributes) {
|
10
|
+
super(attributes);
|
11
|
+
}
|
12
|
+
get(value) {
|
13
|
+
if (typeof value === "boolean" || value === void 0 || value === null) {
|
14
|
+
return value;
|
15
|
+
}
|
16
|
+
if (typeof value === "string") {
|
17
|
+
if (value.length === 0) {
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
const int = Number.parseInt(value, 0);
|
21
|
+
return Number.isNaN(int) ? true : !!int;
|
22
|
+
}
|
23
|
+
if (typeof value === "number") {
|
24
|
+
return !!value;
|
25
|
+
}
|
26
|
+
return false;
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* Make the value for the attribute.
|
30
|
+
*/
|
31
|
+
set(value) {
|
32
|
+
return this.get(value);
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
exports.BooleanCast = BooleanCast;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { C as CastAttribute } from './pinia-orm.C7bM_uXu.mjs';
|
2
|
+
|
3
|
+
class BooleanCast extends CastAttribute {
|
4
|
+
/**
|
5
|
+
* Create a new String attribute instance.
|
6
|
+
*/
|
7
|
+
constructor(attributes) {
|
8
|
+
super(attributes);
|
9
|
+
}
|
10
|
+
get(value) {
|
11
|
+
if (typeof value === "boolean" || value === void 0 || value === null) {
|
12
|
+
return value;
|
13
|
+
}
|
14
|
+
if (typeof value === "string") {
|
15
|
+
if (value.length === 0) {
|
16
|
+
return false;
|
17
|
+
}
|
18
|
+
const int = Number.parseInt(value, 0);
|
19
|
+
return Number.isNaN(int) ? true : !!int;
|
20
|
+
}
|
21
|
+
if (typeof value === "number") {
|
22
|
+
return !!value;
|
23
|
+
}
|
24
|
+
return false;
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Make the value for the attribute.
|
28
|
+
*/
|
29
|
+
set(value) {
|
30
|
+
return this.get(value);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
export { BooleanCast as B };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pinia-orm-edge",
|
3
|
-
"version": "2.0.0-
|
3
|
+
"version": "2.0.0-29071780.bb25248",
|
4
4
|
"description": "The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.",
|
5
5
|
"keywords": [
|
6
6
|
"vue",
|
@@ -46,7 +46,7 @@
|
|
46
46
|
"pinia": ">=3.0.0"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@2.0.0-
|
49
|
+
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@2.0.0-29071780.bb25248"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
52
|
"@nuxt/eslint-config": "^1.1.0",
|