@peter.naydenov/walk-async 1.3.0 → 2.0.0

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,5 +1,14 @@
1
1
  # Release History
2
2
 
3
+ ### 2.0.0 ( 2024-01-01)
4
+ - [x] Module converted to ES module;
5
+ - [x] Dev dependencies updates;
6
+
7
+
8
+
9
+ ### 1.3.1 ( 2023-10-25)
10
+ - [x] Dependencies update. Ask-for-promise version 1.4.0;
11
+
3
12
 
4
13
 
5
14
  ### 1.3.0 ( 2023-09-23)
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ![version](https://img.shields.io/github/package-json/v/peterNaydenov/walk-async)
4
4
  ![license](https://img.shields.io/github/license/peterNaydenov/walk-async)
5
+ ![GitHub issues](https://img.shields.io/github/issues/peterNaydenov/walk-async)
6
+ ![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40peter.naydenov%2Fwalk-async)
5
7
 
6
8
  Creates an immutable copies of javascript data structures(objects, arrays or mixed). Can execute callback functions on every object property(objectCallback) and/or every primitive property(keyCallback). Callbacks can modify result object during the walk process. Mask, filter or substitute values during the copy process.
7
9
 
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@peter.naydenov/walk-async",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "Deep copy with fine control during the process. Can be used also as a deep forEach function",
5
5
  "main": "src/main.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "test": "mocha test",
8
- "cover": "nyc mocha test"
9
+ "cover": "c8 mocha test"
9
10
  },
10
11
  "repository": {
11
12
  "type": "git",
@@ -14,14 +15,14 @@
14
15
  "author": "Peter Naydenov",
15
16
  "license": "MIT",
16
17
  "dependencies": {
17
- "ask-for-promise": "1.3.1"
18
+ "ask-for-promise": "1.5.0"
18
19
  },
19
20
  "devDependencies": {
20
- "chai": "^4.3.8",
21
- "mocha": "^10.2.0",
22
- "nyc": "^15.1.0"
21
+ "c8": "^8.0.1",
22
+ "chai": "^5.0.0",
23
+ "mocha": "^10.2.0"
23
24
  },
24
- "nyc": {
25
+ "c8": {
25
26
  "include": [
26
27
  "src/**/*.js"
27
28
  ],
package/src/main.js CHANGED
@@ -9,12 +9,12 @@
9
9
  *
10
10
  * History notes:
11
11
  * - Walk-async was born on September 18th, 2022
12
+ * - Converted to ES module on January 1st, 2024
12
13
  *
13
14
  */
14
15
 
15
16
 
16
-
17
- const askForPromise = require("ask-for-promise");
17
+ import askForPromise from "ask-for-promise"
18
18
 
19
19
 
20
20
 
@@ -198,6 +198,6 @@ function copyObject ( origin, result, extend, cb, breadcrumbs, ...args ) {
198
198
 
199
199
 
200
200
 
201
- module.exports = walk
201
+ export default walk
202
202
 
203
203
 
@@ -1,10 +1,8 @@
1
1
  "use strict"
2
2
 
3
- const
4
- chai = require ( 'chai' )
5
- , expect = chai.expect
6
- , walk = require ( '../src/main.js' )
7
- ;
3
+ import { expect } from 'chai'
4
+ import walk from '../src/main.js'
5
+
8
6
 
9
7
 
10
8
  describe ( 'Walk-async -> Deep copy', () => {
@@ -1,10 +1,8 @@
1
1
  "use strict"
2
2
 
3
- const
4
- chai = require ( 'chai' )
5
- , expect = chai.expect
6
- , walk = require ( '../src/main.js' )
7
- ;
3
+ import { expect } from 'chai'
4
+ import walk from '../src/main.js'
5
+
8
6
 
9
7
 
10
8
  describe ( 'Walk-async -> keyCallback function', () => {
@@ -1,10 +1,8 @@
1
1
  "use strict"
2
2
 
3
- const
4
- chai = require ( 'chai' )
5
- , expect = chai.expect
6
- , walk = require ( '../src/main.js' )
7
- ;
3
+ import { expect } from 'chai'
4
+ import walk from '../src/main.js'
5
+
8
6
 
9
7
 
10
8
  describe ( 'Walk-async -> objectCallback function', () => {
@@ -1,11 +1,8 @@
1
1
  "use strict"
2
2
 
3
- const
4
- chai = require ( 'chai' )
5
- , expect = chai.expect
6
- , walk = require ( '../src/main.js' )
7
- , askForPromise = require ( 'ask-for-promise' )
8
- ;
3
+ import { expect } from 'chai'
4
+ import walk from '../src/main.js'
5
+
9
6
 
10
7
 
11
8
  describe ( 'Walk-async -> Asynchronous tests', () => {
@@ -1,10 +1,8 @@
1
1
  "use strict"
2
2
 
3
- const
4
- chai = require ( 'chai' )
5
- , expect = chai.expect
6
- , walk = require ( '../src/main.js' )
7
- ;
3
+ import { expect } from 'chai'
4
+ import walk from '../src/main.js'
5
+
8
6
 
9
7
 
10
8
  describe ( 'Walk-async -> Both callbacks together', () => {