@spoosh/plugin-invalidation 0.7.0 → 0.7.1

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/index.js CHANGED
@@ -25,14 +25,16 @@ __export(src_exports, {
25
25
  module.exports = __toCommonJS(src_exports);
26
26
 
27
27
  // src/plugin.ts
28
+ var import_core = require("@spoosh/core");
28
29
  var PLUGIN_NAME = "spoosh:invalidation";
29
30
  var INVALIDATION_DEFAULT_KEY = "invalidation:defaultMode";
30
31
  function resolveModeTags(context, mode) {
32
+ const params = context.request.params;
31
33
  switch (mode) {
32
34
  case "all":
33
- return context.tags;
35
+ return context.tags.map((tag) => (0, import_core.resolvePathString)(tag, params));
34
36
  case "self":
35
- return [context.path];
37
+ return [(0, import_core.resolvePathString)(context.path, params)];
36
38
  case "none":
37
39
  return [];
38
40
  }
package/dist/index.mjs CHANGED
@@ -1,12 +1,14 @@
1
1
  // src/plugin.ts
2
+ import { resolvePathString } from "@spoosh/core";
2
3
  var PLUGIN_NAME = "spoosh:invalidation";
3
4
  var INVALIDATION_DEFAULT_KEY = "invalidation:defaultMode";
4
5
  function resolveModeTags(context, mode) {
6
+ const params = context.request.params;
5
7
  switch (mode) {
6
8
  case "all":
7
- return context.tags;
9
+ return context.tags.map((tag) => resolvePathString(tag, params));
8
10
  case "self":
9
- return [context.path];
11
+ return [resolvePathString(context.path, params)];
10
12
  case "none":
11
13
  return [];
12
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spoosh/plugin-invalidation",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Cache invalidation plugin for Spoosh - auto-invalidates after mutations",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,10 +33,10 @@
33
33
  }
34
34
  },
35
35
  "peerDependencies": {
36
- "@spoosh/core": ">=0.13.1"
36
+ "@spoosh/core": ">=0.13.2"
37
37
  },
38
38
  "devDependencies": {
39
- "@spoosh/core": "0.13.1",
39
+ "@spoosh/core": "0.13.2",
40
40
  "@spoosh/test-utils": "0.2.0"
41
41
  },
42
42
  "scripts": {