magic-renamer 21.0.18 → 21.0.20
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/browser/package.json +1 -1
- package/browser-prod/fesm2022/magic-renamer-browser.mjs +13 -13
- package/browser-prod/fesm2022/magic-renamer-browser.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/magic-renamer.js +8 -8
- package/lib-prod/magic-renamer.js.map +1 -1
- package/lib-prod/package.json +1 -1
- package/lib-prod/rename-rule.js +12 -12
- package/lib-prod/rename-rule.js.map +1 -1
- package/package.json +2 -1
- package/websql/package.json +1 -1
- package/websql-prod/fesm2022/magic-renamer-websql.mjs +13 -13
- package/websql-prod/fesm2022/magic-renamer-websql.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
package/browser/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Helpers__NS__error, ___NS__isUndefined, UtilsString__NS__kebabCaseNoSplitNumbers, ___NS__kebabCase, ___NS__camelCase, ___NS__upperFirst, ___NS__snakeCase, ___NS__startCase, ___NS__upperCase, ___NS__lowerCase, Utils__NS__escapeStringForRegEx } from 'tnp-core/browser-prod';
|
|
2
2
|
import { Log, Level } from 'ng2-logger/browser-prod';
|
|
3
3
|
|
|
4
4
|
const log$1 = Log.create('magic-renemer', Level.__NOTHING);
|
|
@@ -16,7 +16,7 @@ class RenameRule {
|
|
|
16
16
|
.map(a => {
|
|
17
17
|
const [from, to] = a.split('->');
|
|
18
18
|
if (!from || !to) {
|
|
19
|
-
|
|
19
|
+
Helpers__NS__error(`Incorrect rule
|
|
20
20
|
"${from}" -> "${to}"
|
|
21
21
|
please follow pattern: 'test name -> my new name '`, false, true);
|
|
22
22
|
}
|
|
@@ -38,7 +38,7 @@ class RenameRule {
|
|
|
38
38
|
return res;
|
|
39
39
|
}
|
|
40
40
|
includes(orgString) {
|
|
41
|
-
return !
|
|
41
|
+
return !___NS__isUndefined(this.combinations.find(v => {
|
|
42
42
|
const [from, to] = v;
|
|
43
43
|
return orgString === to;
|
|
44
44
|
}));
|
|
@@ -52,17 +52,17 @@ class RenameRule {
|
|
|
52
52
|
UtilsString__NS__kebabCaseNoSplitNumbers(thisFrom),
|
|
53
53
|
UtilsString__NS__kebabCaseNoSplitNumbers(thisTo),
|
|
54
54
|
], // my-entity => hello1-kitty
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
55
|
+
[___NS__kebabCase(thisFrom), ___NS__kebabCase(thisTo)], // my-entity => hello-kitty
|
|
56
|
+
[___NS__camelCase(thisFrom), ___NS__camelCase(thisTo)], // myEntity => helloKitty
|
|
57
|
+
[___NS__upperFirst(___NS__camelCase(thisFrom)), ___NS__upperFirst(___NS__camelCase(thisTo))], // MyEntity => HelloKitty
|
|
58
|
+
[___NS__snakeCase(thisFrom), ___NS__snakeCase(thisTo)], // my_entity => hello_kitty
|
|
59
|
+
[___NS__snakeCase(thisFrom).toUpperCase(), ___NS__snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY
|
|
60
|
+
[___NS__startCase(thisFrom), ___NS__startCase(thisTo)], // My Entity => Hello Kitty
|
|
61
|
+
[___NS__upperCase(thisFrom), ___NS__upperCase(thisTo)], // MY ENTITY => HELLO KITTY
|
|
62
|
+
[___NS__lowerCase(thisFrom), ___NS__lowerCase(thisTo)], // my entity => hello kitty
|
|
63
63
|
[
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
___NS__camelCase(thisFrom).toLocaleLowerCase(),
|
|
65
|
+
___NS__camelCase(thisTo).toLocaleLowerCase(),
|
|
66
66
|
], // myentity => hellokitty
|
|
67
67
|
];
|
|
68
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-renamer-browser.mjs","sources":["../../../tmp-libs-for-dist-prod/magic-renamer/projects/magic-renamer/src/lib/rename-rule.ts","../../../tmp-libs-for-dist-prod/magic-renamer/projects/magic-renamer/src/lib/magic-renamer.ts","../../../tmp-libs-for-dist-prod/magic-renamer/projects/magic-renamer/src/magic-renamer-browser.ts"],"sourcesContent":["import { Helpers, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds } from 'tnp-core/browser-prod';\nimport { _, UtilsString__NS__kebabCaseNoSplitNumbers } from 'tnp-core/browser-prod';\nimport { Log, Level } from 'ng2-logger/browser-prod';\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class RenameRule {\n static from(pArgs: string): RenameRule[] {\n pArgs = pArgs.replace(/\\=\\>/g, '->');\n let args = pArgs.split(/(\\'|\\\")(\\ )+(\\'|\\\")/).filter(f => !!f) as string[];\n log.d('---- Rules ----');\n args.forEach(a => {\n log.d(a);\n });\n log.d('---------------');\n return args\n .filter(a => a.search('->') !== -1)\n .map(a => {\n const [from, to] = a.split('->');\n if (!from || !to) {\n Helpers.error(\n `Incorrect rule\n \"${from}\" -> \"${to}\"\n please follow pattern: 'test name -> my new name '`,\n false,\n true,\n );\n }\n return new RenameRule(from.trim(), to.trim());\n });\n }\n\n public readonly fromWhiteSpaceReplaced: string;\n public readonly toWhiteSpaceReplaced: string;\n constructor(\n public readonly from: string,\n public readonly to: string,\n ) {\n this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\\W/g, ' ');\n this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\\W/g, ' ');\n }\n\n applyTo(s: string): boolean {\n s = s.trim().toLowerCase().replace(/\\W/g, '');\n const res = s.search(this.from.replace(/\\W/g, '')) !== -1;\n return res;\n }\n\n toString = () => {\n return `${this.from} => ${this.to}`;\n };\n\n includes(orgString) {\n return !_.isUndefined(\n this.combinations.find(v => {\n const [from, to] = v;\n return orgString === to;\n }),\n );\n }\n\n get combinations() {\n const thisTo = this.toWhiteSpaceReplaced;\n const thisFrom = this.fromWhiteSpaceReplaced;\n return [\n // TODO 'rs.asdasd-asd-A.'\n [\n UtilsString__NS__kebabCaseNoSplitNumbers(thisFrom),\n UtilsString__NS__kebabCaseNoSplitNumbers(thisTo),\n ], // my-entity => hello1-kitty\n [_.kebabCase(thisFrom), _.kebabCase(thisTo)], // my-entity => hello-kitty\n [_.camelCase(thisFrom), _.camelCase(thisTo)], // myEntity => helloKitty\n [_.upperFirst(_.camelCase(thisFrom)), _.upperFirst(_.camelCase(thisTo))], // MyEntity => HelloKitty\n [_.snakeCase(thisFrom), _.snakeCase(thisTo)], // my_entity => hello_kitty\n [_.snakeCase(thisFrom).toUpperCase(), _.snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY\n [_.startCase(thisFrom), _.startCase(thisTo)], // My Entity => Hello Kitty\n [_.upperCase(thisFrom), _.upperCase(thisTo)], // MY ENTITY => HELLO KITTY\n [_.lowerCase(thisFrom), _.lowerCase(thisTo)], // my entity => hello kitty\n [\n _.camelCase(thisFrom).toLocaleLowerCase(),\n _.camelCase(thisTo).toLocaleLowerCase(),\n ], // myentity => hellokitty\n ];\n }\n\n /**\n * @param orgString input string\n * @returns string with all possible combinations replaced\n */\n replaceInString(orgString: string): string {\n return this.replace({\n orgString,\n replaceallPossibliliteis: true,\n });\n }\n\n /**\n *\n * @param orgString (file name OR file content)\n * @param replaceallPossibliliteis when changin file notent (not name only)\n * @returns\n */\n replace(options: {\n /**\n * file name for debugging\n */\n fileName?: string;\n orgString: string;\n replaceallPossibliliteis?: boolean;\n }) {\n let { fileName, orgString, replaceallPossibliliteis } = options;\n replaceallPossibliliteis = !!replaceallPossibliliteis;\n const combinations = this.combinations;\n for (let index = 0; index < combinations.length; index++) {\n const v = combinations[index];\n let [from, to] = v;\n if (orgString.search(from) !== -1) {\n const regex = new RegExp(Utils__NS__escapeStringForRegEx(from));\n log.i(`apply! \"${regex.source}\" to file ${fileName} => \"${to}\"`);\n orgString = orgString.replace(\n new RegExp(Utils__NS__escapeStringForRegEx(from), 'g'),\n to,\n );\n if (!replaceallPossibliliteis) {\n return orgString;\n }\n }\n }\n return orgString;\n }\n}","//#region imports\n/* */ \nimport { Log, Level } from 'ng2-logger/browser-prod';\nimport { _, path, fse, glob, crossPlatformPath, fg, dotTaonFolder, dotTnpFolder, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds, UtilsFilesFolders__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__copy, UtilsFilesFoldersSync__NS__copyFile, UtilsFilesFoldersSync__NS__filterDontCopy, UtilsFilesFoldersSync__NS__filterOnlyCopy, UtilsFilesFoldersSync__NS__getFilesFrom, UtilsFilesFoldersSync__NS__getFoldersFrom, UtilsFilesFoldersSync__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__move, UtilsFilesFoldersSync__NS__readFile, UtilsFilesFoldersSync__NS__UtilsFilesFoldersSyncGetFilesFromOptions, UtilsFilesFoldersSync__NS__writeFile } from 'tnp-core/browser-prod';\nimport { Helpers } from 'tnp-core/browser-prod';\n\nimport { shouldDebug } from './magic-renamer-data';\nimport { RenameRule } from './rename-rule';\n\n//#endregion\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class MagicRenamer {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["log"],"mappings":";;;AAGA,MAAMA,KAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,UAAU,CAAA;IACrB,OAAO,IAAI,CAAC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,GAAG,IAAI,CAAC,YAAY;AACtC,QAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;AACxD,YAAA,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;AAC7B,YAAA,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC;YAClB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;gBACjC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;AAC/D,gBAAAA,KAAG,CAAC,CAAC,CAAC,CAAA,QAAA,EAAW,KAAK,CAAC,MAAM,CAAA,UAAA,EAAa,QAAQ,CAAA,KAAA,EAAQ,EAAE,CAAA,CAAA,CAAG,CAAC;AAChE,gBAAA,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAI,MAAM,CAAC,+BAA+B,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EACtD,EAAE,CACH;gBACD,IAAI,CAAC,wBAAwB,EAAE;AAC7B,oBAAA,OAAO,SAAS;gBAClB;YACF;QACF;AACA,QAAA,OAAO,SAAS;IAClB;AACD;;ACjID;AACA;AAQA;AACA,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,YAAY,CAAA;AAiNxB;;AC7ND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"magic-renamer-browser.mjs","sources":["../../../tmp-libs-for-dist-prod/magic-renamer/projects/magic-renamer/src/lib/rename-rule.ts","../../../tmp-libs-for-dist-prod/magic-renamer/projects/magic-renamer/src/lib/magic-renamer.ts","../../../tmp-libs-for-dist-prod/magic-renamer/projects/magic-renamer/src/magic-renamer-browser.ts"],"sourcesContent":["import { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds } from 'tnp-core/browser-prod';\nimport { ___NS__add, ___NS__after, ___NS__ary, ___NS__assign, ___NS__assignIn, ___NS__assignInWith, ___NS__assignWith, ___NS__at, ___NS__attempt, ___NS__before, ___NS__bind, ___NS__bindAll, ___NS__bindKey, ___NS__camelCase, ___NS__capitalize, ___NS__castArray, ___NS__ceil, ___NS__chain, ___NS__chunk, ___NS__clamp, ___NS__clone, ___NS__cloneDeep, ___NS__cloneDeepWith, ___NS__cloneWith, ___NS__compact, ___NS__concat, ___NS__cond, ___NS__conforms, ___NS__conformsTo, ___NS__constant, ___NS__countBy, ___NS__create, ___NS__curry, ___NS__curryRight, ___NS__debounce, ___NS__deburr, ___NS__defaults, ___NS__defaultsDeep, ___NS__defaultTo, ___NS__defer, ___NS__delay, ___NS__difference, ___NS__differenceBy, ___NS__differenceWith, ___NS__divide, ___NS__drop, ___NS__dropRight, ___NS__dropRightWhile, ___NS__dropWhile, ___NS__each, ___NS__eachRight, ___NS__endsWith, ___NS__entries, ___NS__entriesIn, ___NS__eq, ___NS__escape, ___NS__escapeRegExp, ___NS__every, ___NS__extend, ___NS__extendWith, ___NS__fill, ___NS__filter, ___NS__find, ___NS__findIndex, ___NS__findKey, ___NS__findLast, ___NS__findLastIndex, ___NS__findLastKey, ___NS__first, ___NS__flatMap, ___NS__flatMapDeep, ___NS__flatMapDepth, ___NS__flatten, ___NS__flattenDeep, ___NS__flattenDepth, ___NS__flip, ___NS__floor, ___NS__flow, ___NS__flowRight, ___NS__forEach, ___NS__forEachRight, ___NS__forIn, ___NS__forInRight, ___NS__forOwn, ___NS__forOwnRight, ___NS__fromPairs, ___NS__functions, ___NS__functionsIn, ___NS__get, ___NS__groupBy, ___NS__gt, ___NS__gte, ___NS__has, ___NS__hasIn, ___NS__head, ___NS__identity, ___NS__includes, ___NS__indexOf, ___NS__initial, ___NS__inRange, ___NS__intersection, ___NS__intersectionBy, ___NS__intersectionWith, ___NS__invert, ___NS__invertBy, ___NS__invoke, ___NS__invokeMap, ___NS__isArguments, ___NS__isArray, ___NS__isArrayBuffer, ___NS__isArrayLike, ___NS__isArrayLikeObject, ___NS__isBoolean, ___NS__isBuffer, ___NS__isDate, ___NS__isElement, ___NS__isEmpty, ___NS__isEqual, ___NS__isEqualWith, ___NS__isError, ___NS__isFinite, ___NS__isFunction, ___NS__isInteger, ___NS__isLength, ___NS__isMap, ___NS__isMatch, ___NS__isMatchWith, ___NS__isNaN, ___NS__isNative, ___NS__isNil, ___NS__isNull, ___NS__isNumber, ___NS__isObject, ___NS__isObjectLike, ___NS__isPlainObject, ___NS__isRegExp, ___NS__isSafeInteger, ___NS__isSet, ___NS__isString, ___NS__isSymbol, ___NS__isTypedArray, ___NS__isUndefined, ___NS__isWeakMap, ___NS__isWeakSet, ___NS__iteratee, ___NS__join, ___NS__kebabCase, ___NS__keyBy, ___NS__keys, ___NS__keysIn, ___NS__last, ___NS__lastIndexOf, ___NS__lowerCase, ___NS__lowerFirst, ___NS__lt, ___NS__lte, ___NS__map, ___NS__mapKeys, ___NS__mapValues, ___NS__matches, ___NS__matchesProperty, ___NS__max, ___NS__maxBy, ___NS__mean, ___NS__meanBy, ___NS__memoize, ___NS__merge, ___NS__mergeWith, ___NS__method, ___NS__methodOf, ___NS__min, ___NS__minBy, ___NS__mixin, ___NS__multiply, ___NS__negate, ___NS__noop, ___NS__now, ___NS__nth, ___NS__nthArg, ___NS__omit, ___NS__omitBy, ___NS__once, ___NS__orderBy, ___NS__over, ___NS__overArgs, ___NS__overEvery, ___NS__overSome, ___NS__pad, ___NS__padEnd, ___NS__padStart, ___NS__parseInt, ___NS__partial, ___NS__partialRight, ___NS__partition, ___NS__pick, ___NS__pickBy, ___NS__property, ___NS__propertyOf, ___NS__pull, ___NS__pullAll, ___NS__pullAllBy, ___NS__pullAllWith, ___NS__pullAt, ___NS__random, ___NS__range, ___NS__rangeRight, ___NS__rearg, ___NS__reduce, ___NS__reduceRight, ___NS__reject, ___NS__remove, ___NS__repeat, ___NS__replace, ___NS__rest, ___NS__result, ___NS__reverse, ___NS__round, ___NS__sample, ___NS__sampleSize, ___NS__set, ___NS__setWith, ___NS__shuffle, ___NS__size, ___NS__slice, ___NS__snakeCase, ___NS__some, ___NS__sortBy, ___NS__sortedIndex, ___NS__sortedIndexBy, ___NS__sortedIndexOf, ___NS__sortedLastIndex, ___NS__sortedLastIndexBy, ___NS__sortedLastIndexOf, ___NS__sortedUniq, ___NS__sortedUniqBy, ___NS__split, ___NS__spread, ___NS__startCase, ___NS__startsWith, ___NS__stubArray, ___NS__stubFalse, ___NS__stubObject, ___NS__stubString, ___NS__stubTrue, ___NS__subtract, ___NS__sum, ___NS__sumBy, ___NS__tail, ___NS__take, ___NS__takeRight, ___NS__takeRightWhile, ___NS__takeWhile, ___NS__tap, ___NS__template, ___NS__templateSettings, ___NS__throttle, ___NS__thru, ___NS__times, ___NS__toArray, ___NS__toFinite, ___NS__toInteger, ___NS__toLength, ___NS__toLower, ___NS__toNumber, ___NS__toPairs, ___NS__toPairsIn, ___NS__toPath, ___NS__toPlainObject, ___NS__toSafeInteger, ___NS__toString, ___NS__toUpper, ___NS__transform, ___NS__trim, ___NS__trimEnd, ___NS__trimStart, ___NS__truncate, ___NS__unary, ___NS__unescape, ___NS__union, ___NS__unionBy, ___NS__unionWith, ___NS__uniq, ___NS__uniqBy, ___NS__uniqueId, ___NS__uniqWith, ___NS__unset, ___NS__unzip, ___NS__unzipWith, ___NS__update, ___NS__updateWith, ___NS__upperCase, ___NS__upperFirst, ___NS__values, ___NS__valuesIn, ___NS__without, ___NS__words, ___NS__wrap, ___NS__xor, ___NS__xorBy, ___NS__xorWith, ___NS__zip, ___NS__zipObject, ___NS__zipObjectDeep, ___NS__zipWith, UtilsString__NS__kebabCaseNoSplitNumbers } from 'tnp-core/browser-prod';\nimport { Log, Level } from 'ng2-logger/browser-prod';\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class RenameRule {\n static from(pArgs: string): RenameRule[] {\n pArgs = pArgs.replace(/\\=\\>/g, '->');\n let args = pArgs.split(/(\\'|\\\")(\\ )+(\\'|\\\")/).filter(f => !!f) as string[];\n log.d('---- Rules ----');\n args.forEach(a => {\n log.d(a);\n });\n log.d('---------------');\n return args\n .filter(a => a.search('->') !== -1)\n .map(a => {\n const [from, to] = a.split('->');\n if (!from || !to) {\n Helpers__NS__error(\n `Incorrect rule\n \"${from}\" -> \"${to}\"\n please follow pattern: 'test name -> my new name '`,\n false,\n true,\n );\n }\n return new RenameRule(from.trim(), to.trim());\n });\n }\n\n public readonly fromWhiteSpaceReplaced: string;\n public readonly toWhiteSpaceReplaced: string;\n constructor(\n public readonly from: string,\n public readonly to: string,\n ) {\n this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\\W/g, ' ');\n this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\\W/g, ' ');\n }\n\n applyTo(s: string): boolean {\n s = s.trim().toLowerCase().replace(/\\W/g, '');\n const res = s.search(this.from.replace(/\\W/g, '')) !== -1;\n return res;\n }\n\n toString = () => {\n return `${this.from} => ${this.to}`;\n };\n\n includes(orgString) {\n return !___NS__isUndefined(\n this.combinations.find(v => {\n const [from, to] = v;\n return orgString === to;\n }),\n );\n }\n\n get combinations() {\n const thisTo = this.toWhiteSpaceReplaced;\n const thisFrom = this.fromWhiteSpaceReplaced;\n return [\n // TODO 'rs.asdasd-asd-A.'\n [\n UtilsString__NS__kebabCaseNoSplitNumbers(thisFrom),\n UtilsString__NS__kebabCaseNoSplitNumbers(thisTo),\n ], // my-entity => hello1-kitty\n [___NS__kebabCase(thisFrom), ___NS__kebabCase(thisTo)], // my-entity => hello-kitty\n [___NS__camelCase(thisFrom), ___NS__camelCase(thisTo)], // myEntity => helloKitty\n [___NS__upperFirst(___NS__camelCase(thisFrom)), ___NS__upperFirst(___NS__camelCase(thisTo))], // MyEntity => HelloKitty\n [___NS__snakeCase(thisFrom), ___NS__snakeCase(thisTo)], // my_entity => hello_kitty\n [___NS__snakeCase(thisFrom).toUpperCase(), ___NS__snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY\n [___NS__startCase(thisFrom), ___NS__startCase(thisTo)], // My Entity => Hello Kitty\n [___NS__upperCase(thisFrom), ___NS__upperCase(thisTo)], // MY ENTITY => HELLO KITTY\n [___NS__lowerCase(thisFrom), ___NS__lowerCase(thisTo)], // my entity => hello kitty\n [\n ___NS__camelCase(thisFrom).toLocaleLowerCase(),\n ___NS__camelCase(thisTo).toLocaleLowerCase(),\n ], // myentity => hellokitty\n ];\n }\n\n /**\n * @param orgString input string\n * @returns string with all possible combinations replaced\n */\n replaceInString(orgString: string): string {\n return this.replace({\n orgString,\n replaceallPossibliliteis: true,\n });\n }\n\n /**\n *\n * @param orgString (file name OR file content)\n * @param replaceallPossibliliteis when changin file notent (not name only)\n * @returns\n */\n replace(options: {\n /**\n * file name for debugging\n */\n fileName?: string;\n orgString: string;\n replaceallPossibliliteis?: boolean;\n }) {\n let { fileName, orgString, replaceallPossibliliteis } = options;\n replaceallPossibliliteis = !!replaceallPossibliliteis;\n const combinations = this.combinations;\n for (let index = 0; index < combinations.length; index++) {\n const v = combinations[index];\n let [from, to] = v;\n if (orgString.search(from) !== -1) {\n const regex = new RegExp(Utils__NS__escapeStringForRegEx(from));\n log.i(`apply! \"${regex.source}\" to file ${fileName} => \"${to}\"`);\n orgString = orgString.replace(\n new RegExp(Utils__NS__escapeStringForRegEx(from), 'g'),\n to,\n );\n if (!replaceallPossibliliteis) {\n return orgString;\n }\n }\n }\n return orgString;\n }\n}","//#region imports\n/* */ \nimport { Log, Level } from 'ng2-logger/browser-prod';\nimport { path, fse, glob, crossPlatformPath, fg, dotTaonFolder, dotTnpFolder, ___NS__add, ___NS__after, ___NS__ary, ___NS__assign, ___NS__assignIn, ___NS__assignInWith, ___NS__assignWith, ___NS__at, ___NS__attempt, ___NS__before, ___NS__bind, ___NS__bindAll, ___NS__bindKey, ___NS__camelCase, ___NS__capitalize, ___NS__castArray, ___NS__ceil, ___NS__chain, ___NS__chunk, ___NS__clamp, ___NS__clone, ___NS__cloneDeep, ___NS__cloneDeepWith, ___NS__cloneWith, ___NS__compact, ___NS__concat, ___NS__cond, ___NS__conforms, ___NS__conformsTo, ___NS__constant, ___NS__countBy, ___NS__create, ___NS__curry, ___NS__curryRight, ___NS__debounce, ___NS__deburr, ___NS__defaults, ___NS__defaultsDeep, ___NS__defaultTo, ___NS__defer, ___NS__delay, ___NS__difference, ___NS__differenceBy, ___NS__differenceWith, ___NS__divide, ___NS__drop, ___NS__dropRight, ___NS__dropRightWhile, ___NS__dropWhile, ___NS__each, ___NS__eachRight, ___NS__endsWith, ___NS__entries, ___NS__entriesIn, ___NS__eq, ___NS__escape, ___NS__escapeRegExp, ___NS__every, ___NS__extend, ___NS__extendWith, ___NS__fill, ___NS__filter, ___NS__find, ___NS__findIndex, ___NS__findKey, ___NS__findLast, ___NS__findLastIndex, ___NS__findLastKey, ___NS__first, ___NS__flatMap, ___NS__flatMapDeep, ___NS__flatMapDepth, ___NS__flatten, ___NS__flattenDeep, ___NS__flattenDepth, ___NS__flip, ___NS__floor, ___NS__flow, ___NS__flowRight, ___NS__forEach, ___NS__forEachRight, ___NS__forIn, ___NS__forInRight, ___NS__forOwn, ___NS__forOwnRight, ___NS__fromPairs, ___NS__functions, ___NS__functionsIn, ___NS__get, ___NS__groupBy, ___NS__gt, ___NS__gte, ___NS__has, ___NS__hasIn, ___NS__head, ___NS__identity, ___NS__includes, ___NS__indexOf, ___NS__initial, ___NS__inRange, ___NS__intersection, ___NS__intersectionBy, ___NS__intersectionWith, ___NS__invert, ___NS__invertBy, ___NS__invoke, ___NS__invokeMap, ___NS__isArguments, ___NS__isArray, ___NS__isArrayBuffer, ___NS__isArrayLike, ___NS__isArrayLikeObject, ___NS__isBoolean, ___NS__isBuffer, ___NS__isDate, ___NS__isElement, ___NS__isEmpty, ___NS__isEqual, ___NS__isEqualWith, ___NS__isError, ___NS__isFinite, ___NS__isFunction, ___NS__isInteger, ___NS__isLength, ___NS__isMap, ___NS__isMatch, ___NS__isMatchWith, ___NS__isNaN, ___NS__isNative, ___NS__isNil, ___NS__isNull, ___NS__isNumber, ___NS__isObject, ___NS__isObjectLike, ___NS__isPlainObject, ___NS__isRegExp, ___NS__isSafeInteger, ___NS__isSet, ___NS__isString, ___NS__isSymbol, ___NS__isTypedArray, ___NS__isUndefined, ___NS__isWeakMap, ___NS__isWeakSet, ___NS__iteratee, ___NS__join, ___NS__kebabCase, ___NS__keyBy, ___NS__keys, ___NS__keysIn, ___NS__last, ___NS__lastIndexOf, ___NS__lowerCase, ___NS__lowerFirst, ___NS__lt, ___NS__lte, ___NS__map, ___NS__mapKeys, ___NS__mapValues, ___NS__matches, ___NS__matchesProperty, ___NS__max, ___NS__maxBy, ___NS__mean, ___NS__meanBy, ___NS__memoize, ___NS__merge, ___NS__mergeWith, ___NS__method, ___NS__methodOf, ___NS__min, ___NS__minBy, ___NS__mixin, ___NS__multiply, ___NS__negate, ___NS__noop, ___NS__now, ___NS__nth, ___NS__nthArg, ___NS__omit, ___NS__omitBy, ___NS__once, ___NS__orderBy, ___NS__over, ___NS__overArgs, ___NS__overEvery, ___NS__overSome, ___NS__pad, ___NS__padEnd, ___NS__padStart, ___NS__parseInt, ___NS__partial, ___NS__partialRight, ___NS__partition, ___NS__pick, ___NS__pickBy, ___NS__property, ___NS__propertyOf, ___NS__pull, ___NS__pullAll, ___NS__pullAllBy, ___NS__pullAllWith, ___NS__pullAt, ___NS__random, ___NS__range, ___NS__rangeRight, ___NS__rearg, ___NS__reduce, ___NS__reduceRight, ___NS__reject, ___NS__remove, ___NS__repeat, ___NS__replace, ___NS__rest, ___NS__result, ___NS__reverse, ___NS__round, ___NS__sample, ___NS__sampleSize, ___NS__set, ___NS__setWith, ___NS__shuffle, ___NS__size, ___NS__slice, ___NS__snakeCase, ___NS__some, ___NS__sortBy, ___NS__sortedIndex, ___NS__sortedIndexBy, ___NS__sortedIndexOf, ___NS__sortedLastIndex, ___NS__sortedLastIndexBy, ___NS__sortedLastIndexOf, ___NS__sortedUniq, ___NS__sortedUniqBy, ___NS__split, ___NS__spread, ___NS__startCase, ___NS__startsWith, ___NS__stubArray, ___NS__stubFalse, ___NS__stubObject, ___NS__stubString, ___NS__stubTrue, ___NS__subtract, ___NS__sum, ___NS__sumBy, ___NS__tail, ___NS__take, ___NS__takeRight, ___NS__takeRightWhile, ___NS__takeWhile, ___NS__tap, ___NS__template, ___NS__templateSettings, ___NS__throttle, ___NS__thru, ___NS__times, ___NS__toArray, ___NS__toFinite, ___NS__toInteger, ___NS__toLength, ___NS__toLower, ___NS__toNumber, ___NS__toPairs, ___NS__toPairsIn, ___NS__toPath, ___NS__toPlainObject, ___NS__toSafeInteger, ___NS__toString, ___NS__toUpper, ___NS__transform, ___NS__trim, ___NS__trimEnd, ___NS__trimStart, ___NS__truncate, ___NS__unary, ___NS__unescape, ___NS__union, ___NS__unionBy, ___NS__unionWith, ___NS__uniq, ___NS__uniqBy, ___NS__uniqueId, ___NS__uniqWith, ___NS__unset, ___NS__unzip, ___NS__unzipWith, ___NS__update, ___NS__updateWith, ___NS__upperCase, ___NS__upperFirst, ___NS__values, ___NS__valuesIn, ___NS__without, ___NS__words, ___NS__wrap, ___NS__xor, ___NS__xorBy, ___NS__xorWith, ___NS__zip, ___NS__zipObject, ___NS__zipObjectDeep, ___NS__zipWith, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds, UtilsFilesFolders__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__copy, UtilsFilesFoldersSync__NS__copyFile, UtilsFilesFoldersSync__NS__filterDontCopy, UtilsFilesFoldersSync__NS__filterOnlyCopy, UtilsFilesFoldersSync__NS__getFilesFrom, UtilsFilesFoldersSync__NS__getFoldersFrom, UtilsFilesFoldersSync__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__move, UtilsFilesFoldersSync__NS__readFile, UtilsFilesFoldersSync__NS__UtilsFilesFoldersSyncGetFilesFromOptions, UtilsFilesFoldersSync__NS__writeFile } from 'tnp-core/browser-prod';\nimport { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC } from 'tnp-core/browser-prod';\n\nimport { shouldDebug } from './magic-renamer-data';\nimport { RenameRule } from './rename-rule';\n\n//#endregion\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class MagicRenamer {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["log"],"mappings":";;;AAGA,MAAMA,KAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,UAAU,CAAA;IACrB,OAAO,IAAI,CAAC,KAAa,EAAA;QACvB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;AACpC,QAAA,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAa;AAC1E,QAAAA,KAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACxB,QAAA,IAAI,CAAC,OAAO,CAAC,CAAC,IAAG;AACf,YAAAA,KAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,QAAA,CAAC,CAAC;AACF,QAAAA,KAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACxB,QAAA,OAAO;AACJ,aAAA,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,IAAG;AACP,YAAA,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;AAChC,YAAA,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;AAChB,gBAAA,kBAAkB,CAChB,CAAA;AACD,SAAA,EAAA,IAAI,SAAS,EAAE,CAAA;AACiC,0DAAA,CAAA,EAC/C,KAAK,EACL,IAAI,CACL;YACH;AACA,YAAA,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAC/C,QAAA,CAAC,CAAC;IACN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AAC,wBAAwB;AACrD,QAAA,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY;AACtC,QAAA,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;AACxD,YAAA,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;AAC7B,YAAA,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC;YAClB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE;gBACjC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC;AAC/D,gBAAAA,KAAG,CAAC,CAAC,CAAC,CAAA,QAAA,EAAW,KAAK,CAAC,MAAM,CAAA,UAAA,EAAa,QAAQ,CAAA,KAAA,EAAQ,EAAE,CAAA,CAAA,CAAG,CAAC;AAChE,gBAAA,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAI,MAAM,CAAC,+BAA+B,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EACtD,EAAE,CACH;gBACD,IAAI,CAAC,wBAAwB,EAAE;AAC7B,oBAAA,OAAO,SAAS;gBAClB;YACF;QACF;AACA,QAAA,OAAO,SAAS;IAClB;AACD;;ACjID;AACA;AAQA;AACA,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,YAAY,CAAA;AAiNxB;;AC7ND;;AAEG;;;;"}
|
|
@@ -25,6 +25,6 @@ exports.CURRENT_PACKAGE_TAON_VERSION = 'v21';
|
|
|
25
25
|
/**
|
|
26
26
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
27
27
|
*/
|
|
28
|
-
exports.CURRENT_PACKAGE_VERSION = '21.0.
|
|
28
|
+
exports.CURRENT_PACKAGE_VERSION = '21.0.20';
|
|
29
29
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
30
30
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
package/lib/package.json
CHANGED
|
@@ -25,6 +25,6 @@ exports.CURRENT_PACKAGE_TAON_VERSION = 'v21';
|
|
|
25
25
|
/**
|
|
26
26
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
27
27
|
*/
|
|
28
|
-
exports.CURRENT_PACKAGE_VERSION = '21.0.
|
|
28
|
+
exports.CURRENT_PACKAGE_VERSION = '21.0.20';
|
|
29
29
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
30
30
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -34,15 +34,15 @@ class MagicRenamer {
|
|
|
34
34
|
//#region public api
|
|
35
35
|
//#region public api / start
|
|
36
36
|
start(pArgs, omitPatterns) {
|
|
37
|
-
if (lib_prod_2.
|
|
37
|
+
if ((0, lib_prod_2.___NS__isUndefined)(omitPatterns)) {
|
|
38
38
|
omitPatterns = lib_prod_2.UtilsFilesFoldersSync__NS__IGNORE_FOLDERS_FILES_PATTERNS;
|
|
39
39
|
}
|
|
40
40
|
this.omitPatterns = omitPatterns;
|
|
41
41
|
const orgArgs = pArgs;
|
|
42
|
-
this.verbose && lib_prod_3.
|
|
42
|
+
this.verbose && (0, lib_prod_3.Helpers__NS__info)('\n\n\nRebranding of files');
|
|
43
43
|
// let options = Helpers.cliTool.argsFrom<{}>(pArgs);
|
|
44
44
|
// pArgs = Helpers.cliTool.cleanCommand(pArgs, options);
|
|
45
|
-
// let relativePath =
|
|
45
|
+
// let relativePath = ___NS__first(pArgs.split(' '));
|
|
46
46
|
// pArgs = pArgs.replace(relativePath, '');
|
|
47
47
|
pArgs = decodeURIComponent(pArgs);
|
|
48
48
|
// console.log({
|
|
@@ -56,7 +56,7 @@ ${this.rules.map(r => r.toString()).join('\n')}`);
|
|
|
56
56
|
// console.log({
|
|
57
57
|
// pArgs
|
|
58
58
|
// })
|
|
59
|
-
lib_prod_3.
|
|
59
|
+
(0, lib_prod_3.Helpers__NS__error)(`[magic-renamer] Please provide rules:
|
|
60
60
|
example:
|
|
61
61
|
<command> 'my-module -> my-new-modules'
|
|
62
62
|
your args: "${orgArgs}"
|
|
@@ -66,7 +66,7 @@ ${this.rules.map(r => r.toString()).join('\n')}`);
|
|
|
66
66
|
let folder = this.cwd;
|
|
67
67
|
let files = this.getAllFilesFoldersRecusively(folder); //filter(f => crossPlatformPath(f) === folder)
|
|
68
68
|
this.verbose &&
|
|
69
|
-
lib_prod_3.
|
|
69
|
+
(0, lib_prod_3.Helpers__NS__info)(`Detecteed files (${files.length}) in folder ${folder}:
|
|
70
70
|
${files.map(f => `- ${f.replace(folder, '')}`).join('\n')}`);
|
|
71
71
|
const starCallback = newFolder => {
|
|
72
72
|
if (newFolder) {
|
|
@@ -136,7 +136,7 @@ ${files.map(f => `- ${f.replace(folder, '')}`).join('\n')}`);
|
|
|
136
136
|
log.d(`Not apply to: ${fileName}`);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
return this.changeFiles(folder, lib_prod_2.
|
|
139
|
+
return this.changeFiles(folder, (0, lib_prod_2.___NS__cloneDeep)(files), startProcessAgain, false);
|
|
140
140
|
}
|
|
141
141
|
changeContent(files = []) {
|
|
142
142
|
if (files.length === 0) {
|
|
@@ -144,7 +144,7 @@ ${files.map(f => `- ${f.replace(folder, '')}`).join('\n')}`);
|
|
|
144
144
|
}
|
|
145
145
|
const fileAbsPath = files.shift() || '';
|
|
146
146
|
log.d(`Processing content of file: ${lib_prod_2.path.basename(fileAbsPath)}`);
|
|
147
|
-
const fileContent = lib_prod_3.
|
|
147
|
+
const fileContent = (0, lib_prod_3.Helpers__NS__readFile)(fileAbsPath) || '';
|
|
148
148
|
const rules = this.rules;
|
|
149
149
|
for (let index = 0; index < rules.length; index++) {
|
|
150
150
|
const r = rules[index];
|
|
@@ -158,7 +158,7 @@ ${files.map(f => `- ${f.replace(folder, '')}`).join('\n')}`);
|
|
|
158
158
|
replaceallPossibliliteis: true,
|
|
159
159
|
});
|
|
160
160
|
// shouldDebug(fileAbsPath) && console.log(replaced)
|
|
161
|
-
lib_prod_3.
|
|
161
|
+
(0, lib_prod_3.Helpers__NS__writeFile)(fileAbsPath, replaced);
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
164
|
log.d(`Not apply to: ${fileAbsPath}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-renamer.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,yCAAyC,CAAC,WAAW;AACrD,kDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"magic-renamer.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,yCAAyC,CAAC,WAAW;AACrD,kDAAiD;AACjD,gDAA2xN;AAC3xN,gDAAimF;AAGjmF,+CAA2C;AAE3C,YAAY;AACZ,MAAM,GAAG,GAAG,cAAG,CAAC,MAAM,CAAC,eAAe,EAAE,gBAAK,CAAC,SAAS,CAAC,CAAC;AAEzD,MAAa,YAAY;IAOJ;IACT;IAPV,kBAAkB;IAElB,mBAAmB;IACX,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;IAE/B,YACmB,GAAW,EACpB,OAAgB;QADP,QAAG,GAAH,GAAG,CAAQ;QACpB,YAAO,GAAP,OAAO,CAAS;IACvB,CAAC;IAEG,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,GAAG,KAAK;QACxD,GAAG,GAAG,IAAA,4BAAiB,EAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,YAAY,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,YAAY,CAAC,UAAU,CAAC,GAAG,CAAiB,CA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map(a => {
|
|
22
22
|
const [from, to] = a.split('->');
|
|
23
23
|
if (!from || !to) {
|
|
24
|
-
lib_prod_1.
|
|
24
|
+
(0, lib_prod_1.Helpers__NS__error)(`Incorrect rule
|
|
25
25
|
"${from}" -> "${to}"
|
|
26
26
|
please follow pattern: 'test name -> my new name '`, false, true);
|
|
27
27
|
}
|
|
@@ -45,7 +45,7 @@ class RenameRule {
|
|
|
45
45
|
return `${this.from} => ${this.to}`;
|
|
46
46
|
};
|
|
47
47
|
includes(orgString) {
|
|
48
|
-
return !lib_prod_2.
|
|
48
|
+
return !(0, lib_prod_2.___NS__isUndefined)(this.combinations.find(v => {
|
|
49
49
|
const [from, to] = v;
|
|
50
50
|
return orgString === to;
|
|
51
51
|
}));
|
|
@@ -59,17 +59,17 @@ class RenameRule {
|
|
|
59
59
|
(0, lib_prod_2.UtilsString__NS__kebabCaseNoSplitNumbers)(thisFrom),
|
|
60
60
|
(0, lib_prod_2.UtilsString__NS__kebabCaseNoSplitNumbers)(thisTo),
|
|
61
61
|
], // my-entity => hello1-kitty
|
|
62
|
-
[lib_prod_2.
|
|
63
|
-
[lib_prod_2.
|
|
64
|
-
[lib_prod_2.
|
|
65
|
-
[lib_prod_2.
|
|
66
|
-
[lib_prod_2.
|
|
67
|
-
[lib_prod_2.
|
|
68
|
-
[lib_prod_2.
|
|
69
|
-
[lib_prod_2.
|
|
62
|
+
[(0, lib_prod_2.___NS__kebabCase)(thisFrom), (0, lib_prod_2.___NS__kebabCase)(thisTo)], // my-entity => hello-kitty
|
|
63
|
+
[(0, lib_prod_2.___NS__camelCase)(thisFrom), (0, lib_prod_2.___NS__camelCase)(thisTo)], // myEntity => helloKitty
|
|
64
|
+
[(0, lib_prod_2.___NS__upperFirst)((0, lib_prod_2.___NS__camelCase)(thisFrom)), (0, lib_prod_2.___NS__upperFirst)((0, lib_prod_2.___NS__camelCase)(thisTo))], // MyEntity => HelloKitty
|
|
65
|
+
[(0, lib_prod_2.___NS__snakeCase)(thisFrom), (0, lib_prod_2.___NS__snakeCase)(thisTo)], // my_entity => hello_kitty
|
|
66
|
+
[(0, lib_prod_2.___NS__snakeCase)(thisFrom).toUpperCase(), (0, lib_prod_2.___NS__snakeCase)(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY
|
|
67
|
+
[(0, lib_prod_2.___NS__startCase)(thisFrom), (0, lib_prod_2.___NS__startCase)(thisTo)], // My Entity => Hello Kitty
|
|
68
|
+
[(0, lib_prod_2.___NS__upperCase)(thisFrom), (0, lib_prod_2.___NS__upperCase)(thisTo)], // MY ENTITY => HELLO KITTY
|
|
69
|
+
[(0, lib_prod_2.___NS__lowerCase)(thisFrom), (0, lib_prod_2.___NS__lowerCase)(thisTo)], // my entity => hello kitty
|
|
70
70
|
[
|
|
71
|
-
lib_prod_2.
|
|
72
|
-
lib_prod_2.
|
|
71
|
+
(0, lib_prod_2.___NS__camelCase)(thisFrom).toLocaleLowerCase(),
|
|
72
|
+
(0, lib_prod_2.___NS__camelCase)(thisTo).toLocaleLowerCase(),
|
|
73
73
|
], // myentity => hellokitty
|
|
74
74
|
];
|
|
75
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rename-rule.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"rename-rule.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,gDAAk2H;AACl2H,gDAA8+J;AAC9+J,kDAAiD;AACjD,MAAM,GAAG,GAAG,cAAG,CAAC,MAAM,CAAC,eAAe,EAAE,gBAAK,CAAC,SAAS,CAAC,CAAC;AAEzD,MAAa,UAAU;IA6BH;IACA;IA7BlB,MAAM,CAAC,IAAI,CAAC,KAAa;QACvB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrC,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC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C,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YAC9B,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC;YACnB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAClC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAA,0CAA+B,EAAC,IAAI,CAAC,CAAC,CAAC;gBAChE,GAAG,CAAC,CAAC,CAAC,WAAW,KAAK,CAAC,MAAM,aAAa,QAAQ,QAAQ,EAAE,GAAG,CAAC,CAAC;gBACjE,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAI,MAAM,CAAC,IAAA,0CAA+B,EAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EACtD,EAAE,CACH,CAAC;gBACF,IAAI,CAAC,wBAAwB,EAAE,CAAC;oBAC9B,OAAO,SAAS,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA5HD,gCA4HC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "magic-renamer",
|
|
3
|
-
"version": "21.0.
|
|
3
|
+
"version": "21.0.20",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"taon init": "taon init",
|
|
6
6
|
"taon start": "taon start",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"magic-renamer-debug": "bin/magic-renamer-debug"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {},
|
|
38
|
+
"devDependencies": {},
|
|
38
39
|
"repository": {
|
|
39
40
|
"type": "git",
|
|
40
41
|
"url": "https://github.com/darekf77/magic-renamer.git"
|
package/websql/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Helpers__NS__error, ___NS__isUndefined, UtilsString__NS__kebabCaseNoSplitNumbers, ___NS__kebabCase, ___NS__camelCase, ___NS__upperFirst, ___NS__snakeCase, ___NS__startCase, ___NS__upperCase, ___NS__lowerCase, Utils__NS__escapeStringForRegEx } from 'tnp-core/websql-prod';
|
|
2
2
|
import { Log, Level } from 'ng2-logger/websql-prod';
|
|
3
3
|
|
|
4
4
|
const log$1 = Log.create('magic-renemer', Level.__NOTHING);
|
|
@@ -16,7 +16,7 @@ class RenameRule {
|
|
|
16
16
|
.map(a => {
|
|
17
17
|
const [from, to] = a.split('->');
|
|
18
18
|
if (!from || !to) {
|
|
19
|
-
|
|
19
|
+
Helpers__NS__error(`Incorrect rule
|
|
20
20
|
"${from}" -> "${to}"
|
|
21
21
|
please follow pattern: 'test name -> my new name '`, false, true);
|
|
22
22
|
}
|
|
@@ -38,7 +38,7 @@ class RenameRule {
|
|
|
38
38
|
return res;
|
|
39
39
|
}
|
|
40
40
|
includes(orgString) {
|
|
41
|
-
return !
|
|
41
|
+
return !___NS__isUndefined(this.combinations.find(v => {
|
|
42
42
|
const [from, to] = v;
|
|
43
43
|
return orgString === to;
|
|
44
44
|
}));
|
|
@@ -52,17 +52,17 @@ class RenameRule {
|
|
|
52
52
|
UtilsString__NS__kebabCaseNoSplitNumbers(thisFrom),
|
|
53
53
|
UtilsString__NS__kebabCaseNoSplitNumbers(thisTo),
|
|
54
54
|
], // my-entity => hello1-kitty
|
|
55
|
-
[
|
|
56
|
-
[
|
|
57
|
-
[
|
|
58
|
-
[
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
55
|
+
[___NS__kebabCase(thisFrom), ___NS__kebabCase(thisTo)], // my-entity => hello-kitty
|
|
56
|
+
[___NS__camelCase(thisFrom), ___NS__camelCase(thisTo)], // myEntity => helloKitty
|
|
57
|
+
[___NS__upperFirst(___NS__camelCase(thisFrom)), ___NS__upperFirst(___NS__camelCase(thisTo))], // MyEntity => HelloKitty
|
|
58
|
+
[___NS__snakeCase(thisFrom), ___NS__snakeCase(thisTo)], // my_entity => hello_kitty
|
|
59
|
+
[___NS__snakeCase(thisFrom).toUpperCase(), ___NS__snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY
|
|
60
|
+
[___NS__startCase(thisFrom), ___NS__startCase(thisTo)], // My Entity => Hello Kitty
|
|
61
|
+
[___NS__upperCase(thisFrom), ___NS__upperCase(thisTo)], // MY ENTITY => HELLO KITTY
|
|
62
|
+
[___NS__lowerCase(thisFrom), ___NS__lowerCase(thisTo)], // my entity => hello kitty
|
|
63
63
|
[
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
___NS__camelCase(thisFrom).toLocaleLowerCase(),
|
|
65
|
+
___NS__camelCase(thisTo).toLocaleLowerCase(),
|
|
66
66
|
], // myentity => hellokitty
|
|
67
67
|
];
|
|
68
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-renamer-websql.mjs","sources":["../../../tmp-libs-for-dist-websql-prod/magic-renamer/projects/magic-renamer/src/lib/rename-rule.ts","../../../tmp-libs-for-dist-websql-prod/magic-renamer/projects/magic-renamer/src/lib/magic-renamer.ts","../../../tmp-libs-for-dist-websql-prod/magic-renamer/projects/magic-renamer/src/magic-renamer-websql.ts"],"sourcesContent":["import { Helpers, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds } from 'tnp-core/websql-prod';\nimport { _, UtilsString__NS__kebabCaseNoSplitNumbers } from 'tnp-core/websql-prod';\nimport { Log, Level } from 'ng2-logger/websql-prod';\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class RenameRule {\n static from(pArgs: string): RenameRule[] {\n pArgs = pArgs.replace(/\\=\\>/g, '->');\n let args = pArgs.split(/(\\'|\\\")(\\ )+(\\'|\\\")/).filter(f => !!f) as string[];\n log.d('---- Rules ----');\n args.forEach(a => {\n log.d(a);\n });\n log.d('---------------');\n return args\n .filter(a => a.search('->') !== -1)\n .map(a => {\n const [from, to] = a.split('->');\n if (!from || !to) {\n Helpers.error(\n `Incorrect rule\n \"${from}\" -> \"${to}\"\n please follow pattern: 'test name -> my new name '`,\n false,\n true,\n );\n }\n return new RenameRule(from.trim(), to.trim());\n });\n }\n\n public readonly fromWhiteSpaceReplaced: string;\n public readonly toWhiteSpaceReplaced: string;\n constructor(\n public readonly from: string,\n public readonly to: string,\n ) {\n this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\\W/g, ' ');\n this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\\W/g, ' ');\n }\n\n applyTo(s: string): boolean {\n s = s.trim().toLowerCase().replace(/\\W/g, '');\n const res = s.search(this.from.replace(/\\W/g, '')) !== -1;\n return res;\n }\n\n toString = () => {\n return `${this.from} => ${this.to}`;\n };\n\n includes(orgString) {\n return !_.isUndefined(\n this.combinations.find(v => {\n const [from, to] = v;\n return orgString === to;\n }),\n );\n }\n\n get combinations() {\n const thisTo = this.toWhiteSpaceReplaced;\n const thisFrom = this.fromWhiteSpaceReplaced;\n return [\n // TODO 'rs.asdasd-asd-A.'\n [\n UtilsString__NS__kebabCaseNoSplitNumbers(thisFrom),\n UtilsString__NS__kebabCaseNoSplitNumbers(thisTo),\n ], // my-entity => hello1-kitty\n [_.kebabCase(thisFrom), _.kebabCase(thisTo)], // my-entity => hello-kitty\n [_.camelCase(thisFrom), _.camelCase(thisTo)], // myEntity => helloKitty\n [_.upperFirst(_.camelCase(thisFrom)), _.upperFirst(_.camelCase(thisTo))], // MyEntity => HelloKitty\n [_.snakeCase(thisFrom), _.snakeCase(thisTo)], // my_entity => hello_kitty\n [_.snakeCase(thisFrom).toUpperCase(), _.snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY\n [_.startCase(thisFrom), _.startCase(thisTo)], // My Entity => Hello Kitty\n [_.upperCase(thisFrom), _.upperCase(thisTo)], // MY ENTITY => HELLO KITTY\n [_.lowerCase(thisFrom), _.lowerCase(thisTo)], // my entity => hello kitty\n [\n _.camelCase(thisFrom).toLocaleLowerCase(),\n _.camelCase(thisTo).toLocaleLowerCase(),\n ], // myentity => hellokitty\n ];\n }\n\n /**\n * @param orgString input string\n * @returns string with all possible combinations replaced\n */\n replaceInString(orgString: string): string {\n return this.replace({\n orgString,\n replaceallPossibliliteis: true,\n });\n }\n\n /**\n *\n * @param orgString (file name OR file content)\n * @param replaceallPossibliliteis when changin file notent (not name only)\n * @returns\n */\n replace(options: {\n /**\n * file name for debugging\n */\n fileName?: string;\n orgString: string;\n replaceallPossibliliteis?: boolean;\n }) {\n let { fileName, orgString, replaceallPossibliliteis } = options;\n replaceallPossibliliteis = !!replaceallPossibliliteis;\n const combinations = this.combinations;\n for (let index = 0; index < combinations.length; index++) {\n const v = combinations[index];\n let [from, to] = v;\n if (orgString.search(from) !== -1) {\n const regex = new RegExp(Utils__NS__escapeStringForRegEx(from));\n log.i(`apply! \"${regex.source}\" to file ${fileName} => \"${to}\"`);\n orgString = orgString.replace(\n new RegExp(Utils__NS__escapeStringForRegEx(from), 'g'),\n to,\n );\n if (!replaceallPossibliliteis) {\n return orgString;\n }\n }\n }\n return orgString;\n }\n}","//#region imports\n/* */ \nimport { Log, Level } from 'ng2-logger/websql-prod';\nimport { _, path, fse, glob, crossPlatformPath, fg, dotTaonFolder, dotTnpFolder, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds, UtilsFilesFolders__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__copy, UtilsFilesFoldersSync__NS__copyFile, UtilsFilesFoldersSync__NS__filterDontCopy, UtilsFilesFoldersSync__NS__filterOnlyCopy, UtilsFilesFoldersSync__NS__getFilesFrom, UtilsFilesFoldersSync__NS__getFoldersFrom, UtilsFilesFoldersSync__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__move, UtilsFilesFoldersSync__NS__readFile, UtilsFilesFoldersSync__NS__UtilsFilesFoldersSyncGetFilesFromOptions, UtilsFilesFoldersSync__NS__writeFile } from 'tnp-core/websql-prod';\nimport { Helpers } from 'tnp-core/websql-prod';\n\nimport { shouldDebug } from './magic-renamer-data';\nimport { RenameRule } from './rename-rule';\n\n//#endregion\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class MagicRenamer {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["log"],"mappings":";;;AAGA,MAAMA,KAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,UAAU,CAAA;IACrB,OAAO,IAAI,CAAC,KAAa,EAAA;QACvB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;AACpC,QAAA,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAa;AAC1E,QAAAA,KAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACxB,QAAA,IAAI,CAAC,OAAO,CAAC,CAAC,IAAG;AACf,YAAAA,KAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,QAAA,CAAC,CAAC;AACF,QAAAA,KAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACxB,QAAA,OAAO;AACJ,aAAA,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACjC,GAAG,CAAC,CAAC,IAAG;AACP,YAAA,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;AAChC,YAAA,IAAI,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE;gBAChB,OAAO,CAAC,KAAK,CACX,CAAA;AACD,SAAA,EAAA,IAAI,SAAS,EAAE,CAAA;AACiC,0DAAA,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A;AACA,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,YAAY,CAAA;AAiNxB;;AC7ND;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"magic-renamer-websql.mjs","sources":["../../../tmp-libs-for-dist-websql-prod/magic-renamer/projects/magic-renamer/src/lib/rename-rule.ts","../../../tmp-libs-for-dist-websql-prod/magic-renamer/projects/magic-renamer/src/lib/magic-renamer.ts","../../../tmp-libs-for-dist-websql-prod/magic-renamer/projects/magic-renamer/src/magic-renamer-websql.ts"],"sourcesContent":["import { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds } from 'tnp-core/websql-prod';\nimport { ___NS__add, ___NS__after, ___NS__ary, ___NS__assign, ___NS__assignIn, ___NS__assignInWith, ___NS__assignWith, ___NS__at, ___NS__attempt, ___NS__before, ___NS__bind, ___NS__bindAll, ___NS__bindKey, ___NS__camelCase, ___NS__capitalize, ___NS__castArray, ___NS__ceil, ___NS__chain, ___NS__chunk, ___NS__clamp, ___NS__clone, ___NS__cloneDeep, ___NS__cloneDeepWith, ___NS__cloneWith, ___NS__compact, ___NS__concat, ___NS__cond, ___NS__conforms, ___NS__conformsTo, ___NS__constant, ___NS__countBy, ___NS__create, ___NS__curry, ___NS__curryRight, ___NS__debounce, ___NS__deburr, ___NS__defaults, ___NS__defaultsDeep, ___NS__defaultTo, ___NS__defer, ___NS__delay, ___NS__difference, ___NS__differenceBy, ___NS__differenceWith, ___NS__divide, ___NS__drop, ___NS__dropRight, ___NS__dropRightWhile, ___NS__dropWhile, ___NS__each, ___NS__eachRight, ___NS__endsWith, ___NS__entries, ___NS__entriesIn, ___NS__eq, ___NS__escape, ___NS__escapeRegExp, ___NS__every, ___NS__extend, ___NS__extendWith, ___NS__fill, ___NS__filter, ___NS__find, ___NS__findIndex, ___NS__findKey, ___NS__findLast, ___NS__findLastIndex, ___NS__findLastKey, ___NS__first, ___NS__flatMap, ___NS__flatMapDeep, ___NS__flatMapDepth, ___NS__flatten, ___NS__flattenDeep, ___NS__flattenDepth, ___NS__flip, ___NS__floor, ___NS__flow, ___NS__flowRight, ___NS__forEach, ___NS__forEachRight, ___NS__forIn, ___NS__forInRight, ___NS__forOwn, ___NS__forOwnRight, ___NS__fromPairs, ___NS__functions, ___NS__functionsIn, ___NS__get, ___NS__groupBy, ___NS__gt, ___NS__gte, ___NS__has, ___NS__hasIn, ___NS__head, ___NS__identity, ___NS__includes, ___NS__indexOf, ___NS__initial, ___NS__inRange, ___NS__intersection, ___NS__intersectionBy, ___NS__intersectionWith, ___NS__invert, ___NS__invertBy, ___NS__invoke, ___NS__invokeMap, ___NS__isArguments, ___NS__isArray, ___NS__isArrayBuffer, ___NS__isArrayLike, ___NS__isArrayLikeObject, ___NS__isBoolean, ___NS__isBuffer, ___NS__isDate, ___NS__isElement, ___NS__isEmpty, ___NS__isEqual, ___NS__isEqualWith, ___NS__isError, ___NS__isFinite, ___NS__isFunction, ___NS__isInteger, ___NS__isLength, ___NS__isMap, ___NS__isMatch, ___NS__isMatchWith, ___NS__isNaN, ___NS__isNative, ___NS__isNil, ___NS__isNull, ___NS__isNumber, ___NS__isObject, ___NS__isObjectLike, ___NS__isPlainObject, ___NS__isRegExp, ___NS__isSafeInteger, ___NS__isSet, ___NS__isString, ___NS__isSymbol, ___NS__isTypedArray, ___NS__isUndefined, ___NS__isWeakMap, ___NS__isWeakSet, ___NS__iteratee, ___NS__join, ___NS__kebabCase, ___NS__keyBy, ___NS__keys, ___NS__keysIn, ___NS__last, ___NS__lastIndexOf, ___NS__lowerCase, ___NS__lowerFirst, ___NS__lt, ___NS__lte, ___NS__map, ___NS__mapKeys, ___NS__mapValues, ___NS__matches, ___NS__matchesProperty, ___NS__max, ___NS__maxBy, ___NS__mean, ___NS__meanBy, ___NS__memoize, ___NS__merge, ___NS__mergeWith, ___NS__method, ___NS__methodOf, ___NS__min, ___NS__minBy, ___NS__mixin, ___NS__multiply, ___NS__negate, ___NS__noop, ___NS__now, ___NS__nth, ___NS__nthArg, ___NS__omit, ___NS__omitBy, ___NS__once, ___NS__orderBy, ___NS__over, ___NS__overArgs, ___NS__overEvery, ___NS__overSome, ___NS__pad, ___NS__padEnd, ___NS__padStart, ___NS__parseInt, ___NS__partial, ___NS__partialRight, ___NS__partition, ___NS__pick, ___NS__pickBy, ___NS__property, ___NS__propertyOf, ___NS__pull, ___NS__pullAll, ___NS__pullAllBy, ___NS__pullAllWith, ___NS__pullAt, ___NS__random, ___NS__range, ___NS__rangeRight, ___NS__rearg, ___NS__reduce, ___NS__reduceRight, ___NS__reject, ___NS__remove, ___NS__repeat, ___NS__replace, ___NS__rest, ___NS__result, ___NS__reverse, ___NS__round, ___NS__sample, ___NS__sampleSize, ___NS__set, ___NS__setWith, ___NS__shuffle, ___NS__size, ___NS__slice, ___NS__snakeCase, ___NS__some, ___NS__sortBy, ___NS__sortedIndex, ___NS__sortedIndexBy, ___NS__sortedIndexOf, ___NS__sortedLastIndex, ___NS__sortedLastIndexBy, ___NS__sortedLastIndexOf, ___NS__sortedUniq, ___NS__sortedUniqBy, ___NS__split, ___NS__spread, ___NS__startCase, ___NS__startsWith, ___NS__stubArray, ___NS__stubFalse, ___NS__stubObject, ___NS__stubString, ___NS__stubTrue, ___NS__subtract, ___NS__sum, ___NS__sumBy, ___NS__tail, ___NS__take, ___NS__takeRight, ___NS__takeRightWhile, ___NS__takeWhile, ___NS__tap, ___NS__template, ___NS__templateSettings, ___NS__throttle, ___NS__thru, ___NS__times, ___NS__toArray, ___NS__toFinite, ___NS__toInteger, ___NS__toLength, ___NS__toLower, ___NS__toNumber, ___NS__toPairs, ___NS__toPairsIn, ___NS__toPath, ___NS__toPlainObject, ___NS__toSafeInteger, ___NS__toString, ___NS__toUpper, ___NS__transform, ___NS__trim, ___NS__trimEnd, ___NS__trimStart, ___NS__truncate, ___NS__unary, ___NS__unescape, ___NS__union, ___NS__unionBy, ___NS__unionWith, ___NS__uniq, ___NS__uniqBy, ___NS__uniqueId, ___NS__uniqWith, ___NS__unset, ___NS__unzip, ___NS__unzipWith, ___NS__update, ___NS__updateWith, ___NS__upperCase, ___NS__upperFirst, ___NS__values, ___NS__valuesIn, ___NS__without, ___NS__words, ___NS__wrap, ___NS__xor, ___NS__xorBy, ___NS__xorWith, ___NS__zip, ___NS__zipObject, ___NS__zipObjectDeep, ___NS__zipWith, UtilsString__NS__kebabCaseNoSplitNumbers } from 'tnp-core/websql-prod';\nimport { Log, Level } from 'ng2-logger/websql-prod';\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class RenameRule {\n static from(pArgs: string): RenameRule[] {\n pArgs = pArgs.replace(/\\=\\>/g, '->');\n let args = pArgs.split(/(\\'|\\\")(\\ )+(\\'|\\\")/).filter(f => !!f) as string[];\n log.d('---- Rules ----');\n args.forEach(a => {\n log.d(a);\n });\n log.d('---------------');\n return args\n .filter(a => a.search('->') !== -1)\n .map(a => {\n const [from, to] = a.split('->');\n if (!from || !to) {\n Helpers__NS__error(\n `Incorrect rule\n \"${from}\" -> \"${to}\"\n please follow pattern: 'test name -> my new name '`,\n false,\n true,\n );\n }\n return new RenameRule(from.trim(), to.trim());\n });\n }\n\n public readonly fromWhiteSpaceReplaced: string;\n public readonly toWhiteSpaceReplaced: string;\n constructor(\n public readonly from: string,\n public readonly to: string,\n ) {\n this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\\W/g, ' ');\n this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\\W/g, ' ');\n }\n\n applyTo(s: string): boolean {\n s = s.trim().toLowerCase().replace(/\\W/g, '');\n const res = s.search(this.from.replace(/\\W/g, '')) !== -1;\n return res;\n }\n\n toString = () => {\n return `${this.from} => ${this.to}`;\n };\n\n includes(orgString) {\n return !___NS__isUndefined(\n this.combinations.find(v => {\n const [from, to] = v;\n return orgString === to;\n }),\n );\n }\n\n get combinations() {\n const thisTo = this.toWhiteSpaceReplaced;\n const thisFrom = this.fromWhiteSpaceReplaced;\n return [\n // TODO 'rs.asdasd-asd-A.'\n [\n UtilsString__NS__kebabCaseNoSplitNumbers(thisFrom),\n UtilsString__NS__kebabCaseNoSplitNumbers(thisTo),\n ], // my-entity => hello1-kitty\n [___NS__kebabCase(thisFrom), ___NS__kebabCase(thisTo)], // my-entity => hello-kitty\n [___NS__camelCase(thisFrom), ___NS__camelCase(thisTo)], // myEntity => helloKitty\n [___NS__upperFirst(___NS__camelCase(thisFrom)), ___NS__upperFirst(___NS__camelCase(thisTo))], // MyEntity => HelloKitty\n [___NS__snakeCase(thisFrom), ___NS__snakeCase(thisTo)], // my_entity => hello_kitty\n [___NS__snakeCase(thisFrom).toUpperCase(), ___NS__snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY\n [___NS__startCase(thisFrom), ___NS__startCase(thisTo)], // My Entity => Hello Kitty\n [___NS__upperCase(thisFrom), ___NS__upperCase(thisTo)], // MY ENTITY => HELLO KITTY\n [___NS__lowerCase(thisFrom), ___NS__lowerCase(thisTo)], // my entity => hello kitty\n [\n ___NS__camelCase(thisFrom).toLocaleLowerCase(),\n ___NS__camelCase(thisTo).toLocaleLowerCase(),\n ], // myentity => hellokitty\n ];\n }\n\n /**\n * @param orgString input string\n * @returns string with all possible combinations replaced\n */\n replaceInString(orgString: string): string {\n return this.replace({\n orgString,\n replaceallPossibliliteis: true,\n });\n }\n\n /**\n *\n * @param orgString (file name OR file content)\n * @param replaceallPossibliliteis when changin file notent (not name only)\n * @returns\n */\n replace(options: {\n /**\n * file name for debugging\n */\n fileName?: string;\n orgString: string;\n replaceallPossibliliteis?: boolean;\n }) {\n let { fileName, orgString, replaceallPossibliliteis } = options;\n replaceallPossibliliteis = !!replaceallPossibliliteis;\n const combinations = this.combinations;\n for (let index = 0; index < combinations.length; index++) {\n const v = combinations[index];\n let [from, to] = v;\n if (orgString.search(from) !== -1) {\n const regex = new RegExp(Utils__NS__escapeStringForRegEx(from));\n log.i(`apply! \"${regex.source}\" to file ${fileName} => \"${to}\"`);\n orgString = orgString.replace(\n new RegExp(Utils__NS__escapeStringForRegEx(from), 'g'),\n to,\n );\n if (!replaceallPossibliliteis) {\n return orgString;\n }\n }\n }\n return orgString;\n }\n}","//#region imports\n/* */ \nimport { Log, Level } from 'ng2-logger/websql-prod';\nimport { path, fse, glob, crossPlatformPath, fg, dotTaonFolder, dotTnpFolder, ___NS__add, ___NS__after, ___NS__ary, ___NS__assign, ___NS__assignIn, ___NS__assignInWith, ___NS__assignWith, ___NS__at, ___NS__attempt, ___NS__before, ___NS__bind, ___NS__bindAll, ___NS__bindKey, ___NS__camelCase, ___NS__capitalize, ___NS__castArray, ___NS__ceil, ___NS__chain, ___NS__chunk, ___NS__clamp, ___NS__clone, ___NS__cloneDeep, ___NS__cloneDeepWith, ___NS__cloneWith, ___NS__compact, ___NS__concat, ___NS__cond, ___NS__conforms, ___NS__conformsTo, ___NS__constant, ___NS__countBy, ___NS__create, ___NS__curry, ___NS__curryRight, ___NS__debounce, ___NS__deburr, ___NS__defaults, ___NS__defaultsDeep, ___NS__defaultTo, ___NS__defer, ___NS__delay, ___NS__difference, ___NS__differenceBy, ___NS__differenceWith, ___NS__divide, ___NS__drop, ___NS__dropRight, ___NS__dropRightWhile, ___NS__dropWhile, ___NS__each, ___NS__eachRight, ___NS__endsWith, ___NS__entries, ___NS__entriesIn, ___NS__eq, ___NS__escape, ___NS__escapeRegExp, ___NS__every, ___NS__extend, ___NS__extendWith, ___NS__fill, ___NS__filter, ___NS__find, ___NS__findIndex, ___NS__findKey, ___NS__findLast, ___NS__findLastIndex, ___NS__findLastKey, ___NS__first, ___NS__flatMap, ___NS__flatMapDeep, ___NS__flatMapDepth, ___NS__flatten, ___NS__flattenDeep, ___NS__flattenDepth, ___NS__flip, ___NS__floor, ___NS__flow, ___NS__flowRight, ___NS__forEach, ___NS__forEachRight, ___NS__forIn, ___NS__forInRight, ___NS__forOwn, ___NS__forOwnRight, ___NS__fromPairs, ___NS__functions, ___NS__functionsIn, ___NS__get, ___NS__groupBy, ___NS__gt, ___NS__gte, ___NS__has, ___NS__hasIn, ___NS__head, ___NS__identity, ___NS__includes, ___NS__indexOf, ___NS__initial, ___NS__inRange, ___NS__intersection, ___NS__intersectionBy, ___NS__intersectionWith, ___NS__invert, ___NS__invertBy, ___NS__invoke, ___NS__invokeMap, ___NS__isArguments, ___NS__isArray, ___NS__isArrayBuffer, ___NS__isArrayLike, ___NS__isArrayLikeObject, ___NS__isBoolean, ___NS__isBuffer, ___NS__isDate, ___NS__isElement, ___NS__isEmpty, ___NS__isEqual, ___NS__isEqualWith, ___NS__isError, ___NS__isFinite, ___NS__isFunction, ___NS__isInteger, ___NS__isLength, ___NS__isMap, ___NS__isMatch, ___NS__isMatchWith, ___NS__isNaN, ___NS__isNative, ___NS__isNil, ___NS__isNull, ___NS__isNumber, ___NS__isObject, ___NS__isObjectLike, ___NS__isPlainObject, ___NS__isRegExp, ___NS__isSafeInteger, ___NS__isSet, ___NS__isString, ___NS__isSymbol, ___NS__isTypedArray, ___NS__isUndefined, ___NS__isWeakMap, ___NS__isWeakSet, ___NS__iteratee, ___NS__join, ___NS__kebabCase, ___NS__keyBy, ___NS__keys, ___NS__keysIn, ___NS__last, ___NS__lastIndexOf, ___NS__lowerCase, ___NS__lowerFirst, ___NS__lt, ___NS__lte, ___NS__map, ___NS__mapKeys, ___NS__mapValues, ___NS__matches, ___NS__matchesProperty, ___NS__max, ___NS__maxBy, ___NS__mean, ___NS__meanBy, ___NS__memoize, ___NS__merge, ___NS__mergeWith, ___NS__method, ___NS__methodOf, ___NS__min, ___NS__minBy, ___NS__mixin, ___NS__multiply, ___NS__negate, ___NS__noop, ___NS__now, ___NS__nth, ___NS__nthArg, ___NS__omit, ___NS__omitBy, ___NS__once, ___NS__orderBy, ___NS__over, ___NS__overArgs, ___NS__overEvery, ___NS__overSome, ___NS__pad, ___NS__padEnd, ___NS__padStart, ___NS__parseInt, ___NS__partial, ___NS__partialRight, ___NS__partition, ___NS__pick, ___NS__pickBy, ___NS__property, ___NS__propertyOf, ___NS__pull, ___NS__pullAll, ___NS__pullAllBy, ___NS__pullAllWith, ___NS__pullAt, ___NS__random, ___NS__range, ___NS__rangeRight, ___NS__rearg, ___NS__reduce, ___NS__reduceRight, ___NS__reject, ___NS__remove, ___NS__repeat, ___NS__replace, ___NS__rest, ___NS__result, ___NS__reverse, ___NS__round, ___NS__sample, ___NS__sampleSize, ___NS__set, ___NS__setWith, ___NS__shuffle, ___NS__size, ___NS__slice, ___NS__snakeCase, ___NS__some, ___NS__sortBy, ___NS__sortedIndex, ___NS__sortedIndexBy, ___NS__sortedIndexOf, ___NS__sortedLastIndex, ___NS__sortedLastIndexBy, ___NS__sortedLastIndexOf, ___NS__sortedUniq, ___NS__sortedUniqBy, ___NS__split, ___NS__spread, ___NS__startCase, ___NS__startsWith, ___NS__stubArray, ___NS__stubFalse, ___NS__stubObject, ___NS__stubString, ___NS__stubTrue, ___NS__subtract, ___NS__sum, ___NS__sumBy, ___NS__tail, ___NS__take, ___NS__takeRight, ___NS__takeRightWhile, ___NS__takeWhile, ___NS__tap, ___NS__template, ___NS__templateSettings, ___NS__throttle, ___NS__thru, ___NS__times, ___NS__toArray, ___NS__toFinite, ___NS__toInteger, ___NS__toLength, ___NS__toLower, ___NS__toNumber, ___NS__toPairs, ___NS__toPairsIn, ___NS__toPath, ___NS__toPlainObject, ___NS__toSafeInteger, ___NS__toString, ___NS__toUpper, ___NS__transform, ___NS__trim, ___NS__trimEnd, ___NS__trimStart, ___NS__truncate, ___NS__unary, ___NS__unescape, ___NS__union, ___NS__unionBy, ___NS__unionWith, ___NS__uniq, ___NS__uniqBy, ___NS__uniqueId, ___NS__uniqWith, ___NS__unset, ___NS__unzip, ___NS__unzipWith, ___NS__update, ___NS__updateWith, ___NS__upperCase, ___NS__upperFirst, ___NS__values, ___NS__valuesIn, ___NS__without, ___NS__words, ___NS__wrap, ___NS__xor, ___NS__xorBy, ___NS__xorWith, ___NS__zip, ___NS__zipObject, ___NS__zipObjectDeep, ___NS__zipWith, Utils__NS__binary__NS__arrayBufferToBlob, Utils__NS__binary__NS__base64toBlob, Utils__NS__binary__NS__base64toDbBinaryFormat, Utils__NS__binary__NS__blobToArrayBuffer, Utils__NS__binary__NS__blobToBase64, Utils__NS__binary__NS__blobToFile, Utils__NS__binary__NS__blobToJson, Utils__NS__binary__NS__blobToText, Utils__NS__binary__NS__dbBinaryFormatToBase64, Utils__NS__binary__NS__dbBinaryFormatToText, Utils__NS__binary__NS__fileToBlob, Utils__NS__binary__NS__fileToText, Utils__NS__binary__NS__getBlobFrom, Utils__NS__binary__NS__jsonToBlob, Utils__NS__binary__NS__textToBlob, Utils__NS__binary__NS__textToDbBinaryFormat, Utils__NS__binary__NS__textToFile, Utils__NS__camelize, Utils__NS__css__NS__numValue, Utils__NS__DbBinaryFormat, Utils__NS__DbBinaryFormatEnum, Utils__NS__DbBinaryFormatForBrowser, Utils__NS__escapeStringForRegEx, Utils__NS__fullDate, Utils__NS__fullDateTime, Utils__NS__getFreePort, Utils__NS__removeChalkSpecialChars, Utils__NS__requireUncached, Utils__NS__sortKeys, Utils__NS__uniqArray, Utils__NS__wait, Utils__NS__waitMilliseconds, UtilsFilesFolders__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__copy, UtilsFilesFoldersSync__NS__copyFile, UtilsFilesFoldersSync__NS__filterDontCopy, UtilsFilesFoldersSync__NS__filterOnlyCopy, UtilsFilesFoldersSync__NS__getFilesFrom, UtilsFilesFoldersSync__NS__getFoldersFrom, UtilsFilesFoldersSync__NS__IGNORE_FOLDERS_FILES_PATTERNS, UtilsFilesFoldersSync__NS__move, UtilsFilesFoldersSync__NS__readFile, UtilsFilesFoldersSync__NS__UtilsFilesFoldersSyncGetFilesFromOptions, UtilsFilesFoldersSync__NS__writeFile } from 'tnp-core/websql-prod';\nimport { Helpers__NS___fixCommand, Helpers__NS__bigMaxBuffer, Helpers__NS__checkProcess, Helpers__NS__cleanExit, Helpers__NS__clearConsole, Helpers__NS__command, Helpers__NS__commandOutputAsString, Helpers__NS__commandOutputAsStringAsync, Helpers__NS__compilationWrapper, Helpers__NS__contain, Helpers__NS__createFolder, Helpers__NS__createSymLink, Helpers__NS__error, Helpers__NS__execute, Helpers__NS__exists, Helpers__NS__filesFrom, Helpers__NS__foldersFrom, Helpers__NS__getFilesFrom, Helpers__NS__getFoldersFrom, Helpers__NS__getIsBrowser, Helpers__NS__getIsElectron, Helpers__NS__getIsNode, Helpers__NS__getIsRunningInGitBash, Helpers__NS__getIsSupportedTaonTerminal, Helpers__NS__getIsVerboseMode, Helpers__NS__getIsWebSQL, Helpers__NS__getIsWsl, Helpers__NS__getStdio, Helpers__NS__hideNodeWarnings, Helpers__NS__info, Helpers__NS__isBlob, Helpers__NS__isBuffer, Helpers__NS__isClass, Helpers__NS__isExistedSymlink, Helpers__NS__isFile, Helpers__NS__isFolder, Helpers__NS__isRunningInDocker, Helpers__NS__isRunningInLinuxGraphicsCapableEnvironment, Helpers__NS__isSymlinkFileExitedOrUnexisted, Helpers__NS__isSymlinkThatMatchesUrl, Helpers__NS__isUnexistedLink, Helpers__NS__killOnPort, Helpers__NS__killProcess, Helpers__NS__killProcessByPort, Helpers__NS__linksToFolderFrom, Helpers__NS__linksToFoldersFrom, Helpers__NS__log, Helpers__NS__logError, Helpers__NS__logInfo, Helpers__NS__logProc, Helpers__NS__logSuccess, Helpers__NS__logWarn, Helpers__NS__mediaTypeFromSrc, Helpers__NS__mkdirp, Helpers__NS__modifyLineByLine, Helpers__NS__msgCacheClear, Helpers__NS__openFolderInFileExplorer, Helpers__NS__parse, Helpers__NS__pathContainLink, Helpers__NS__questionYesNo, Helpers__NS__readFile, Helpers__NS__readJson, Helpers__NS__readJson5, Helpers__NS__readJsonC, Helpers__NS__relative, Helpers__NS__remove, Helpers__NS__removeEmptyLineFromString, Helpers__NS__removeFileIfExists, Helpers__NS__removeFolderIfExists, Helpers__NS__removeIfExists, Helpers__NS__removeSlashAtBegin, Helpers__NS__removeSlashAtEnd, Helpers__NS__removeSymlinks, Helpers__NS__renderError, Helpers__NS__replaceLinesInFile, Helpers__NS__run, Helpers__NS__runAsyncIn, Helpers__NS__runSyncIn, Helpers__NS__runSyncOrAsync, Helpers__NS__sleep, Helpers__NS__stopApplication, Helpers__NS__stringify, Helpers__NS__success, Helpers__NS__taskDone, Helpers__NS__taskStarted, Helpers__NS__throwError, Helpers__NS__timeout, Helpers__NS__tryCatchError, Helpers__NS__tryReadFile, Helpers__NS__tryRemoveDir, Helpers__NS__values, Helpers__NS__wait, Helpers__NS__warn, Helpers__NS__writeFile, Helpers__NS__writeJson, Helpers__NS__writeJson5, Helpers__NS__writeJsonC } from 'tnp-core/websql-prod';\n\nimport { shouldDebug } from './magic-renamer-data';\nimport { RenameRule } from './rename-rule';\n\n//#endregion\nconst log = Log.create('magic-renemer', Level.__NOTHING);\n\nexport class MagicRenamer {\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n/* */\n \n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["log"],"mappings":";;;AAGA,MAAMA,KAAG,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC;MAE3C,UAAU,CAAA;IACrB,OAAO,IAAI,CAAC,KAAa,EAAA;QACvB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC;AACpC,QAAA,IAAI,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAa;AAC1E,QAAAA,KAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACxB,QAAA,IAAI,CAAC,OAAO,CAAC,CAAC,IAAG;AACf,YAAAA,KAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACV,QAAA,CAAC,CAAC;AACF,QAAAA,KAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC;AACxB,QAAA,OAAO;AACJ,aAAA,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CA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