@peter.naydenov/walk-async 3.0.0 → 3.0.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/Changelog.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Release History
2
2
 
3
3
 
4
+ ### 3.0.1 ( 2024-12-18)
5
+ - [x] Dependencies updates. Ask-for-promise to version 3.0.1;
6
+
7
+
4
8
 
5
9
  ### 3.0.0 ( 2024-12-04)
6
10
  - [x] Object callback will be triggered on 'root' object as well;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peter.naydenov/walk-async",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Deep copy with fine control during the process. Can be used also as a deep forEach function",
5
5
  "main": ".dist/walk-async.umd.js",
6
6
  "type": "module",
@@ -26,16 +26,16 @@
26
26
  "author": "Peter Naydenov",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "ask-for-promise": "2.0.3"
29
+ "ask-for-promise": "3.0.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@rollup/plugin-commonjs": "^28.0.1",
33
- "@rollup/plugin-node-resolve": "^15.3.0",
32
+ "@rollup/plugin-commonjs": "^28.0.2",
33
+ "@rollup/plugin-node-resolve": "^16.0.0",
34
34
  "@rollup/plugin-terser": "^0.4.4",
35
- "c8": "^10.1.2",
35
+ "c8": "^10.1.3",
36
36
  "chai": "^5.1.2",
37
37
  "mocha": "^11.0.1",
38
- "rollup": "^4.28.0"
38
+ "rollup": "^4.28.1"
39
39
  },
40
40
  "c8": {
41
41
  "include": [
package/src/main.js CHANGED
@@ -31,7 +31,7 @@ function walk ({
31
31
  , cb = [ keyCallback, objectCallback ]
32
32
  , end = askForPromise ()
33
33
  ;
34
-
34
+
35
35
  switch ( type ) {
36
36
  case 'array' :
37
37
  result = []
@@ -124,7 +124,7 @@ function copyObject ( origin, result, extend, cb, breadcrumbs, ...args ) {
124
124
  }
125
125
 
126
126
  objectCallbackTask.onComplete ( res => {
127
- if ( res === '$$cancel' && origin.hasOwnProperty(item) ) { // deep copy, no callbacks
127
+ if ( res === '$$cancel' && !keyCallback ) { // deep copy, no callbacks
128
128
  keyCallbackTask.done ( '$$noUpdates' )
129
129
  return
130
130
  }
@@ -133,7 +133,7 @@ function copyObject ( origin, result, extend, cb, breadcrumbs, ...args ) {
133
133
  type = findType ( item )
134
134
  }
135
135
  if ( item == IGNORE ) {
136
- executeCallback[i].done ( 'ignore object' )
136
+ executeCallback.promises[i].done ( 'ignore object' )
137
137
  return
138
138
  }
139
139
  if ( type === 'simple' ) {
@@ -157,11 +157,11 @@ function copyObject ( origin, result, extend, cb, breadcrumbs, ...args ) {
157
157
  keyCallbackTask.onComplete ( value => {
158
158
  if ( isRoot ) {
159
159
  extend.push ( generateList ( item, result, extend, cb, 'root', args ) )
160
- executeCallback[i].done ( 'root' )
160
+ executeCallback.promises[i].done ( 'root' )
161
161
  return
162
162
  }
163
163
  if ( value == IGNORE ) {
164
- executeCallback[i].done ( 'ignore key' )
164
+ executeCallback.promises[i].done ( 'ignore key' )
165
165
  return
166
166
  }
167
167
  if ( value === '$$cancel' ) {
@@ -170,15 +170,16 @@ function copyObject ( origin, result, extend, cb, breadcrumbs, ...args ) {
170
170
  }
171
171
  if ( value !== '$$noUpdates' ) {
172
172
  item = value
173
- type = findType ( item )
173
+ type = findType ( item )
174
174
  }
175
175
  if ( type === 'simple' ) {
176
176
  const canInsert = validateForInsertion ( k, result )
177
177
  if ( canInsert ) result.push ( item )
178
178
  else result [k] = item
179
- executeCallback[i].done ('key')
179
+ executeCallback.promises[i].done ('key')
180
180
  return
181
181
  }
182
+
182
183
  finishWithCallbacks.done ()
183
184
  }) // keyCallbackTask complete
184
185
 
@@ -188,14 +189,14 @@ function copyObject ( origin, result, extend, cb, breadcrumbs, ...args ) {
188
189
  if ( resultIsArray && keyNumber ) result.push ( newObject )
189
190
  else result[k] = newObject
190
191
  extend.push ( generateList( item, newObject, extend, cb, br, args ) )
191
- executeCallback[i].done ('object')
192
+ executeCallback.promises[i].done ('object')
192
193
  }
193
194
  if ( type === 'array' ) {
194
195
  const newArray = [];
195
196
  if ( resultIsArray && keyNumber ) result.push ( newArray )
196
197
  else result[k] = newArray
197
198
  extend.push ( generateList( item, newArray, extend, cb, br, args ) )
198
- executeCallback[i].done ('array')
199
+ executeCallback.promises[i].done ('array')
199
200
  }
200
201
  })
201
202
  }) // forEach k