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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apn-app-manager",
3
- "version": "1.11.0",
3
+ "version": "1.11.2",
4
4
  "description": "Appian App Manager",
5
5
  "license": "Apache-2.0",
6
6
  "preferGlobal": true,
@@ -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, "\\$&");