strictr 0.4.0 → 0.5.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/README.md +4 -4
- package/lib/check.js +26 -37
- package/lib/check.js.map +1 -1
- package/lib/functions/convert.files.to.objects.js +7 -4
- package/lib/functions/convert.files.to.objects.js.map +1 -1
- package/lib/functions/get.config.js +10 -34
- package/lib/functions/get.config.js.map +1 -1
- package/lib/functions/get.files.listing.js +11 -11
- package/lib/functions/get.files.listing.js.map +1 -1
- package/lib/functions/get.table.from.file.objects.js +2 -35
- package/lib/functions/get.table.from.file.objects.js.map +1 -1
- package/lib/types.d.ts +1 -3
- package/package.json +77 -77
package/README.md
CHANGED
|
@@ -8,12 +8,12 @@ You can change default configuration via ```.strictr.json``` file:
|
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
{
|
|
11
|
-
"
|
|
12
|
-
"filesExtension": "ts", // default detects: "ts" for typescript and "js" for javascript
|
|
13
|
-
"testFolderName": "test", // default: "test"
|
|
11
|
+
"directories": ["src", "test"] // default: ["src", "test"]
|
|
14
12
|
}
|
|
15
13
|
```
|
|
16
14
|
|
|
15
|
+
**Note**: strictr automatically checks both `.js` and `.ts` files.
|
|
16
|
+
|
|
17
17
|
## help
|
|
18
18
|
|
|
19
19
|
```
|
|
@@ -31,7 +31,7 @@ Use .strictr.json config file to override default settings.
|
|
|
31
31
|
|
|
32
32
|
Options:
|
|
33
33
|
-V, --version output the version number
|
|
34
|
-
-
|
|
34
|
+
-f, --fix Fix missing strict statements (default: false)
|
|
35
35
|
-c, --config <config> Alternative config file (must be .json) (default: ".strictr.json")
|
|
36
36
|
-h, --help display help for command
|
|
37
37
|
```
|
package/lib/check.js
CHANGED
|
@@ -38,7 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
|
-
const
|
|
41
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
42
42
|
const bail_1 = __importDefault(require("./functions/bail"));
|
|
43
43
|
const get_config_1 = __importDefault(require("./functions/get.config"));
|
|
44
44
|
const check_folder_1 = __importDefault(require("./functions/check.folder"));
|
|
@@ -51,55 +51,44 @@ const clc = require('cli-color');
|
|
|
51
51
|
exports.default = {
|
|
52
52
|
run: (commander) => {
|
|
53
53
|
console.log(clc.blue.bgGreen.bold('\n*** STRICTR ***'));
|
|
54
|
-
const options =
|
|
55
|
-
const {
|
|
54
|
+
const options = lodash_1.default.pick(commander, ['config', 'fix']);
|
|
55
|
+
const { fix = false } = options;
|
|
56
56
|
const root = process.cwd();
|
|
57
57
|
const config = (0, get_config_1.default)(root, (options === null || options === void 0 ? void 0 : options.config) || '.strictr.json');
|
|
58
|
-
const {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
58
|
+
const { directories } = config;
|
|
59
|
+
lodash_1.default.each(directories, (dir) => {
|
|
60
|
+
const dirPath = path.join(root, dir);
|
|
61
|
+
(0, check_folder_1.default)(dirPath, dir);
|
|
62
|
+
});
|
|
63
|
+
let allFiles = [];
|
|
64
|
+
lodash_1.default.each(directories, (dir) => {
|
|
65
|
+
const dirPath = path.join(root, dir);
|
|
66
|
+
const files = (0, get_files_listing_1.default)(dirPath);
|
|
67
|
+
allFiles = allFiles.concat(files);
|
|
68
|
+
});
|
|
69
|
+
const filesWithoutStrict = allFiles.filter(missing_strict_statement_1.default);
|
|
70
|
+
if (!lodash_1.default.isEmpty(filesWithoutStrict)) {
|
|
71
|
+
console.log(clc.red('\nStrictr: Files missing the ' + clc.italic("'use strict';") + ' statement:'));
|
|
72
|
+
console.log(clc.red((0, get_table_from_file_objects_1.default)((0, convert_files_to_objects_1.default)(filesWithoutStrict)).toString()));
|
|
70
73
|
}
|
|
71
|
-
else
|
|
72
|
-
console.log(clc.green('\n✅ Strictr: No
|
|
73
|
-
testFiles = testFiles.filter(missing_strict_statement_1.default);
|
|
74
|
-
if (!_.isEmpty(testFiles)) {
|
|
75
|
-
console.log(clc.red('\nStrictr: Test files missing the ' + clc.italic("'use strict';") + ' statement:'));
|
|
76
|
-
console.log(clc.red((0, get_table_from_file_objects_1.default)((0, convert_files_to_objects_1.default)(testFiles)).toString()));
|
|
74
|
+
else {
|
|
75
|
+
console.log(clc.green('\n✅ Strictr: No files are missing the ' + clc.italic("'use strict';") + ' statement.'));
|
|
77
76
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (add) {
|
|
81
|
-
if (_.isEmpty(srcFiles) && _.isEmpty(testFiles)) {
|
|
77
|
+
if (fix) {
|
|
78
|
+
if (lodash_1.default.isEmpty(filesWithoutStrict)) {
|
|
82
79
|
return console.log(clc.green('\n✅ ' + clc.bold('Strictr') + ': Everything is awesome!\n'));
|
|
83
80
|
}
|
|
84
|
-
console.log(clc.blue('\n🔍 Strictr:
|
|
85
|
-
|
|
86
|
-
(0, add_use_strict_1.default)(file);
|
|
87
|
-
});
|
|
88
|
-
console.log('');
|
|
89
|
-
_.each(testFiles, (file) => {
|
|
81
|
+
console.log(clc.blue('\n🔍 Strictr: Fix is set to true. Adding ' + clc.italic("'use strict';") + ' where I can...\n'));
|
|
82
|
+
lodash_1.default.each(filesWithoutStrict, (file) => {
|
|
90
83
|
(0, add_use_strict_1.default)(file);
|
|
91
84
|
});
|
|
92
85
|
console.log('\n');
|
|
93
86
|
}
|
|
94
87
|
else {
|
|
95
|
-
if (
|
|
88
|
+
if (lodash_1.default.isEmpty(filesWithoutStrict)) {
|
|
96
89
|
return console.log(clc.green('\n✅ ' + clc.bold('Strictr') + ': Everything is awesome!\n'));
|
|
97
90
|
}
|
|
98
|
-
|
|
99
|
-
if (!_.isEmpty(srcFiles))
|
|
100
|
-
message += clc.bold('Strictr ERROR:') + ' There are source files missing the ' + clc.italic("'use strict';") + ' statement!\n';
|
|
101
|
-
if (!_.isEmpty(testFiles))
|
|
102
|
-
message += clc.bold('Strictr ERROR:') + ' There are test files missing the ' + clc.italic("'use strict';") + ' statement!\n';
|
|
91
|
+
const message = '\n' + clc.bold('Strictr ERROR:') + ' There are files missing the ' + clc.italic("'use strict';") + ' statement!\n';
|
|
103
92
|
(0, bail_1.default)(clc.red(message));
|
|
104
93
|
}
|
|
105
94
|
}
|
package/lib/check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,2CAA6B;AAE7B,
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../src/check.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,2CAA6B;AAE7B,oDAAuB;AAIvB,4DAAoC;AACpC,wEAA+C;AAC/C,4EAAmD;AACnD,gFAAsD;AACtD,sFAA4D;AAC5D,oGAAyE;AACzE,oGAA0E;AAC1E,0GAA8E;AAE9E,MAAM,GAAG,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAEjC,kBAAe;IACd,GAAG,EAAE,CAAC,SAA2B,EAAQ,EAAE;QAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAExD,MAAM,OAAO,GAA8B,gBAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QAChF,MAAM,EAAC,GAAG,GAAG,KAAK,EAAC,GAAG,OAAO,CAAC;QAE9B,MAAM,IAAI,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,MAAM,GAAW,IAAA,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};
|
|
35
35
|
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
40
|
const os = __importStar(require("node:os"));
|
|
38
|
-
const
|
|
41
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
39
42
|
const convertFilesToObjects = (files) => {
|
|
40
43
|
const platform = os.platform();
|
|
41
44
|
const separator = 'win32' === platform ? '\\' : '/';
|
|
42
|
-
return
|
|
43
|
-
const parts =
|
|
45
|
+
return lodash_1.default.map(files, (f) => {
|
|
46
|
+
const parts = lodash_1.default.split(f, separator);
|
|
44
47
|
const name = parts.pop() || '';
|
|
45
|
-
const path =
|
|
48
|
+
const path = lodash_1.default.join(parts, separator);
|
|
46
49
|
const full = path + separator + name;
|
|
47
50
|
return { name, path, full };
|
|
48
51
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.files.to.objects.js","sourceRoot":"","sources":["../../src/functions/convert.files.to.objects.ts"],"names":[],"mappings":";AACA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"convert.files.to.objects.js","sourceRoot":"","sources":["../../src/functions/convert.files.to.objects.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,4CAA8B;AAE9B,oDAAuB;AAIvB,MAAM,qBAAqB,GAAa,CAAC,KAAe,EAAgB,EAAE;IACzE,MAAM,QAAQ,GAAW,EAAE,CAAC,QAAQ,EAAE,CAAC;IACvC,MAAM,SAAS,GAAW,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IAE5D,OAAO,gBAAC,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAS,EAAc,EAAE;QAC7C,MAAM,KAAK,GAAa,gBAAC,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAW,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;QACvC,MAAM,IAAI,GAAW,gBAAC,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAW,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;QAC7C,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,qBAAqB,CAAC"}
|
|
@@ -39,44 +39,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
41
|
const path_1 = __importDefault(require("path"));
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const files = fs.readdirSync(srcFolder);
|
|
46
|
-
const foundJS = (0, lodash_1.find)(files, (file) => {
|
|
47
|
-
const ext = path_1.default.extname(file);
|
|
48
|
-
return ext === '.js';
|
|
49
|
-
});
|
|
50
|
-
return !!foundJS;
|
|
51
|
-
};
|
|
52
|
-
const getDefaultConfig = (root) => {
|
|
53
|
-
const defaultConfig = {
|
|
54
|
-
srcFolderName: 'src',
|
|
55
|
-
testFolderName: 'test',
|
|
56
|
-
filesExtension: '.ts'
|
|
42
|
+
const getDefaultConfig = () => {
|
|
43
|
+
return {
|
|
44
|
+
directories: ['src', 'test']
|
|
57
45
|
};
|
|
58
|
-
try {
|
|
59
|
-
const config = (0, lodash_1.cloneDeep)(defaultConfig);
|
|
60
|
-
const srcFolder = path_1.default.join(root, 'src');
|
|
61
|
-
if (fs.lstatSync(srcFolder).isDirectory()) {
|
|
62
|
-
if (hasJS(srcFolder)) {
|
|
63
|
-
(0, lodash_1.set)(config, 'filesExtension', '.js');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return config;
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
console.error(error);
|
|
70
|
-
return defaultConfig;
|
|
71
|
-
}
|
|
72
46
|
};
|
|
73
47
|
const getConfig = (root, configFile) => {
|
|
74
|
-
const defaultConfig = getDefaultConfig(
|
|
48
|
+
const defaultConfig = getDefaultConfig();
|
|
49
|
+
const configPath = path_1.default.join(root, configFile);
|
|
50
|
+
if (!fs.existsSync(configPath)) {
|
|
51
|
+
return defaultConfig;
|
|
52
|
+
}
|
|
75
53
|
try {
|
|
76
|
-
const userConfig = require(
|
|
77
|
-
|
|
78
|
-
(0, lodash_1.set)(config, 'filesExtension', (0, fix_extension_1.default)(config.filesExtension));
|
|
79
|
-
return config;
|
|
54
|
+
const userConfig = require(configPath);
|
|
55
|
+
return Object.assign(Object.assign({}, defaultConfig), userConfig);
|
|
80
56
|
}
|
|
81
57
|
catch (error) {
|
|
82
58
|
console.error(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.config.js","sourceRoot":"","sources":["../../src/functions/get.config.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,uCAAyB;AACzB,gDAAwB;
|
|
1
|
+
{"version":3,"file":"get.config.js","sourceRoot":"","sources":["../../src/functions/get.config.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,uCAAyB;AACzB,gDAAwB;AAKxB,MAAM,gBAAgB,GAAa,GAAW,EAAE;IAC/C,OAAO;QACN,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;KAC5B,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,SAAS,GAAa,CAAC,IAAY,EAAE,UAAkB,EAAU,EAAE;IACxE,MAAM,aAAa,GAAW,gBAAgB,EAAE,CAAC;IACjD,MAAM,UAAU,GAAW,cAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAGvD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAEhC,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,IAAI,CAAC;QACJ,MAAM,UAAU,GAAoB,OAAO,CAAC,UAAU,CAAC,CAAC;QAExD,uCAAW,aAAa,GAAK,UAAU,EAAE;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAEhB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,aAAa,CAAC;IACtB,CAAC;AACF,CAAC,CAAC;AACF,kBAAe,SAAS,CAAC"}
|
|
@@ -39,24 +39,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
const fs = __importStar(require("fs"));
|
|
41
41
|
const path = __importStar(require("path"));
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
ext = (0, fix_extension_1.default)(ext);
|
|
42
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
43
|
+
const getFilesListing = (root) => {
|
|
44
|
+
const supportedExtensions = ['.js', '.ts'];
|
|
46
45
|
let files = [];
|
|
47
46
|
const children = fs.readdirSync(root);
|
|
48
|
-
const subfiles =
|
|
49
|
-
|
|
47
|
+
const subfiles = lodash_1.default.filter(children, (child) => !fs.lstatSync(path.join(root, child)).isDirectory());
|
|
48
|
+
lodash_1.default.each(subfiles, (file) => {
|
|
50
49
|
const fileExt = path.extname(file);
|
|
51
|
-
if (
|
|
50
|
+
if (supportedExtensions.includes(lodash_1.default.toLower(fileExt))) {
|
|
52
51
|
files.push(path.join(root, file));
|
|
52
|
+
}
|
|
53
53
|
});
|
|
54
|
-
const subfolders =
|
|
55
|
-
|
|
54
|
+
const subfolders = lodash_1.default.filter(children, (child) => fs.lstatSync(path.join(root, child)).isDirectory());
|
|
55
|
+
lodash_1.default.each(subfolders, (folder) => {
|
|
56
56
|
const folderFullPath = path.join(root, folder);
|
|
57
|
-
files =
|
|
57
|
+
files = lodash_1.default.concat(files, getFilesListing(folderFullPath));
|
|
58
58
|
});
|
|
59
|
-
return
|
|
59
|
+
return lodash_1.default.sortBy(files);
|
|
60
60
|
};
|
|
61
61
|
exports.default = getFilesListing;
|
|
62
62
|
//# sourceMappingURL=get.files.listing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.files.listing.js","sourceRoot":"","sources":["../../src/functions/get.files.listing.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,uCAAyB;AACzB,2CAA6B;
|
|
1
|
+
{"version":3,"file":"get.files.listing.js","sourceRoot":"","sources":["../../src/functions/get.files.listing.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAuB;AAEvB,MAAM,eAAe,GAAa,CAAC,IAAY,EAAY,EAAE;IAC5D,MAAM,mBAAmB,GAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAErD,IAAI,KAAK,GAAa,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAa,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEhD,MAAM,QAAQ,GAAa,gBAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACtH,gBAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE;QACjC,MAAM,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,mBAAmB,CAAC,QAAQ,CAAC,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YACtD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACnC,CAAC;IACF,CAAC,CAAC,CAAC;IAEH,MAAM,UAAU,GAAa,gBAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACvH,gBAAC,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,MAAc,EAAE,EAAE;QACrC,MAAM,cAAc,GAAW,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvD,KAAK,GAAG,gBAAC,CAAC,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEH,OAAO,gBAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,kBAAe,eAAe,CAAC"}
|
|
@@ -1,43 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
'use strict';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
3
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
5
|
};
|
|
39
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
const
|
|
7
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
41
8
|
const cli_table_1 = __importDefault(require("cli-table"));
|
|
42
9
|
const getTableFromFileObjects = (objects, includeNewPath) => {
|
|
43
10
|
const columns = ['#', 'File', 'Path'];
|
|
@@ -45,7 +12,7 @@ const getTableFromFileObjects = (objects, includeNewPath) => {
|
|
|
45
12
|
columns.push('New Path');
|
|
46
13
|
const table = new cli_table_1.default({ style: { head: ['black'], compact: true }, head: columns });
|
|
47
14
|
let id = 0;
|
|
48
|
-
|
|
15
|
+
lodash_1.default.each(objects, (o) => table.push([String(++id), ...lodash_1.default.values(lodash_1.default.omit(o, ['full']))]));
|
|
49
16
|
return table;
|
|
50
17
|
};
|
|
51
18
|
exports.default = getTableFromFileObjects;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.table.from.file.objects.js","sourceRoot":"","sources":["../../src/functions/get.table.from.file.objects.ts"],"names":[],"mappings":";AACA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"get.table.from.file.objects.js","sourceRoot":"","sources":["../../src/functions/get.table.from.file.objects.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;;;;AAEb,oDAAuB;AACvB,0DAA8B;AAI9B,MAAM,uBAAuB,GAAa,CAAC,OAAqB,EAAE,cAAwB,EAAS,EAAE;IACpG,MAAM,OAAO,GAAa,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,IAAI,cAAc;QAAE,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE7C,MAAM,KAAK,GAAU,IAAI,mBAAK,CAAC,EAAC,KAAK,EAAE,EAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAC,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC,CAAC;IACzF,IAAI,EAAE,GAAW,CAAC,CAAC;IACnB,gBAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAa,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,gBAAC,CAAC,MAAM,CAAC,gBAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,OAAO,KAAK,CAAC;AACd,CAAC,CAAC;AAEF,kBAAe,uBAAuB,CAAC"}
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "strictr",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "strict statement checker",
|
|
5
|
-
"engines": {
|
|
6
|
-
"node": ">=20.12.1"
|
|
7
|
-
},
|
|
8
|
-
"repository": "https://github.com/cope/strictr.git",
|
|
9
|
-
"author": "Predrag Stojadinovic <Predrag@Stojadinovic.net>",
|
|
10
|
-
"license": "MIT",
|
|
11
|
-
"preferGlobal": true,
|
|
12
|
-
"main": "./lib/strictr.js",
|
|
13
|
-
"types": "./lib/strictr.d.ts",
|
|
14
|
-
"bin": {
|
|
15
|
-
"strictr": "./lib/strictr.js"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"lib/**/*"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"go": "ts-node ./src/strictr.ts",
|
|
22
|
-
"all": "pnpm i & pnpm dedupe & pnpm audit --fix & tsc & pnpm clean & pnpm format & pnpm build & pnpm test & pnpm docs",
|
|
23
|
-
"build": "del /S /Q lib\\* && tsc",
|
|
24
|
-
"build:watch": "tsc --watch",
|
|
25
|
-
"lint": "eslint src/**/*.ts test/**/*.ts",
|
|
26
|
-
"lint:fix": "eslint src/**/*.ts test/**/*.ts --fix",
|
|
27
|
-
"docs": "typedoc --readme none --out docs src",
|
|
28
|
-
"test": "jest --coverage --config jest.config.js",
|
|
29
|
-
"test:watch": "jest --watch",
|
|
30
|
-
"test:coverage": "jest --coverage",
|
|
31
|
-
"clean": "eslint src/**/*.ts test/**/*.ts --fix",
|
|
32
|
-
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
33
|
-
"up": "pnpm up -i",
|
|
34
|
-
"upgrade": "pnpm up",
|
|
35
|
-
"latest": "pnpm up -i -L",
|
|
36
|
-
"l": "pnpm i & pnpm latest"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"@types/cli-color": "^2.0.6",
|
|
40
|
-
"@types/cli-table": "^0.3.4",
|
|
41
|
-
"cli-color": "^2.0.
|
|
42
|
-
"cli-table": "^0.3.11",
|
|
43
|
-
"commander": "^14.0.0",
|
|
44
|
-
"lodash": "^4.17.21"
|
|
45
|
-
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@types/jest": "^30.0.0",
|
|
48
|
-
"@types/lodash": "^4.17.20",
|
|
49
|
-
"@types/node": "^24.0.
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
51
|
-
"@typescript-eslint/parser": "^8.
|
|
52
|
-
"eslint": "^9.
|
|
53
|
-
"eslint-config-prettier": "^10.1.5",
|
|
54
|
-
"eslint-plugin-jest": "^29.0.1",
|
|
55
|
-
"eslint-plugin-prettier": "^5.1
|
|
56
|
-
"jest": "^30.0.4",
|
|
57
|
-
"prettier": "^3.6.2",
|
|
58
|
-
"source-map-support": "^0.5.21",
|
|
59
|
-
"ts-jest": "^29.
|
|
60
|
-
"ts-node": "^10.9.2",
|
|
61
|
-
"typedoc": "^0.28.7",
|
|
62
|
-
"typescript": "^5.8.3"
|
|
63
|
-
},
|
|
64
|
-
"pnpm": {
|
|
65
|
-
"updateConfig": {
|
|
66
|
-
"ignoreDependencies": []
|
|
67
|
-
},
|
|
68
|
-
"onlyBuiltDependencies": [
|
|
69
|
-
"es5-ext"
|
|
70
|
-
],
|
|
71
|
-
"overrides": {
|
|
72
|
-
"@babel/helpers@<7.26.10": ">=7.26.10",
|
|
73
|
-
"brace-expansion@>=1.0.0 <=1.1.11": ">=1.1.12"
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
"packageManager": "pnpm@10.13.1"
|
|
77
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "strictr",
|
|
3
|
+
"version": "0.5.1",
|
|
4
|
+
"description": "strict statement checker",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=20.12.1"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://github.com/cope/strictr.git",
|
|
9
|
+
"author": "Predrag Stojadinovic <Predrag@Stojadinovic.net>",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"preferGlobal": true,
|
|
12
|
+
"main": "./lib/strictr.js",
|
|
13
|
+
"types": "./lib/strictr.d.ts",
|
|
14
|
+
"bin": {
|
|
15
|
+
"strictr": "./lib/strictr.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"lib/**/*"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"go": "ts-node ./src/strictr.ts",
|
|
22
|
+
"all": "pnpm i & pnpm dedupe & pnpm audit --fix & tsc & pnpm clean & pnpm format & pnpm build & pnpm test & pnpm docs",
|
|
23
|
+
"build": "del /S /Q lib\\* && tsc",
|
|
24
|
+
"build:watch": "tsc --watch",
|
|
25
|
+
"lint": "eslint src/**/*.ts test/**/*.ts",
|
|
26
|
+
"lint:fix": "eslint src/**/*.ts test/**/*.ts --fix",
|
|
27
|
+
"docs": "typedoc --readme none --out docs src",
|
|
28
|
+
"test": "jest --coverage --config jest.config.js",
|
|
29
|
+
"test:watch": "jest --watch",
|
|
30
|
+
"test:coverage": "jest --coverage",
|
|
31
|
+
"clean": "eslint src/**/*.ts test/**/*.ts --fix",
|
|
32
|
+
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
33
|
+
"up": "pnpm up -i",
|
|
34
|
+
"upgrade": "pnpm up",
|
|
35
|
+
"latest": "pnpm up -i -L",
|
|
36
|
+
"l": "pnpm i & pnpm latest"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@types/cli-color": "^2.0.6",
|
|
40
|
+
"@types/cli-table": "^0.3.4",
|
|
41
|
+
"cli-color": "^2.0.4",
|
|
42
|
+
"cli-table": "^0.3.11",
|
|
43
|
+
"commander": "^14.0.0",
|
|
44
|
+
"lodash": "^4.17.21"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/jest": "^30.0.0",
|
|
48
|
+
"@types/lodash": "^4.17.20",
|
|
49
|
+
"@types/node": "^24.0.14",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^8.37.0",
|
|
51
|
+
"@typescript-eslint/parser": "^8.37.0",
|
|
52
|
+
"eslint": "^9.31.0",
|
|
53
|
+
"eslint-config-prettier": "^10.1.5",
|
|
54
|
+
"eslint-plugin-jest": "^29.0.1",
|
|
55
|
+
"eslint-plugin-prettier": "^5.5.1",
|
|
56
|
+
"jest": "^30.0.4",
|
|
57
|
+
"prettier": "^3.6.2",
|
|
58
|
+
"source-map-support": "^0.5.21",
|
|
59
|
+
"ts-jest": "^29.4.0",
|
|
60
|
+
"ts-node": "^10.9.2",
|
|
61
|
+
"typedoc": "^0.28.7",
|
|
62
|
+
"typescript": "^5.8.3"
|
|
63
|
+
},
|
|
64
|
+
"pnpm": {
|
|
65
|
+
"updateConfig": {
|
|
66
|
+
"ignoreDependencies": []
|
|
67
|
+
},
|
|
68
|
+
"onlyBuiltDependencies": [
|
|
69
|
+
"es5-ext"
|
|
70
|
+
],
|
|
71
|
+
"overrides": {
|
|
72
|
+
"@babel/helpers@<7.26.10": ">=7.26.10",
|
|
73
|
+
"brace-expansion@>=1.0.0 <=1.1.11": ">=1.1.12"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"packageManager": "pnpm@10.13.1"
|
|
77
|
+
}
|