pinia-orm-edge 1.8.1-28575962.0696a1a → 1.8.1-28576022.11ee966
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/helpers.cjs
CHANGED
package/dist/helpers.mjs
CHANGED
package/dist/index.cjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const Utils = require('./shared/pinia-orm.
|
3
|
+
const Utils = require('./shared/pinia-orm.2be56be4.cjs');
|
4
4
|
const pinia = require('pinia');
|
5
5
|
const normalizr = require('@pinia-orm/normalizr');
|
6
6
|
const CastAttribute = require('./shared/pinia-orm.a7e3e0f3.cjs');
|
@@ -1969,6 +1969,7 @@ function useRepo(ModelOrRepository, pinia) {
|
|
1969
1969
|
repository.database.register(repository.getModel());
|
1970
1970
|
}
|
1971
1971
|
} catch (e) {
|
1972
|
+
console.error("[Pinia ORM] Failed to register models", e);
|
1972
1973
|
}
|
1973
1974
|
return registerPlugins(repository);
|
1974
1975
|
}
|
@@ -2019,7 +2020,7 @@ let String$1 = class String extends Type {
|
|
2019
2020
|
}
|
2020
2021
|
};
|
2021
2022
|
|
2022
|
-
class Number extends Type {
|
2023
|
+
let Number$1 = class Number extends Type {
|
2023
2024
|
/**
|
2024
2025
|
* Create a new Number attribute instance.
|
2025
2026
|
*/
|
@@ -2032,7 +2033,7 @@ class Number extends Type {
|
|
2032
2033
|
make(value) {
|
2033
2034
|
return this.makeReturn("number", value);
|
2034
2035
|
}
|
2035
|
-
}
|
2036
|
+
};
|
2036
2037
|
|
2037
2038
|
class Boolean extends Type {
|
2038
2039
|
/**
|
@@ -2911,7 +2912,7 @@ class Model {
|
|
2911
2912
|
* Create a new Number attribute instance.
|
2912
2913
|
*/
|
2913
2914
|
static number(value) {
|
2914
|
-
return new Number(this.newRawInstance(), value);
|
2915
|
+
return new Number$1(this.newRawInstance(), value);
|
2915
2916
|
}
|
2916
2917
|
/**
|
2917
2918
|
* Create a new Boolean attribute instance.
|
@@ -3417,7 +3418,7 @@ class Model {
|
|
3417
3418
|
return this.serializeArray(value);
|
3418
3419
|
}
|
3419
3420
|
if (typeof value === "object") {
|
3420
|
-
if (value instanceof Date && !isNaN(value.getTime()) && typeof value.toISOString === "function") {
|
3421
|
+
if (value instanceof Date && !Number.isNaN(value.getTime()) && typeof value.toISOString === "function") {
|
3421
3422
|
return value.toISOString();
|
3422
3423
|
} else {
|
3423
3424
|
return this.serializeObject(value);
|
package/dist/index.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { i as isArray, t as throwError, a as assert, g as generateId, b as isNullish, c as compareWithOperator, d as generateKey, e as isEmpty, f as isFunction, h as groupBy, o as orderBy, j as equals } from './shared/pinia-orm.
|
1
|
+
import { i as isArray, t as throwError, a as assert, g as generateId, b as isNullish, c as compareWithOperator, d as generateKey, e as isEmpty, f as isFunction, h as groupBy, o as orderBy, j as equals } from './shared/pinia-orm.000eebbf.mjs';
|
2
2
|
import { defineStore, acceptHMRUpdate } from 'pinia';
|
3
3
|
import { schema, normalize } from '@pinia-orm/normalizr';
|
4
4
|
export { C as CastAttribute } from './shared/pinia-orm.4ff2e12f.mjs';
|
@@ -1967,6 +1967,7 @@ function useRepo(ModelOrRepository, pinia) {
|
|
1967
1967
|
repository.database.register(repository.getModel());
|
1968
1968
|
}
|
1969
1969
|
} catch (e) {
|
1970
|
+
console.error("[Pinia ORM] Failed to register models", e);
|
1970
1971
|
}
|
1971
1972
|
return registerPlugins(repository);
|
1972
1973
|
}
|
@@ -2017,7 +2018,7 @@ let String$1 = class String extends Type {
|
|
2017
2018
|
}
|
2018
2019
|
};
|
2019
2020
|
|
2020
|
-
class Number extends Type {
|
2021
|
+
let Number$1 = class Number extends Type {
|
2021
2022
|
/**
|
2022
2023
|
* Create a new Number attribute instance.
|
2023
2024
|
*/
|
@@ -2030,7 +2031,7 @@ class Number extends Type {
|
|
2030
2031
|
make(value) {
|
2031
2032
|
return this.makeReturn("number", value);
|
2032
2033
|
}
|
2033
|
-
}
|
2034
|
+
};
|
2034
2035
|
|
2035
2036
|
class Boolean extends Type {
|
2036
2037
|
/**
|
@@ -2909,7 +2910,7 @@ class Model {
|
|
2909
2910
|
* Create a new Number attribute instance.
|
2910
2911
|
*/
|
2911
2912
|
static number(value) {
|
2912
|
-
return new Number(this.newRawInstance(), value);
|
2913
|
+
return new Number$1(this.newRawInstance(), value);
|
2913
2914
|
}
|
2914
2915
|
/**
|
2915
2916
|
* Create a new Boolean attribute instance.
|
@@ -3415,7 +3416,7 @@ class Model {
|
|
3415
3416
|
return this.serializeArray(value);
|
3416
3417
|
}
|
3417
3418
|
if (typeof value === "object") {
|
3418
|
-
if (value instanceof Date && !isNaN(value.getTime()) && typeof value.toISOString === "function") {
|
3419
|
+
if (value instanceof Date && !Number.isNaN(value.getTime()) && typeof value.toISOString === "function") {
|
3419
3420
|
return value.toISOString();
|
3420
3421
|
} else {
|
3421
3422
|
return this.serializeObject(value);
|
@@ -122,9 +122,9 @@ function generateKey(key, params) {
|
|
122
122
|
function getValue(obj, keys) {
|
123
123
|
keys = typeof keys === "string" ? keys.split(".") : keys;
|
124
124
|
const key = keys.shift();
|
125
|
-
if (obj &&
|
125
|
+
if (obj && Object.prototype.hasOwnProperty.call(obj, key) && keys.length === 0) {
|
126
126
|
return obj[key];
|
127
|
-
} else if (!obj || !
|
127
|
+
} else if (!obj || !Object.prototype.hasOwnProperty.call(obj, key)) {
|
128
128
|
return obj;
|
129
129
|
} else {
|
130
130
|
return getValue(obj[key], keys);
|
@@ -124,9 +124,9 @@ function generateKey(key, params) {
|
|
124
124
|
function getValue(obj, keys) {
|
125
125
|
keys = typeof keys === "string" ? keys.split(".") : keys;
|
126
126
|
const key = keys.shift();
|
127
|
-
if (obj &&
|
127
|
+
if (obj && Object.prototype.hasOwnProperty.call(obj, key) && keys.length === 0) {
|
128
128
|
return obj[key];
|
129
|
-
} else if (!obj || !
|
129
|
+
} else if (!obj || !Object.prototype.hasOwnProperty.call(obj, key)) {
|
130
130
|
return obj;
|
131
131
|
} else {
|
132
132
|
return getValue(obj[key], keys);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "pinia-orm-edge",
|
3
|
-
"version": "1.8.1-
|
3
|
+
"version": "1.8.1-28576022.11ee966",
|
4
4
|
"description": "The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.",
|
5
5
|
"keywords": [
|
6
6
|
"vue",
|
@@ -46,23 +46,24 @@
|
|
46
46
|
"pinia": "^2.1.6"
|
47
47
|
},
|
48
48
|
"dependencies": {
|
49
|
-
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.8.1-
|
49
|
+
"@pinia-orm/normalizr": "npm:@pinia-orm/normalizr-edge@1.8.1-28576022.11ee966"
|
50
50
|
},
|
51
51
|
"devDependencies": {
|
52
|
+
"@nuxt/eslint-config": "^0.3.10",
|
52
53
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
53
54
|
"@pinia/testing": "^0.1.3",
|
54
55
|
"@size-limit/preset-small-lib": "^11.0.0",
|
55
56
|
"@types/node": "^20.8.8",
|
56
57
|
"@types/prettier": "^3.0.0",
|
57
58
|
"@types/uuid": "^9.0.4",
|
58
|
-
"@typescript-eslint/parser": "^7.0
|
59
|
+
"@typescript-eslint/parser": "^7.8.0",
|
59
60
|
"@vitest/coverage-v8": "^1.0.0",
|
60
61
|
"@vitest/ui": "^1.0.0",
|
61
62
|
"@vue/composition-api": "^1.7.2",
|
62
63
|
"@vue/test-utils": "^2.4.1",
|
63
64
|
"c8": "^9.0.0",
|
64
65
|
"core-js": "^3.32.2",
|
65
|
-
"eslint": "^9.
|
66
|
+
"eslint": "^9.1.1",
|
66
67
|
"happy-dom": "^14.0.0",
|
67
68
|
"mkdist": "^1.3.0",
|
68
69
|
"nanoid": "4.0.2",
|
@@ -115,8 +116,8 @@
|
|
115
116
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path . -l pinia-orm -r 1",
|
116
117
|
"coverage": "vue-demi-switch 3 && vitest --run --coverage",
|
117
118
|
"size": "size-limit",
|
118
|
-
"lint": "eslint . --
|
119
|
-
"lint:fix": "eslint . --
|
119
|
+
"lint": "eslint . --cache",
|
120
|
+
"lint:fix": "eslint . --cache --fix",
|
120
121
|
"test:ui": "vue-demi-switch 3 && vitest --ui --api 9527",
|
121
122
|
"test:watch": "vue-demi-switch 3 && vitest --watch",
|
122
123
|
"test:2": "vue-demi-switch 2 vue2 && vitest --run",
|