UNPKG

@magnetarjs/core

Version:
19 lines (18 loc) 532 B
import { merge } from 'merge-anything'; export function defaultsGlobalConfig(config) { if (!('stores' in config)) { throw new Error('GlobalConfig must have a stores property with at least one plugin provided for the `cache` key'); } const defaults = { executionOrder: { read: [], write: [], }, onError: 'revert', on: {}, modifyPayloadOn: {}, modifyReadResponseOn: {}, }; const merged = merge(defaults, config); return merged; }