Skip to content

Commit 52543b0

Browse files
committed
feat: 支持数据变动监听
1 parent 6aaf6d5 commit 52543b0

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "next-flow-interface",
3-
"version": "0.23.13",
3+
"version": "0.23.14",
44
"description": "Interface package for NEXT FlOW. You can use this package to build your own plugin that can control anything.",
55
"type": "module",
66
"module": "dist/index.js",

src/service/sync/attribute/dto/instance/base-attribute.interface.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,9 @@ export default interface IBaseAttribute<T extends object = never> {
99

1010
defaultValue?: T
1111

12+
getPath(): RvPath
13+
1214
getPathString(): string
15+
16+
isMyPath(path: string | RvPath): boolean
1317
}

src/utils/rv-utils.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ export class RvUtils {
122122
return true
123123
}
124124

125+
static checkRvPathStartWith(from: RvPath | string, target: RvPath | string): boolean {
126+
const fromPath = RvUtils.ensureRvPath(from)
127+
const targetPath = RvUtils.ensureRvPath(target)
128+
if (fromPath.length < targetPath.length) {
129+
return false
130+
}
131+
for (let i = 0; i < fromPath.length; i++) {
132+
if (targetPath[i] != fromPath[i]) {
133+
return false
134+
}
135+
}
136+
return true
137+
}
138+
125139
/**
126140
* 检查路径是否与目标列表中的任意路径重叠
127141
* @param from - 要检查的路径

0 commit comments

Comments
 (0)