## 1.3.12, 1.3.13, 1.3.14

This commit is contained in:
Mike Phares 2022-03-23 20:39:11 -07:00
parent eacebd708f
commit 85fa349968
23 changed files with 26 additions and 26 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -105,7 +105,7 @@ Learned npm run compile will do similar to build
Quick Fix - Instance Field to Calisthenics
## 1.3.12
## 1.3.12, 1.3.13, 1.3.14
-----------------------------------------------------------------------------------------------------------
Split by Space Reverse Join Sort lines (ascending, case sensitive)

View File

@ -1,12 +1,12 @@
{
"name": "type-script-helper",
"version": "1.3.12",
"version": "1.3.13",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "type-script-helper",
"version": "1.3.12",
"version": "1.3.13",
"devDependencies": {
"@types/glob": "^7.1.1",
"@types/mocha": "^5.2.7",
@ -793,9 +793,9 @@
}
},
"node_modules/minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
"dev": true
},
"node_modules/mkdirp": {
@ -2008,9 +2008,9 @@
}
},
"minimist": {
"version": "1.2.5",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
"integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
"version": "1.2.6",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
"integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
"dev": true
},
"mkdirp": {

View File

@ -4,7 +4,7 @@
"description": "Helper for VS Code in TypeScript",
"publisher": "IFX",
"repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
"version": "1.3.12",
"version": "1.3.14",
"engines": {
"vscode": "^1.40.0"
},

View File

@ -151,7 +151,7 @@ function prettySqlLogic(lines: string[]): void {
}
function camelCase(str: string) {
return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function(match, index) {
return str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match, index) {
if (+match === 0) return "";
return index === 0 ? match.toLowerCase() : match.toUpperCase();
});
@ -169,7 +169,7 @@ function capitalize(word: string) {
function quickFixCamelCasePropertiesLogic(lines: string[]): void {
for (let i = 0; i < lines.length; ++i) {
let segments = lines[i].trim().split(' ');
if(segments.length < 2 || segments.length > 3)
if (segments.length < 2 || segments.length > 3)
continue;
let leftPadding = lines[i].substring(0, lines[i].indexOf(segments[0]));
if (segments.length === 2) segments = ('protected ' + lines[i].trim()).split(' ');
@ -182,7 +182,7 @@ function quickFixCamelCasePropertiesLogic(lines: string[]): void {
function quickFixCS0108Logic(lines: string[]): void {
for (let i = 0; i < lines.length; ++i) {
let segments = lines[i].trim().split(' ');
if(segments.length < 2 || segments.length > 3)
if (segments.length < 2 || segments.length > 3)
continue;
let leftPadding = lines[i].substring(0, lines[i].indexOf(segments[0]));
if (segments.length === 2) segments = ('protected ' + lines[i].trim()).split(' ');
@ -197,15 +197,15 @@ function quickFixCS0108Logic(lines: string[]): void {
function quickFixInstanceFieldToCalisthenicsLogic(lines: string[]): void {
for (let i = 0; i < lines.length; ++i) {
let segments = lines[i].trim().split(' ');
if(segments.length !== 2)
if (segments.length !== 2)
continue;
let leftPadding = lines[i].substring(0, lines[i].indexOf(segments[0]));
let type = segments[0];
let name = segments[1].split(';')[0];
let singularName = name;
if(name[name.length - 1] === 's') {
if(name[name.length - 2] === 'e') {
if(name[name.length - 3] === 'i') {
let singularName = name;
if (name[name.length - 1] === 's') {
if (name[name.length - 2] === 'e') {
if (name[name.length - 3] === 'i') {
singularName = name.substring(0, singularName.length - 3) + 'y';
}
else
@ -215,11 +215,11 @@ function quickFixInstanceFieldToCalisthenicsLogic(lines: string[]): void {
singularName = name.substring(0, singularName.length - 1);
}
segments = type.split('<');
if(segments.length === 2)
if (segments.length === 2)
lines[i] = leftPadding + 'public ' + segments[0] + '<' + singularName + '> ' + name + ' { get; } //' + segments[1].split('>')[0];
else {
segments = type.split('[');
if(segments.length === 2)
if (segments.length === 2)
lines[i] = leftPadding + 'public ' + singularName + '[] ' + name + ' { get; } //' + segments[0];
else
lines[i] = leftPadding + 'public ' + singularName + ' ' + name + ' { get; } //' + type;
@ -231,7 +231,7 @@ function quickFixInstanceFieldToCalisthenicsLogic(lines: string[]): void {
function quickFixProperCasePropertiesLogic(lines: string[]): void {
for (let i = 0; i < lines.length; ++i) {
let segments = lines[i].trim().split(' ');
if(segments.length < 2 || segments.length > 3)
if (segments.length < 2 || segments.length > 3)
continue;
let leftPadding = lines[i].substring(0, lines[i].indexOf(segments[0]));
if (segments.length === 2) segments = ('protected ' + lines[i].trim()).split(' ');
@ -245,7 +245,7 @@ function quickFixProperCasePropertiesLogic(lines: string[]): void {
function quickFixPublicLogic(lines: string[]): void {
for (let i = 0; i < lines.length; ++i) {
let segments = lines[i].trim().split(' ');
if(segments.length < 2 || segments.length > 3)
if (segments.length < 2 || segments.length > 3)
continue;
let leftPadding = lines[i].substring(0, lines[i].indexOf(segments[0]));
if (segments.length === 2) segments = ('protected ' + lines[i].trim()).split(' ');
@ -286,18 +286,18 @@ function sortNormalLogic(lines: string[]): void {
function splitBySpaceReverseJoinSortLogic(lines: string[]): void {
var transformers: ArrayTransformer[] = [];
transformers.push(makeSorter());
for (let i = 0; i < lines.length; ++i) {
lines[i] = lines[i].split(' ').reverse().join(' ');
}
removeBlanks(lines);
lines = transformers.reduce((currentLines, transform) => transform(currentLines), lines);
for (let i = 0; i < lines.length; ++i) {
lines[i] = lines[i].split(' ').reverse().join(' ');
}
lines = transformers.reduce((currentLines, transform) => transform(currentLines), lines);
}
function unwrapSqlLogic(lines: string[]): void {