@player-ui/data-filter-plugin 0.14.1--canary.720.28165 → 0.14.1--canary.733.28263

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.
@@ -0,0 +1,41 @@
1
+ // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/data-filter/core/src/index.ts
2
+ import get from "dlv";
3
+ import { omit, setIn } from "timm";
4
+ function omitIn(obj, path) {
5
+ if (typeof path === "string") {
6
+ return omit(obj, path);
7
+ }
8
+ if (path.length === 1) {
9
+ return omit(obj, path[0]);
10
+ }
11
+ const parentPath = [...path];
12
+ const attr = parentPath.pop();
13
+ if (!attr) {
14
+ return obj;
15
+ }
16
+ const parentObj = get(obj, parentPath);
17
+ return setIn(obj, parentPath, omit(parentObj, attr));
18
+ }
19
+ var DataFilterPlugin = class {
20
+ constructor(options = {}) {
21
+ this.name = "data-filter";
22
+ this.options = options;
23
+ }
24
+ apply(player) {
25
+ player.hooks.dataController.tap(this.name, (dataController) => {
26
+ dataController.hooks.serialize.tap(this.name, (serializedModel) => {
27
+ let updatedModel = serializedModel;
28
+ this.options.paths?.forEach((path) => {
29
+ const arrPath = Array.isArray(path) ? path : path.split(".");
30
+ updatedModel = omitIn(updatedModel, arrPath);
31
+ });
32
+ return updatedModel;
33
+ });
34
+ });
35
+ }
36
+ };
37
+ export {
38
+ DataFilterPlugin,
39
+ omitIn
40
+ };
41
+ //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -6,10 +6,10 @@
6
6
  "types"
7
7
  ],
8
8
  "name": "@player-ui/data-filter-plugin",
9
- "version": "0.14.1--canary.720.28165",
9
+ "version": "0.14.1--canary.733.28263",
10
10
  "main": "dist/cjs/index.cjs",
11
11
  "peerDependencies": {
12
- "@player-ui/player": "0.14.1--canary.720.28165"
12
+ "@player-ui/player": "0.14.1--canary.733.28263"
13
13
  },
14
14
  "devDependencies": {
15
15
  "@player-ui/make-flow": "workspace:*"