apn-app-manager 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/objectProps.js +0 -2
- package/src/util.js +6 -1
package/package.json
CHANGED
package/src/objectProps.js
CHANGED
|
@@ -291,7 +291,6 @@ const haulTypes = [
|
|
|
291
291
|
xpath: `recordTypeHaul/recordType/a:urlStub/node()`,
|
|
292
292
|
type: propTypes.URL_STUB,
|
|
293
293
|
usage: [usageTypes.CLONE, usageTypes.BUILD],
|
|
294
|
-
replaceFormat: "<a:urlStub>{VALUE}</a:urlStub>",
|
|
295
294
|
},
|
|
296
295
|
{
|
|
297
296
|
fieldName: fieldNames.DB_TABLE,
|
|
@@ -404,7 +403,6 @@ const haulTypes = [
|
|
|
404
403
|
xpath: `applicationHaul/application/urlIdentifier/node()`,
|
|
405
404
|
type: propTypes.URL_STUB,
|
|
406
405
|
usage: [usageTypes.CLONE, usageTypes.BUILD],
|
|
407
|
-
replaceFormat: "<urlIdentifier>{VALUE}</urlIdentifier>",
|
|
408
406
|
},
|
|
409
407
|
{
|
|
410
408
|
fieldName: fieldNames.APP_PREFIX,
|
package/src/util.js
CHANGED
|
@@ -436,13 +436,18 @@ function trim(value) {
|
|
|
436
436
|
function regexReplace(string, from, to, wordBounded) {
|
|
437
437
|
let regex;
|
|
438
438
|
if (wordBounded) {
|
|
439
|
-
regex = new RegExp(`\\b` + regexEscape(from) + `\\b`, "g");
|
|
439
|
+
regex = new RegExp(`\\b` + regexEscape(regexDropLeadingTrailingUrlStubNonWordChars(from)) + `\\b`, "g");
|
|
440
440
|
} else {
|
|
441
441
|
regex = new RegExp(regexEscape(from), "g");
|
|
442
442
|
}
|
|
443
443
|
return isBlank(from) ? string : string.replace(regex, to);
|
|
444
444
|
}
|
|
445
445
|
|
|
446
|
+
// Used to do the regex replacement
|
|
447
|
+
function regexDropLeadingTrailingUrlStubNonWordChars(string) {
|
|
448
|
+
return string.replace(/^[\-\_]*/g, "").replace(/[\-\_]*$/g, "");
|
|
449
|
+
}
|
|
450
|
+
|
|
446
451
|
// Used to do the regex replacement
|
|
447
452
|
function regexEscape(string) {
|
|
448
453
|
return string.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|