align-spaces 1.0.4 → 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 CHANGED
@@ -1,3 +1,22 @@
1
+ 2025.02.09, v2.0.0
2
+
3
+ feature:
4
+ - 60bd85c align-spaces: drop support of node < 18
5
+ - 0f575d8 align-spaces: eslint-plugin-n v17.15.1
6
+ - c33fd25 align-spaces: eslint-plugin-putout v24.0.1
7
+ - ba856e7 align-spaces: eslint v9.20.0
8
+ - 7ef515c align-spaces: madrun v10.2.4
9
+ - 1b1871a align-spaces: nodemon v3.1.9
10
+ - abb8ddd align-spaces: c8 v10.1.3
11
+ - a100cec align-spaces: putout v38.0.9
12
+ - 66cea8e align-spaces: supertape v10.10.0
13
+ - 0a4942b (package) supertape v2.0.1
14
+ - a805089 (package) putout v9.1.0
15
+ - a0a1644 (package) madrun v7.0.0
16
+ - 43e7ec8 (package) eslint-plugin-putout v5.0.1
17
+ - 224c1a5 (package) eslint v7.3.1
18
+ - 1853e0c (package) try-catch v3.0.0
19
+
1
20
  2020.02.24, v1.0.4
2
21
 
3
22
  feature:
package/README.md CHANGED
@@ -1,14 +1,11 @@
1
- # Align Spaces [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # Align Spaces [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
- [NPMIMGURL]: https://img.shields.io/npm/v/align-spaces.svg?style=flat&longCache=true
4
- [BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/align-spaces/master.svg?style=flat&longCache=true
5
- [DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/align-spaces.svg?style=flat&longCache=true
6
- [NPMURL]: https://npmjs.org/package/align-spaces "npm"
7
- [BuildStatusURL]: https://travis-ci.org/coderaiser/align-spaces "Build Status"
8
- [DependencyStatusURL]: https://david-dm.org/coderaiser/align-spaces "Dependency Status"
9
-
10
- [CoverageURL]: https://coveralls.io/github/coderaiser/align-spaces?branch=master
11
- [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/align-spaces/badge.svg?branch=master&service=github
3
+ [NPMIMGURL]: https://img.shields.io/npm/v/align-spaces.svg?style=flat&longCache=true
4
+ [NPMURL]: https://npmjs.org/package/align-spaces "npm"
5
+ [BuildStatusURL]: https://github.com/coderaiser/align-spaces/actions?query=workflow%3A%22Node+CI%22 "Build Status"
6
+ [BuildStatusIMGURL]: https://github.com/coderaiser/align-spaces/workflows/Node%20CI/badge.svg
7
+ [CoverageURL]: https://coveralls.io/github/coderaiser/align-spaces?branch=master
8
+ [CoverageIMGURL]: https://coveralls.io/repos/coderaiser/align-spaces/badge.svg?branch=master&service=github
12
9
 
13
10
  Align spaces on empty lines of a source code.
14
11
 
@@ -36,10 +33,11 @@ const t = 'hello';
36
33
 
37
34
  module.exports = () => {
38
35
  cosnt m = 'world';
39
-
36
+
40
37
  return t + m;
41
38
  };
42
39
  `);
40
+
43
41
  // returns
44
42
  `
45
43
  const t = 'hello';
@@ -49,7 +47,7 @@ module.exports = () => {
49
47
  ....
50
48
  return t + m;
51
49
  };
52
- `
50
+ `;
53
51
  ```
54
52
 
55
53
  ## Related
@@ -60,4 +58,3 @@ module.exports = () => {
60
58
  ## License
61
59
 
62
60
  MIT
63
-
@@ -2,6 +2,7 @@
2
2
 
3
3
  'use strict';
4
4
 
5
+ const process = require('node:process');
5
6
  const [name] = process.argv.slice(2);
6
7
 
7
8
  if (!name) {
@@ -9,10 +10,10 @@ if (!name) {
9
10
  process.exit();
10
11
  }
11
12
 
12
- const fs = require('fs');
13
+ const fs = require('node:fs');
14
+
13
15
  const alignSpaces = require('..');
14
16
 
15
17
  const str = fs.readFileSync(name, 'utf8');
16
18
 
17
19
  fs.writeFileSync(name, alignSpaces(str));
18
-
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const isString = (a) => typeof a === 'string';
4
+
3
5
  module.exports = (str) => {
4
6
  check(str);
5
7
 
@@ -46,7 +48,6 @@ function getSpaces(s) {
46
48
  }
47
49
 
48
50
  function check(str) {
49
- if (typeof str !== 'string')
51
+ if (!isString(str))
50
52
  throw Error('str should be a string!');
51
53
  }
52
-
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "align-spaces",
3
- "version": "1.0.4",
3
+ "version": "2.0.0",
4
+ "type": "commonjs",
4
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
6
  "description": "align spaces on empty lines of a source code",
6
7
  "homepage": "http://github.com/coderaiser/align-spaces",
@@ -10,13 +11,7 @@
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
13
- "url": "git://github.com/coderaiser/align-spaces.git"
14
- },
15
- "nyc": {
16
- "exclude": [
17
- "test",
18
- "madrun.js"
19
- ]
14
+ "url": "git+https://github.com/coderaiser/align-spaces.git"
20
15
  },
21
16
  "scripts": {
22
17
  "test": "madrun test",
@@ -34,20 +29,20 @@
34
29
  "align-whitespaces"
35
30
  ],
36
31
  "devDependencies": {
32
+ "c8": "^10.1.3",
37
33
  "coveralls": "^3.0.0",
38
- "eslint": "^6.0.0-rc.0",
39
- "eslint-plugin-node": "^11.0.0",
40
- "eslint-plugin-putout": "^3.2.1",
41
- "madrun": "^5.4.2",
42
- "nodemon": "^2.0.2",
43
- "nyc": "^15.0.0",
44
- "putout": "^7.13.1",
45
- "supertape": "^1.2.0",
46
- "try-catch": "^2.0.0"
34
+ "eslint": "^9.20.0",
35
+ "eslint-plugin-n": "^17.15.1",
36
+ "eslint-plugin-putout": "^24.0.1",
37
+ "madrun": "^10.2.4",
38
+ "nodemon": "^3.1.9",
39
+ "putout": "^38.0.9",
40
+ "supertape": "^10.10.0",
41
+ "try-catch": "^3.0.0"
47
42
  },
48
43
  "license": "MIT",
49
44
  "engines": {
50
- "node": ">=8.3.0"
45
+ "node": ">=18"
51
46
  },
52
47
  "publishConfig": {
53
48
  "access": "public"