screenright-client 0.9.2 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -85,6 +85,7 @@ export const capture = (page, key, title, parentKey) => __awaiter(void 0, void 0
85
85
  const attribute = {
86
86
  key,
87
87
  title,
88
+ url: page.url(),
88
89
  childrens: [],
89
90
  };
90
91
  if (parentKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screenright-client",
3
- "version": "0.9.2",
3
+ "version": "0.9.4",
4
4
  "description": "screenright's nodejs client library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -7,7 +7,8 @@ import FormData from 'form-data'
7
7
  type ScreenshotItemAttribute = {
8
8
  key: string
9
9
  title: string
10
- childrens: ScreenshotItemAttribute[]
10
+ url: string
11
+ children: ScreenshotItemAttribute[]
11
12
  }
12
13
 
13
14
  type Result = {
@@ -109,18 +110,19 @@ export const capture = async (
109
110
  const attribute: ScreenshotItemAttribute = {
110
111
  key,
111
112
  title,
112
- childrens: [],
113
+ url: page.url(),
114
+ children: [],
113
115
  }
114
116
 
115
117
  if (parentKey) {
116
118
  const searchParent = (attributes: ScreenshotItemAttribute[]) => {
117
119
  for (let i = 0; i < attributes.length; i++) {
118
120
  if (attributes[i].key === parentKey) {
119
- attributes[i].childrens.push(attribute)
121
+ attributes[i].children.push(attribute)
120
122
  break
121
123
  }
122
124
 
123
- searchParent(attributes[i].childrens)
125
+ searchParent(attributes[i].children)
124
126
  }
125
127
  }
126
128