strictr 0.4.1 → 0.5.2
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 +1 -2
- package/lib/check.js +23 -33
- package/lib/check.js.map +1 -1
- package/lib/functions/convert.files.to.objects.js +9 -5
- package/lib/functions/convert.files.to.objects.js.map +1 -1
- package/lib/functions/get.config.js +3 -14
- package/lib/functions/get.config.js.map +1 -1
- package/lib/functions/get.files.listing.js +11 -8
- 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 -2
- package/package.json +77 -77
- package/lib/functions/fix.extension.d.ts +0 -3
- package/lib/functions/fix.extension.js +0 -11
- package/lib/functions/fix.extension.js.map +0 -1
package/README.md
CHANGED
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,54 +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 =
|
|
54
|
+
const options = lodash_1.default.pick(commander, ['config', 'fix']);
|
|
55
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
|
-
let
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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()));
|
|
69
73
|
}
|
|
70
|
-
else
|
|
71
|
-
console.log(clc.green('\n✅ Strictr: No
|
|
72
|
-
testFiles = testFiles.filter(missing_strict_statement_1.default);
|
|
73
|
-
if (!_.isEmpty(testFiles)) {
|
|
74
|
-
console.log(clc.red('\nStrictr: Test files missing the ' + clc.italic("'use strict';") + ' statement:'));
|
|
75
|
-
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.'));
|
|
76
76
|
}
|
|
77
|
-
else
|
|
78
|
-
console.log(clc.green('\n✅ Strictr: No test files are missing the ' + clc.italic("'use strict';") + ' statement.'));
|
|
79
77
|
if (fix) {
|
|
80
|
-
if (
|
|
78
|
+
if (lodash_1.default.isEmpty(filesWithoutStrict)) {
|
|
81
79
|
return console.log(clc.green('\n✅ ' + clc.bold('Strictr') + ': Everything is awesome!\n'));
|
|
82
80
|
}
|
|
83
81
|
console.log(clc.blue('\n🔍 Strictr: Fix is set to true. Adding ' + clc.italic("'use strict';") + ' where I can...\n'));
|
|
84
|
-
|
|
85
|
-
(0, add_use_strict_1.default)(file);
|
|
86
|
-
});
|
|
87
|
-
console.log('');
|
|
88
|
-
_.each(testFiles, (file) => {
|
|
82
|
+
lodash_1.default.each(filesWithoutStrict, (file) => {
|
|
89
83
|
(0, add_use_strict_1.default)(file);
|
|
90
84
|
});
|
|
91
85
|
console.log('\n');
|
|
92
86
|
}
|
|
93
87
|
else {
|
|
94
|
-
if (
|
|
88
|
+
if (lodash_1.default.isEmpty(filesWithoutStrict)) {
|
|
95
89
|
return console.log(clc.green('\n✅ ' + clc.bold('Strictr') + ': Everything is awesome!\n'));
|
|
96
90
|
}
|
|
97
|
-
|
|
98
|
-
if (!_.isEmpty(srcFiles))
|
|
99
|
-
message += clc.bold('Strictr ERROR:') + ' There are source files missing the ' + clc.italic("'use strict';") + ' statement!\n';
|
|
100
|
-
if (!_.isEmpty(testFiles))
|
|
101
|
-
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';
|
|
102
92
|
(0, bail_1.default)(clc.red(message));
|
|
103
93
|
}
|
|
104
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;;;;;;;;;;;;;;;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,CAAC,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;aAAM,CAAC;YACP,IAAI,gBAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBACnC,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,4BAA4B,CAAC,CAAC,CAAC;YAC7F,CAAC;YAED,MAAM,OAAO,GAAW,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,+BAA+B,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC;YAE5I,IAAA,cAAI,EAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QACxB,CAAC;IACF,CAAC;CACD,CAAC"}
|
|
@@ -33,16 +33,20 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
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
|
-
|
|
44
|
-
const
|
|
45
|
-
const
|
|
45
|
+
return lodash_1.default.map(files, (f) => {
|
|
46
|
+
var _a;
|
|
47
|
+
const parts = lodash_1.default.split(f, separator);
|
|
48
|
+
const name = (_a = parts.pop()) !== null && _a !== void 0 ? _a : '';
|
|
49
|
+
const path = lodash_1.default.join(parts, separator);
|
|
46
50
|
const full = path + separator + name;
|
|
47
51
|
return { name, path, full };
|
|
48
52
|
});
|
|
@@ -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,MAAA,KAAK,CAAC,GAAG,EAAE,mCAAI,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,20 +39,10 @@ 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 lodash_1 = require("lodash");
|
|
43
42
|
const getDefaultConfig = () => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
testFolderName: 'test'
|
|
43
|
+
return {
|
|
44
|
+
directories: ['src', 'test']
|
|
47
45
|
};
|
|
48
|
-
try {
|
|
49
|
-
const config = (0, lodash_1.cloneDeep)(defaultConfig);
|
|
50
|
-
return config;
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
console.error(error);
|
|
54
|
-
return defaultConfig;
|
|
55
|
-
}
|
|
56
46
|
};
|
|
57
47
|
const getConfig = (root, configFile) => {
|
|
58
48
|
const defaultConfig = getDefaultConfig();
|
|
@@ -62,8 +52,7 @@ const getConfig = (root, configFile) => {
|
|
|
62
52
|
}
|
|
63
53
|
try {
|
|
64
54
|
const userConfig = require(configPath);
|
|
65
|
-
|
|
66
|
-
return config;
|
|
55
|
+
return Object.assign(Object.assign({}, defaultConfig), userConfig);
|
|
67
56
|
}
|
|
68
57
|
catch (error) {
|
|
69
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"}
|
|
@@ -33,27 +33,30 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
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 fs = __importStar(require("fs"));
|
|
38
41
|
const path = __importStar(require("path"));
|
|
39
|
-
const
|
|
42
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
40
43
|
const getFilesListing = (root) => {
|
|
41
44
|
const supportedExtensions = ['.js', '.ts'];
|
|
42
45
|
let files = [];
|
|
43
46
|
const children = fs.readdirSync(root);
|
|
44
|
-
const subfiles =
|
|
45
|
-
|
|
47
|
+
const subfiles = lodash_1.default.filter(children, (child) => !fs.lstatSync(path.join(root, child)).isDirectory());
|
|
48
|
+
lodash_1.default.each(subfiles, (file) => {
|
|
46
49
|
const fileExt = path.extname(file);
|
|
47
|
-
if (supportedExtensions.includes(
|
|
50
|
+
if (supportedExtensions.includes(fileExt.toLowerCase())) {
|
|
48
51
|
files.push(path.join(root, file));
|
|
49
52
|
}
|
|
50
53
|
});
|
|
51
|
-
const subfolders =
|
|
52
|
-
|
|
54
|
+
const subfolders = lodash_1.default.filter(children, (child) => fs.lstatSync(path.join(root, child)).isDirectory());
|
|
55
|
+
lodash_1.default.each(subfolders, (folder) => {
|
|
53
56
|
const folderFullPath = path.join(root, folder);
|
|
54
|
-
files =
|
|
57
|
+
files = lodash_1.default.concat(files, getFilesListing(folderFullPath));
|
|
55
58
|
});
|
|
56
|
-
return
|
|
59
|
+
return lodash_1.default.sortBy(files);
|
|
57
60
|
};
|
|
58
61
|
exports.default = getFilesListing;
|
|
59
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
|
|
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,OAAO,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;YACzD,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.31.0",
|
|
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.2",
|
|
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
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const fixExtension = (ext) => {
|
|
6
|
-
if (!(0, lodash_1.startsWith)(ext, '.'))
|
|
7
|
-
ext = '.' + ext;
|
|
8
|
-
return (0, lodash_1.toLower)(ext);
|
|
9
|
-
};
|
|
10
|
-
exports.default = fixExtension;
|
|
11
|
-
//# sourceMappingURL=fix.extension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix.extension.js","sourceRoot":"","sources":["../../src/functions/fix.extension.ts"],"names":[],"mappings":";AACA,YAAY,CAAC;;AAEb,mCAA2C;AAE3C,MAAM,YAAY,GAAa,CAAC,GAAW,EAAU,EAAE;IACtD,IAAI,CAAC,IAAA,mBAAU,EAAC,GAAG,EAAE,GAAG,CAAC;QAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC3C,OAAO,IAAA,gBAAO,EAAC,GAAG,CAAC,CAAC;AACrB,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
|