@magnetarjs/plugin-vue3
Advanced tools
Comparing version 0.8.2 to 0.8.3
@@ -30,3 +30,3 @@ "use strict"; | ||
var import_filter_anything = require("filter-anything"); | ||
var import_is_what6 = require("is-what"); | ||
var import_is_what7 = require("is-what"); | ||
var import_getorset_anything = require("getorset-anything"); | ||
@@ -38,3 +38,4 @@ var import_vue = require("vue"); | ||
var import_merge_anything = require("merge-anything"); | ||
function writeActionFactory(data, Vue3StoreOptions2, actionName, makeBackup) { | ||
var import_is_what = require("is-what"); | ||
function writeActionFactory(data, Vue3StoreOptions, actionName, makeBackup) { | ||
return function({ | ||
@@ -58,3 +59,8 @@ payload, | ||
Object.entries(payload).forEach(([key, value]) => { | ||
docDataToMutate[key] = (0, import_merge_anything.merge)(docDataToMutate[key], value); | ||
const originalValue = docDataToMutate[key]; | ||
if ((0, import_is_what.isPlainObject)(originalValue) && (0, import_is_what.isPlainObject)(value)) { | ||
docDataToMutate[key] = (0, import_merge_anything.merge)(originalValue, value); | ||
} else { | ||
docDataToMutate[key] = value; | ||
} | ||
}); | ||
@@ -71,4 +77,4 @@ } | ||
// src/actions/insert.ts | ||
var import_is_what = require("is-what"); | ||
function insertActionFactory(data, Vue3StoreOptions2, makeBackup) { | ||
var import_is_what2 = require("is-what"); | ||
function insertActionFactory(data, Vue3StoreOptions, makeBackup) { | ||
return function({ | ||
@@ -81,3 +87,3 @@ payload, | ||
const collectionMap = data[collectionPath]; | ||
const _docId = docId || ((0, import_is_what.isFullString)(payload.id) || (0, import_is_what.isNumber)(payload.id) ? String(payload.id) : Vue3StoreOptions2.generateRandomId()); | ||
const _docId = docId || ((0, import_is_what2.isFullString)(payload.id) || (0, import_is_what2.isNumber)(payload.id) ? String(payload.id) : Vue3StoreOptions.generateRandomId()); | ||
if (makeBackup) | ||
@@ -97,5 +103,5 @@ makeBackup(collectionPath, _docId); | ||
// src/actions/deleteProp.ts | ||
var import_is_what2 = require("is-what"); | ||
var import_is_what3 = require("is-what"); | ||
var import_path_to_prop = require("path-to-prop"); | ||
function deletePropActionFactory(data, Vue3StoreOptions2, makeBackup) { | ||
function deletePropActionFactory(data, Vue3StoreOptions, makeBackup) { | ||
return function({ | ||
@@ -115,3 +121,3 @@ payload, | ||
makeBackup(collectionPath, docId); | ||
const payloadArray = (0, import_is_what2.isArray)(payload) ? payload : [payload]; | ||
const payloadArray = (0, import_is_what3.isArray)(payload) ? payload : [payload]; | ||
for (const propToDelete of payloadArray) { | ||
@@ -132,4 +138,4 @@ const isNestedPropPath = /[./]/.test(propToDelete); | ||
// src/actions/delete.ts | ||
var import_is_what3 = require("is-what"); | ||
function deleteActionFactory(data, Vue3StoreOptions2, makeBackup) { | ||
var import_is_what4 = require("is-what"); | ||
function deleteActionFactory(data, Vue3StoreOptions, makeBackup) { | ||
return function({ | ||
@@ -142,3 +148,3 @@ payload, | ||
const _docId = docId || payload; | ||
if (!(0, import_is_what3.isFullString)(_docId)) | ||
if (!(0, import_is_what4.isFullString)(_docId)) | ||
throw new Error("No ID passed to delete action."); | ||
@@ -152,5 +158,5 @@ if (makeBackup) | ||
// src/actions/fetch.ts | ||
var import_is_what4 = require("is-what"); | ||
var import_is_what5 = require("is-what"); | ||
var import_utils = require("@magnetarjs/utils"); | ||
function fetchActionFactory(data, Vue3StoreOptions2) { | ||
function fetchActionFactory(data, Vue3StoreOptions) { | ||
return function({ | ||
@@ -207,7 +213,7 @@ payload, | ||
data, | ||
Vue3StoreOptions2 | ||
Vue3StoreOptions | ||
)({ | ||
payload: _payload, | ||
collectionPath, | ||
docId: docId || ((0, import_is_what4.isFullString)(meta.id) || (0, import_is_what4.isNumber)(meta.id) ? `${meta.id}` : void 0), | ||
docId: docId || ((0, import_is_what5.isFullString)(meta.id) || (0, import_is_what5.isNumber)(meta.id) ? `${meta.id}` : void 0), | ||
actionConfig, | ||
@@ -222,4 +228,4 @@ pluginModuleConfig | ||
// src/actions/stream.ts | ||
var import_is_what5 = require("is-what"); | ||
function streamActionFactory(data, Vue3StoreOptions2) { | ||
var import_is_what6 = require("is-what"); | ||
function streamActionFactory(data, Vue3StoreOptions) { | ||
return function({ | ||
@@ -240,3 +246,3 @@ payload, | ||
data, | ||
Vue3StoreOptions2 | ||
Vue3StoreOptions | ||
)({ | ||
@@ -256,3 +262,3 @@ payload: payload2, | ||
data, | ||
Vue3StoreOptions2 | ||
Vue3StoreOptions | ||
)({ | ||
@@ -269,7 +275,7 @@ payload: payload2, | ||
return; | ||
const collectionPathDocIdToDelete = (0, import_is_what5.isFullString)(docId) ? [collectionPath, docId] : (0, import_is_what5.isString)(payload2) ? [collectionPath, payload2] : [collectionPath, meta.id]; | ||
const collectionPathDocIdToDelete = (0, import_is_what6.isFullString)(docId) ? [collectionPath, docId] : (0, import_is_what6.isString)(payload2) ? [collectionPath, payload2] : [collectionPath, meta.id]; | ||
const [_cPath, _dId] = collectionPathDocIdToDelete; | ||
deleteActionFactory( | ||
data, | ||
Vue3StoreOptions2 | ||
Vue3StoreOptions | ||
)({ | ||
@@ -289,3 +295,3 @@ payload: void 0, | ||
// src/actions/revert.ts | ||
function revertActionFactory(data, Vue3StoreOptions2, restoreBackup) { | ||
function revertActionFactory(data, Vue3StoreOptions, restoreBackup) { | ||
return function({ | ||
@@ -358,3 +364,3 @@ payload, | ||
return; | ||
if (!docId && (0, import_is_what6.isArray)(initialData)) { | ||
if (!docId && (0, import_is_what7.isArray)(initialData)) { | ||
if (dataCollectionMap.size > 0) | ||
@@ -365,3 +371,3 @@ return; | ||
} | ||
} else if (docId && (0, import_is_what6.isPlainObject)(initialData)) { | ||
} else if (docId && (0, import_is_what7.isPlainObject)(initialData)) { | ||
if (dataCollectionMap.has(docId)) | ||
@@ -368,0 +374,0 @@ return; |
{ | ||
"name": "@magnetarjs/plugin-vue3", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"sideEffects": false, | ||
@@ -26,4 +26,4 @@ "description": "Magnetar plugin vue3", | ||
"dependencies": { | ||
"@magnetarjs/types": "0.8.2", | ||
"@magnetarjs/utils": "0.8.2", | ||
"@magnetarjs/types": "0.8.3", | ||
"@magnetarjs/utils": "0.8.3", | ||
"copy-anything": "^2.0.6", | ||
@@ -34,8 +34,7 @@ "filter-anything": "^2.2.4", | ||
"merge-anything": "^4.0.5", | ||
"path-to-prop": "1.0.2", | ||
"ts-toolbelt": "^9.6.0" | ||
"path-to-prop": "1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@magnetarjs/core": "0.8.2", | ||
"@magnetarjs/test-utils": "0.8.2", | ||
"@magnetarjs/core": "0.8.3", | ||
"@magnetarjs/test-utils": "0.8.3", | ||
"vue": "^3.2.26" | ||
@@ -42,0 +41,0 @@ }, |
Sorry, the diff of this file is not supported yet
28407
9
774
+ Added@magnetarjs/types@0.8.3(transitive)
+ Added@magnetarjs/utils@0.8.3(transitive)
- Removedts-toolbelt@^9.6.0
- Removed@magnetarjs/types@0.8.2(transitive)
- Removed@magnetarjs/utils@0.8.2(transitive)
Updated@magnetarjs/types@0.8.3
Updated@magnetarjs/utils@0.8.3