magic-renamer 18.0.36 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
THIS FILE IS GENERATED. THIS FILE IS GENERATED. THIS FILE IS GENERATED.
|
|
2
2
|
|
|
3
|
-
Assets from this folder are being shipped with this npm package (magic-renamer@18.0.
|
|
3
|
+
Assets from this folder are being shipped with this npm package (magic-renamer@18.0.41)
|
|
4
4
|
created from this project.
|
|
5
5
|
|
|
6
6
|
THIS FILE IS GENERATED.THIS FILE IS GENERATED. THIS FILE IS GENERATED.
|
package/package.json
CHANGED
package/tmp-environment.json
CHANGED
|
@@ -3,10 +3,31 @@
|
|
|
3
3
|
"domain": "magic-renamer.example.domain.com",
|
|
4
4
|
"title": "Magic Renamer"
|
|
5
5
|
},
|
|
6
|
+
"paths": {},
|
|
7
|
+
"config": {},
|
|
8
|
+
"container": {},
|
|
9
|
+
"ports": {},
|
|
10
|
+
"init": {},
|
|
11
|
+
"build": {
|
|
12
|
+
"pwa": {},
|
|
13
|
+
"watch": false
|
|
14
|
+
},
|
|
15
|
+
"loading": {
|
|
16
|
+
"preAngularBootstrap": {},
|
|
17
|
+
"afterAngularBootstrap": {}
|
|
18
|
+
},
|
|
19
|
+
"release": {
|
|
20
|
+
"cli": {},
|
|
21
|
+
"lib": {},
|
|
22
|
+
"autoReleaseUsingConfig": true,
|
|
23
|
+
"releaseVersionBumpType": "major",
|
|
24
|
+
"releaseType": "manual",
|
|
25
|
+
"targetArtifact": "npm-lib-and-cli-tool"
|
|
26
|
+
},
|
|
27
|
+
"copyToManager": {},
|
|
6
28
|
"buildInfo": {
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"hash": "befc6bec15a13ce9a28ef844d0b9d834ec6f70d1"
|
|
29
|
+
"date": "2025-04-18T12:38:48.000Z",
|
|
30
|
+
"hash": "7b1087c0919daa7caf86b1539f09714c59512469"
|
|
10
31
|
},
|
|
11
32
|
"currentProjectName": "magic-renamer",
|
|
12
33
|
"currentProjectType": "isomorphic-lib",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class RenameRule {
|
|
2
|
-
readonly from: string;
|
|
3
|
-
readonly to: string;
|
|
4
|
-
readonly fromWhiteSpaceReplaced: string;
|
|
5
|
-
readonly toWhiteSpaceReplaced: string;
|
|
6
|
-
constructor(from: string, to: string);
|
|
7
|
-
applyTo(s: string): boolean;
|
|
8
|
-
toString: () => string;
|
|
9
|
-
includes(orgString: any): boolean;
|
|
10
|
-
get combinations(): string[][];
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
* @param orgString (file name OR file content)
|
|
14
|
-
* @param replaceallPossibliliteis when changin file notent (not name only)
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
replace(filename: string, orgString: string, replaceallPossibliliteis?: boolean): string;
|
|
18
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RenameRule = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var tnp_helpers_1 = require("tnp-helpers");
|
|
6
|
-
var tnp_core_1 = require("tnp-core");
|
|
7
|
-
var ng2_logger_1 = require("ng2-logger");
|
|
8
|
-
var log = ng2_logger_1.Log.create('magic-renemer', ng2_logger_1.Level.__NOTHING);
|
|
9
|
-
var RenameRule = /** @class */ (function () {
|
|
10
|
-
function RenameRule(from, to) {
|
|
11
|
-
var _this = this;
|
|
12
|
-
this.from = from;
|
|
13
|
-
this.to = to;
|
|
14
|
-
this.toString = function () {
|
|
15
|
-
return "".concat(_this.from, " => ").concat(_this.to);
|
|
16
|
-
};
|
|
17
|
-
this.fromWhiteSpaceReplaced = from.trim().toLowerCase().replace(/\W/g, ' ');
|
|
18
|
-
this.toWhiteSpaceReplaced = to.trim().toLowerCase().replace(/\W/g, ' ');
|
|
19
|
-
}
|
|
20
|
-
RenameRule.prototype.applyTo = function (s) {
|
|
21
|
-
s = s.trim().toLowerCase().replace(/\W/g, '');
|
|
22
|
-
var res = (s.search(this.from.replace(/\W/g, '')) !== -1);
|
|
23
|
-
return res;
|
|
24
|
-
};
|
|
25
|
-
RenameRule.prototype.includes = function (orgString) {
|
|
26
|
-
return !tnp_core_1._.isUndefined(this.combinations.find(function (v) {
|
|
27
|
-
var _a = tslib_1.__read(v, 2), from = _a[0], to = _a[1];
|
|
28
|
-
return orgString === to;
|
|
29
|
-
}));
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(RenameRule.prototype, "combinations", {
|
|
32
|
-
get: function () {
|
|
33
|
-
var thisTo = this.toWhiteSpaceReplaced;
|
|
34
|
-
var thisFrom = this.fromWhiteSpaceReplaced;
|
|
35
|
-
return [
|
|
36
|
-
// TODO 'rs.asdasd-asd-A.'
|
|
37
|
-
[tnp_core_1._.kebabCase(thisFrom), tnp_core_1._.kebabCase(thisTo)], // my-entity => hello-kitty
|
|
38
|
-
[tnp_core_1._.camelCase(thisFrom), tnp_core_1._.camelCase(thisTo)], // myEntity => helloKitty
|
|
39
|
-
[tnp_core_1._.upperFirst(tnp_core_1._.camelCase(thisFrom)), tnp_core_1._.upperFirst(tnp_core_1._.camelCase(thisTo))], // MyEntity => HelloKitty
|
|
40
|
-
[tnp_core_1._.snakeCase(thisFrom), tnp_core_1._.snakeCase(thisTo)], // my_entity => hello_kitty
|
|
41
|
-
[tnp_core_1._.snakeCase(thisFrom).toUpperCase(), tnp_core_1._.snakeCase(thisTo).toUpperCase()], // MY_ENTITY => HELLO_KITTY
|
|
42
|
-
[tnp_core_1._.startCase(thisFrom), tnp_core_1._.startCase(thisTo)], // My Entity => Hello Kitty
|
|
43
|
-
[tnp_core_1._.upperCase(thisFrom), tnp_core_1._.upperCase(thisTo)], // MY ENTITY => HELLO KITTY
|
|
44
|
-
[tnp_core_1._.lowerCase(thisFrom), tnp_core_1._.lowerCase(thisTo)], // my entity => hello kitty
|
|
45
|
-
[tnp_core_1._.camelCase(thisFrom).toLocaleLowerCase(), tnp_core_1._.camelCase(thisTo).toLocaleLowerCase()], // myentity => hellokitty
|
|
46
|
-
];
|
|
47
|
-
},
|
|
48
|
-
enumerable: false,
|
|
49
|
-
configurable: true
|
|
50
|
-
});
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param orgString (file name OR file content)
|
|
54
|
-
* @param replaceallPossibliliteis when changin file notent (not name only)
|
|
55
|
-
* @returns
|
|
56
|
-
*/
|
|
57
|
-
RenameRule.prototype.replace = function (filename, orgString, replaceallPossibliliteis) {
|
|
58
|
-
if (replaceallPossibliliteis === void 0) { replaceallPossibliliteis = false; }
|
|
59
|
-
var combinations = this.combinations;
|
|
60
|
-
for (var index = 0; index < combinations.length; index++) {
|
|
61
|
-
var v = combinations[index];
|
|
62
|
-
var _a = tslib_1.__read(v, 2), from = _a[0], to = _a[1];
|
|
63
|
-
if (orgString.search(from) !== -1) {
|
|
64
|
-
var regex = new RegExp(tnp_helpers_1.Helpers.escapeStringForRegEx(from));
|
|
65
|
-
log.i("apply! \"".concat(regex.source, "\" to file ").concat(filename, " => \"").concat(to, "\""));
|
|
66
|
-
orgString = orgString.replace(new RegExp(tnp_helpers_1.Helpers.escapeStringForRegEx(from), 'g'), to);
|
|
67
|
-
if (!replaceallPossibliliteis) {
|
|
68
|
-
return orgString;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return orgString;
|
|
73
|
-
};
|
|
74
|
-
return RenameRule;
|
|
75
|
-
}());
|
|
76
|
-
exports.RenameRule = RenameRule;
|
|
77
|
-
//# sourceMappingURL=rename-rule.backend.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-rule.backend.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/magic-renamer/src/lib/rename-rule.backend.ts"],"names":[],"mappings":";;;;AAAA,2CAAsC;A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