@magnetarjs/core
Advanced tools
Comparing version 0.7.5 to 0.7.6
@@ -18,2 +18,3 @@ "use strict"; | ||
}; | ||
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
@@ -25,33 +26,8 @@ | ||
Magnetar: () => Magnetar, | ||
actionNameTypeMap: () => actionNameTypeMap, | ||
getCollectionPathDocIdEntry: () => getCollectionPathDocIdEntry, | ||
getCollectionWriteLocks: () => getCollectionWriteLocks, | ||
getEventNameFnsMap: () => getEventNameFnsMap | ||
getCollectionWriteLocks: () => getCollectionWriteLocks | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
__reExport(src_exports, require("@magnetarjs/types"), module.exports); | ||
// ../types/src/types/actionsInternal.ts | ||
var actionNameTypeMap = { | ||
fetch: "read", | ||
stream: "read", | ||
insert: "write", | ||
merge: "write", | ||
assign: "write", | ||
replace: "write", | ||
deleteProp: "write", | ||
delete: "delete" | ||
}; | ||
// ../types/src/types/events.ts | ||
function getEventNameFnsMap(...onMaps) { | ||
const _onMaps = onMaps.filter(Boolean); | ||
const result = { | ||
before: _onMaps.flatMap((on) => on.before ?? []), | ||
success: _onMaps.flatMap((on) => on.success ?? []), | ||
error: _onMaps.flatMap((on) => on.error ?? []), | ||
revert: _onMaps.flatMap((on) => on.revert ?? []) | ||
}; | ||
return result; | ||
} | ||
// src/Magnetar.ts | ||
@@ -62,2 +38,3 @@ var import_getorset_anything = require("getorset-anything"); | ||
var import_merge_anything = require("merge-anything"); | ||
var import_types = require("@magnetarjs/types"); | ||
@@ -127,3 +104,3 @@ // src/moduleActions/handleActionPerStore.ts | ||
// src/helpers/eventHelpers.ts | ||
function getEventNameFnsMap2(...onMaps) { | ||
function getEventNameFnsMap(...onMaps) { | ||
const _onMaps = onMaps.filter(Boolean); | ||
@@ -356,3 +333,3 @@ const result = { | ||
); | ||
const eventNameFnsMap = getEventNameFnsMap2( | ||
const eventNameFnsMap = getEventNameFnsMap( | ||
globalConfig.on, | ||
@@ -539,3 +516,3 @@ moduleConfig.on, | ||
return foundStream; | ||
const eventNameFnsMap = getEventNameFnsMap2(globalConfig.on, moduleConfig.on, actionConfig.on); | ||
const eventNameFnsMap = getEventNameFnsMap(globalConfig.on, moduleConfig.on, actionConfig.on); | ||
const modifyPayloadFnsMap = getModifyPayloadFnsMap( | ||
@@ -662,6 +639,6 @@ globalConfig.modifyPayloadOn, | ||
}; | ||
const insert = handleActionPerStore(sharedParams, "insert", actionNameTypeMap.insert); | ||
const _delete = handleActionPerStore(sharedParams, "delete", actionNameTypeMap.delete); | ||
const fetch = handleActionPerStore(sharedParams, "fetch", actionNameTypeMap.fetch); | ||
const stream = handleStreamPerStore([collectionPath, docId], moduleConfig, globalConfig, actionNameTypeMap.stream, streaming, cacheStream, writeLockMap); | ||
const insert = handleActionPerStore(sharedParams, "insert", import_types.actionNameTypeMap.insert); | ||
const _delete = handleActionPerStore(sharedParams, "delete", import_types.actionNameTypeMap.delete); | ||
const fetch = handleActionPerStore(sharedParams, "fetch", import_types.actionNameTypeMap.fetch); | ||
const stream = handleStreamPerStore([collectionPath, docId], moduleConfig, globalConfig, import_types.actionNameTypeMap.stream, streaming, cacheStream, writeLockMap); | ||
const actions = { stream, fetch, insert, delete: _delete }; | ||
@@ -728,2 +705,3 @@ executeSetupModulePerStore(globalConfig.stores, [collectionPath, docId], moduleConfig); | ||
// src/Doc.ts | ||
var import_types2 = require("@magnetarjs/types"); | ||
function createDocWithContext([collectionPath, docId], moduleConfig, globalConfig, docFn, collectionFn, streamAndFetchPromises) { | ||
@@ -746,10 +724,10 @@ const { writeLockMap, fetchPromises, cacheStream, streaming, closeStream } = streamAndFetchPromises; | ||
const actions = { | ||
insert: handleActionPerStore(sharedParams, "insert", actionNameTypeMap.insert), | ||
merge: handleActionPerStore(sharedParams, "merge", actionNameTypeMap.merge), | ||
assign: handleActionPerStore(sharedParams, "assign", actionNameTypeMap.assign), | ||
replace: handleActionPerStore(sharedParams, "replace", actionNameTypeMap.replace), | ||
deleteProp: handleActionPerStore(sharedParams, "deleteProp", actionNameTypeMap.deleteProp), | ||
delete: handleActionPerStore(sharedParams, "delete", actionNameTypeMap.delete), | ||
fetch: handleActionPerStore(sharedParams, "fetch", actionNameTypeMap.fetch), | ||
stream: handleStreamPerStore([collectionPath, docId], moduleConfig, globalConfig, actionNameTypeMap.stream, streaming, cacheStream, writeLockMap) | ||
insert: handleActionPerStore(sharedParams, "insert", import_types2.actionNameTypeMap.insert), | ||
merge: handleActionPerStore(sharedParams, "merge", import_types2.actionNameTypeMap.merge), | ||
assign: handleActionPerStore(sharedParams, "assign", import_types2.actionNameTypeMap.assign), | ||
replace: handleActionPerStore(sharedParams, "replace", import_types2.actionNameTypeMap.replace), | ||
deleteProp: handleActionPerStore(sharedParams, "deleteProp", import_types2.actionNameTypeMap.deleteProp), | ||
delete: handleActionPerStore(sharedParams, "delete", import_types2.actionNameTypeMap.delete), | ||
fetch: handleActionPerStore(sharedParams, "fetch", import_types2.actionNameTypeMap.fetch), | ||
stream: handleStreamPerStore([collectionPath, docId], moduleConfig, globalConfig, import_types2.actionNameTypeMap.stream, streaming, cacheStream, writeLockMap) | ||
}; | ||
@@ -872,6 +850,4 @@ executeSetupModulePerStore(globalConfig.stores, [collectionPath, docId], moduleConfig); | ||
Magnetar, | ||
actionNameTypeMap, | ||
getCollectionPathDocIdEntry, | ||
getCollectionWriteLocks, | ||
getEventNameFnsMap | ||
getCollectionWriteLocks | ||
}); |
{ | ||
"name": "@magnetarjs/core", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"sideEffects": false, | ||
@@ -23,3 +23,4 @@ "description": "Magnetar core library.", | ||
"dependencies": { | ||
"@magnetarjs/utils": "0.7.5", | ||
"@magnetarjs/types": "0.7.6", | ||
"@magnetarjs/utils": "0.7.6", | ||
"getorset-anything": "^0.0.2", | ||
@@ -31,3 +32,3 @@ "is-what": "^3.14.1", | ||
"devDependencies": { | ||
"@magnetarjs/test-utils": "0.7.5" | ||
"@magnetarjs/test-utils": "0.7.6" | ||
}, | ||
@@ -34,0 +35,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65158
6
1641
+ Added@magnetarjs/types@0.7.6
+ Added@magnetarjs/types@0.7.6(transitive)
+ Added@magnetarjs/utils@0.7.6(transitive)
- Removed@magnetarjs/utils@0.7.5(transitive)
Updated@magnetarjs/utils@0.7.6