@fluid-experimental/property-changeset 2.0.0-internal.3.0.5 → 2.0.0-internal.3.1.1

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.
Files changed (113) hide show
  1. package/README.md +1 -0
  2. package/dist/changeset.d.ts +2 -2
  3. package/dist/changeset.d.ts.map +1 -1
  4. package/dist/changeset.js +61 -45
  5. package/dist/changeset.js.map +1 -1
  6. package/dist/changeset_operations/array.d.ts +6 -6
  7. package/dist/changeset_operations/array.d.ts.map +1 -1
  8. package/dist/changeset_operations/array.js +87 -56
  9. package/dist/changeset_operations/array.js.map +1 -1
  10. package/dist/changeset_operations/arrayChangesetIterator.d.ts.map +1 -1
  11. package/dist/changeset_operations/arrayChangesetIterator.js +43 -41
  12. package/dist/changeset_operations/arrayChangesetIterator.js.map +1 -1
  13. package/dist/changeset_operations/changesetConflictTypes.d.ts.map +1 -1
  14. package/dist/changeset_operations/changesetConflictTypes.js.map +1 -1
  15. package/dist/changeset_operations/indexedCollection.d.ts.map +1 -1
  16. package/dist/changeset_operations/indexedCollection.js +76 -44
  17. package/dist/changeset_operations/indexedCollection.js.map +1 -1
  18. package/dist/changeset_operations/isEmptyChangeset.d.ts.map +1 -1
  19. package/dist/changeset_operations/isEmptyChangeset.js +2 -1
  20. package/dist/changeset_operations/isEmptyChangeset.js.map +1 -1
  21. package/dist/changeset_operations/operationTypes.d.ts.map +1 -1
  22. package/dist/changeset_operations/operationTypes.js.map +1 -1
  23. package/dist/helpers/typeidHelper.d.ts +10 -10
  24. package/dist/helpers/typeidHelper.d.ts.map +1 -1
  25. package/dist/helpers/typeidHelper.js +19 -17
  26. package/dist/helpers/typeidHelper.js.map +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/isReservedKeyword.d.ts.map +1 -1
  30. package/dist/isReservedKeyword.js.map +1 -1
  31. package/dist/pathHelper.d.ts.map +1 -1
  32. package/dist/pathHelper.js +16 -10
  33. package/dist/pathHelper.js.map +1 -1
  34. package/dist/rebase.d.ts.map +1 -1
  35. package/dist/rebase.js +20 -13
  36. package/dist/rebase.js.map +1 -1
  37. package/dist/templateSchema.d.ts.map +1 -1
  38. package/dist/templateSchema.js +10 -11
  39. package/dist/templateSchema.js.map +1 -1
  40. package/dist/templateValidator.d.ts.map +1 -1
  41. package/dist/templateValidator.js +135 -102
  42. package/dist/templateValidator.js.map +1 -1
  43. package/dist/test/array.spec.js +141 -343
  44. package/dist/test/array.spec.js.map +1 -1
  45. package/dist/test/pathHelper.spec.js +299 -166
  46. package/dist/test/pathHelper.spec.js.map +1 -1
  47. package/dist/test/reversibleCs.spec.js.map +1 -1
  48. package/dist/test/schemaValidator.js +3 -1
  49. package/dist/test/schemaValidator.js.map +1 -1
  50. package/dist/test/schemas/badBothPropertiesAndTypeid.js +8 -8
  51. package/dist/test/schemas/badBothPropertiesAndTypeid.js.map +1 -1
  52. package/dist/test/schemas/badInvalidSemverInTypeid.js +18 -16
  53. package/dist/test/schemas/badInvalidSemverInTypeid.js.map +1 -1
  54. package/dist/test/schemas/badMissingSemverInTypeid.js +18 -16
  55. package/dist/test/schemas/badMissingSemverInTypeid.js.map +1 -1
  56. package/dist/test/schemas/badNestedProperties.js +18 -17
  57. package/dist/test/schemas/badNestedProperties.js.map +1 -1
  58. package/dist/test/schemas/badPrimitiveTypeid.js +9 -8
  59. package/dist/test/schemas/badPrimitiveTypeid.js.map +1 -1
  60. package/dist/test/schemas/badVersionedTypeid.js +19 -17
  61. package/dist/test/schemas/badVersionedTypeid.js.map +1 -1
  62. package/dist/test/schemas/goodColorPalette.js +4 -4
  63. package/dist/test/schemas/goodColorPalette.js.map +1 -1
  64. package/dist/test/schemas/goodDraftAsVersion.js +2 -4
  65. package/dist/test/schemas/goodDraftAsVersion.js.map +1 -1
  66. package/dist/test/schemas/goodPointId.js +18 -16
  67. package/dist/test/schemas/goodPointId.js.map +1 -1
  68. package/dist/test/schemas/goodReferenceAndRegular.js +5 -5
  69. package/dist/test/schemas/goodReferenceAndRegular.js.map +1 -1
  70. package/dist/test/schemas/goodReservedTypes.js +8 -7
  71. package/dist/test/schemas/goodReservedTypes.js.map +1 -1
  72. package/dist/test/schemas/goodUIBorder.js +19 -16
  73. package/dist/test/schemas/goodUIBorder.js.map +1 -1
  74. package/dist/test/tsconfig.tsbuildinfo +1 -1
  75. package/dist/test/validator/templateSyntax.spec.js.map +1 -1
  76. package/dist/test/validator/templateValidator.spec.js +329 -306
  77. package/dist/test/validator/templateValidator.spec.js.map +1 -1
  78. package/dist/test/validator/typeidHelper.spec.js +98 -65
  79. package/dist/test/validator/typeidHelper.spec.js.map +1 -1
  80. package/dist/utils.d.ts +1 -1
  81. package/dist/utils.d.ts.map +1 -1
  82. package/dist/utils.js +149 -95
  83. package/dist/utils.js.map +1 -1
  84. package/dist/validationResultBuilder.d.ts.map +1 -1
  85. package/dist/validationResultBuilder.js.map +1 -1
  86. package/lib/changeset.js +63 -47
  87. package/lib/changeset.js.map +1 -1
  88. package/lib/changeset_operations/array.js +88 -57
  89. package/lib/changeset_operations/array.js.map +1 -1
  90. package/lib/changeset_operations/arrayChangesetIterator.js +43 -41
  91. package/lib/changeset_operations/arrayChangesetIterator.js.map +1 -1
  92. package/lib/changeset_operations/changesetConflictTypes.js.map +1 -1
  93. package/lib/changeset_operations/indexedCollection.js +76 -44
  94. package/lib/changeset_operations/indexedCollection.js.map +1 -1
  95. package/lib/changeset_operations/isEmptyChangeset.js +2 -1
  96. package/lib/changeset_operations/isEmptyChangeset.js.map +1 -1
  97. package/lib/changeset_operations/operationTypes.js.map +1 -1
  98. package/lib/helpers/typeidHelper.js +19 -17
  99. package/lib/helpers/typeidHelper.js.map +1 -1
  100. package/lib/index.js.map +1 -1
  101. package/lib/isReservedKeyword.js.map +1 -1
  102. package/lib/pathHelper.js +17 -11
  103. package/lib/pathHelper.js.map +1 -1
  104. package/lib/rebase.js +20 -13
  105. package/lib/rebase.js.map +1 -1
  106. package/lib/templateSchema.js +10 -11
  107. package/lib/templateSchema.js.map +1 -1
  108. package/lib/templateValidator.js +135 -102
  109. package/lib/templateValidator.js.map +1 -1
  110. package/lib/utils.js +149 -95
  111. package/lib/utils.js.map +1 -1
  112. package/lib/validationResultBuilder.js.map +1 -1
  113. package/package.json +100 -100
@@ -184,8 +184,10 @@ const _psetDeepEquals = function (in_source, in_target) {
184
184
  // A template with abstract properties must equal one with an empty properties array
185
185
  // We check the difference in keys between the source and target and if the only difference is the
186
186
  // properties array we check if it's empty. Then we reverse the condition so it work both ways.
187
- if (((0, isEqual_1.default)((0, difference_1.default)(keysTarget, keysSource), ["properties"]) && !target.properties.length) ||
188
- ((0, isEqual_1.default)((0, difference_1.default)(keysSource, keysTarget), ["properties"]) && !source.properties.length)) {
187
+ if (((0, isEqual_1.default)((0, difference_1.default)(keysTarget, keysSource), ["properties"]) &&
188
+ !target.properties.length) ||
189
+ ((0, isEqual_1.default)((0, difference_1.default)(keysSource, keysTarget), ["properties"]) &&
190
+ !source.properties.length)) {
189
191
  return _getPSetDeepEqualsResult(true);
190
192
  }
191
193
  return _getPSetDeepEqualsResult(false);
@@ -297,40 +299,42 @@ const _validatePositiveIncrement = function (in_template, in_templatePrevious, i
297
299
  }
298
300
  if (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {
299
301
  // Violates rule 6 (warning).
300
- this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 + JSON.stringify({
301
- mutation,
302
- id: idPath.join("."),
303
- level: {
304
- expected: minimumLevel,
305
- actual: versionDiff,
306
- },
307
- version: {
308
- current: in_version,
309
- previous: in_versionPrevious,
310
- },
311
- }));
302
+ this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 +
303
+ JSON.stringify({
304
+ mutation,
305
+ id: idPath.join("."),
306
+ level: {
307
+ expected: minimumLevel,
308
+ actual: versionDiff,
309
+ },
310
+ version: {
311
+ current: in_version,
312
+ previous: in_versionPrevious,
313
+ },
314
+ }));
312
315
  }
313
316
  }
314
317
  else {
315
318
  const sourceObjType = _getType.call(this, sourceObj);
316
319
  const targetObjType = _getType.call(this, targetObj);
317
320
  if (sourceObjType !== targetObjType) {
318
- this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 + JSON.stringify({
319
- mutation: "change",
320
- id: idPath.join("."),
321
- type: {
322
- current: targetObjType,
323
- previous: sourceObjType,
324
- },
325
- level: {
326
- expected: "major",
327
- actual: versionDiff,
328
- },
329
- version: {
330
- current: in_version,
331
- previous: in_versionPrevious,
332
- },
333
- }));
321
+ this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 +
322
+ JSON.stringify({
323
+ mutation: "change",
324
+ id: idPath.join("."),
325
+ type: {
326
+ current: targetObjType,
327
+ previous: sourceObjType,
328
+ },
329
+ level: {
330
+ expected: "major",
331
+ actual: versionDiff,
332
+ },
333
+ version: {
334
+ current: in_version,
335
+ previous: in_versionPrevious,
336
+ },
337
+ }));
334
338
  }
335
339
  if (Array.isArray(sourceObj)) {
336
340
  let targetMap = {};
@@ -348,18 +352,19 @@ const _validatePositiveIncrement = function (in_template, in_templatePrevious, i
348
352
  if (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {
349
353
  // Violates rule 5 (warning)
350
354
  idPath.push(Object.keys(targetMap)[0]);
351
- this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 + JSON.stringify({
352
- mutation: "add",
353
- id: idPath.join("."),
354
- level: {
355
- expected: minimumLevel,
356
- actual: versionDiff,
357
- },
358
- version: {
359
- current: in_version,
360
- previous: in_versionPrevious,
361
- },
362
- }));
355
+ this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 +
356
+ JSON.stringify({
357
+ mutation: "add",
358
+ id: idPath.join("."),
359
+ level: {
360
+ expected: minimumLevel,
361
+ actual: versionDiff,
362
+ },
363
+ version: {
364
+ current: in_version,
365
+ previous: in_versionPrevious,
366
+ },
367
+ }));
363
368
  idPath.pop();
364
369
  }
365
370
  }
@@ -380,22 +385,25 @@ const _validatePositiveIncrement = function (in_template, in_templatePrevious, i
380
385
  if (!(0, isEmpty_1.default)(remainingKeys)) {
381
386
  // Added new keys to the target. This is a MINOR change, unless they new key is a
382
387
  // comment, in which case this is a PATCH level change.
383
- let minimumLevel = remainingKeys.length === 1 && remainingKeys[0] === "annotation" ? "patch" : "minor";
388
+ let minimumLevel = remainingKeys.length === 1 && remainingKeys[0] === "annotation"
389
+ ? "patch"
390
+ : "minor";
384
391
  if (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {
385
392
  // Violates rule 5 (warning)
386
393
  idPath.push(remainingKeys[0]);
387
- this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 + JSON.stringify({
388
- mutation: "add",
389
- id: idPath.join("."),
390
- level: {
391
- expected: minimumLevel,
392
- actual: versionDiff,
393
- },
394
- version: {
395
- current: in_version,
396
- previous: in_versionPrevious,
397
- },
398
- }));
394
+ this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 +
395
+ JSON.stringify({
396
+ mutation: "add",
397
+ id: idPath.join("."),
398
+ level: {
399
+ expected: minimumLevel,
400
+ actual: versionDiff,
401
+ },
402
+ version: {
403
+ current: in_version,
404
+ previous: in_versionPrevious,
405
+ },
406
+ }));
399
407
  idPath.pop();
400
408
  }
401
409
  }
@@ -409,22 +417,23 @@ const _validatePositiveIncrement = function (in_template, in_templatePrevious, i
409
417
  if (sourceObj !== targetObj) {
410
418
  let minimumLevel = id === "value" ? "minor" : "major";
411
419
  if (CHANGE_LEVEL[versionDiff] < CHANGE_LEVEL[minimumLevel]) {
412
- this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 + JSON.stringify({
413
- mutation: "change",
414
- id: idPath.join("."),
415
- level: {
416
- expected: minimumLevel,
417
- actual: versionDiff,
418
- },
419
- value: {
420
- current: targetObj,
421
- previous: sourceObj,
422
- },
423
- version: {
424
- current: in_version,
425
- previous: in_versionPrevious,
426
- },
427
- }));
420
+ this._resultBuilder.addWarning(MSG.CHANGE_LEVEL_TOO_LOW_1 +
421
+ JSON.stringify({
422
+ mutation: "change",
423
+ id: idPath.join("."),
424
+ level: {
425
+ expected: minimumLevel,
426
+ actual: versionDiff,
427
+ },
428
+ value: {
429
+ current: targetObj,
430
+ previous: sourceObj,
431
+ },
432
+ version: {
433
+ current: in_version,
434
+ previous: in_versionPrevious,
435
+ },
436
+ }));
428
437
  }
429
438
  }
430
439
  }
@@ -588,30 +597,36 @@ const _validateContextAsync = async function (in_template) {
588
597
  return Promise.reject(new Error(MSG.SET_ONLY_NAMED_PROPS));
589
598
  }
590
599
  // Since context is 'set' the template must eventually inherit from NamedProperty (same as above)
591
- if ((0, includes_1.default)(in_template.inherits, "NamedProperty") || in_template.inherits === "NamedProperty") {
600
+ if ((0, includes_1.default)(in_template.inherits, "NamedProperty") ||
601
+ in_template.inherits === "NamedProperty") {
592
602
  return Promise.resolve();
593
603
  }
594
604
  }
595
605
  const typedValuePromise = Promise.all(typedValuePromises);
596
606
  let parents = [];
597
607
  if (in_template.inherits) {
598
- parents = Array.isArray(in_template.inherits) ? in_template.inherits : [in_template.inherits];
608
+ parents = Array.isArray(in_template.inherits)
609
+ ? in_template.inherits
610
+ : [in_template.inherits];
599
611
  }
600
612
  const inheritsPromises = parents.map((typeid) => this._inheritsFromAsync(typeid, "NamedProperty"));
601
613
  // Combine results from inheritsPromises and typedValuePromise
602
614
  inheritsPromises.push(typedValuePromise);
603
- return Promise.all(inheritsPromises).then(function (results) {
615
+ return Promise.all(inheritsPromises)
616
+ .then(function (results) {
604
617
  const foundNamedPropertyDescendant = (0, find_1.default)(results, (res) => res);
605
618
  if (!foundNamedPropertyDescendant) {
606
619
  return Promise.reject(Error(MSG.SET_ONLY_NAMED_PROPS));
607
620
  }
608
621
  return that._hasSchemaAsync(in_template.typeid);
609
- }).then(function (hasIt) {
622
+ })
623
+ .then(function (hasIt) {
610
624
  if (!hasIt) {
611
625
  return Promise.reject(new Error(MSG.SET_ONLY_NAMED_PROPS));
612
626
  }
613
627
  return that._inheritsFromAsync(in_template.typeid, "NamedProperty");
614
- }).then(async function (res) {
628
+ })
629
+ .then(async function (res) {
615
630
  if (res) {
616
631
  return undefined;
617
632
  }
@@ -662,13 +677,14 @@ const _processValidationResults = function (in_template) {
662
677
  error.message = `typeid should have a pattern like: my.example:point-1.0.0 ${error.data} does not match that pattern`;
663
678
  }
664
679
  else if ("pattern" && regexTypeId.test(error.dataPath)) {
665
- error.message = error.schemaPath === "#/definitions/typed-reference-typeid/pattern"
666
- ? ""
667
- : `${error.dataPath} should follow this pattern: <namespace>:<typeid>-<version> ` +
668
- `(for example: Sample:Rectangle-1.0.0) or match one of the Primitive Types (Float32, Float64, ` +
669
- `Int8, Uint8, Int16, Uint16, Int32, Uint32, Bool, String, Reference, Enum, Int64, Uint64) or ` +
670
- `Reserved Types (BaseProperty, NamedProperty, NodeProperty, NamedNodeProperty, ` +
671
- `RelationshipProperty). '${error.data}' is not valid`;
680
+ error.message =
681
+ error.schemaPath === "#/definitions/typed-reference-typeid/pattern"
682
+ ? ""
683
+ : `${error.dataPath} should follow this pattern: <namespace>:<typeid>-<version> ` +
684
+ `(for example: Sample:Rectangle-1.0.0) or match one of the Primitive Types (Float32, Float64, ` +
685
+ `Int8, Uint8, Int16, Uint16, Int32, Uint32, Bool, String, Reference, Enum, Int64, Uint64) or ` +
686
+ `Reserved Types (BaseProperty, NamedProperty, NodeProperty, NamedNodeProperty, ` +
687
+ `RelationshipProperty). '${error.data}' is not valid`;
672
688
  }
673
689
  break;
674
690
  case "enum":
@@ -734,9 +750,12 @@ const createContextCheckAsyncQueue = function () {
734
750
  const that = this;
735
751
  const contextCheckWorker = function (in_task, in_callback) {
736
752
  const property = in_task.property;
737
- _validateContextAsync.call(that, property).then(function (response) {
753
+ _validateContextAsync
754
+ .call(that, property)
755
+ .then(function (response) {
738
756
  in_callback();
739
- }).catch(function (error) {
757
+ })
758
+ .catch(function (error) {
740
759
  in_callback({ error });
741
760
  });
742
761
  };
@@ -800,11 +819,15 @@ class TemplateValidator {
800
819
  this._skipSemver = in_params ? !!in_params.skipSemver : false;
801
820
  this._allowDraft = in_params ? !!in_params.allowDraft : false;
802
821
  // Used by validate()
803
- if (in_params && in_params.inheritsFrom !== undefined && in_params.hasSchema !== undefined) {
822
+ if (in_params &&
823
+ in_params.inheritsFrom !== undefined &&
824
+ in_params.hasSchema !== undefined) {
804
825
  this._inheritsFrom = in_params.inheritsFrom;
805
826
  this._hasSchema = in_params.hasSchema;
806
827
  }
807
- else if (in_params && in_params.inheritsFromAsync !== undefined && in_params.hasSchemaAsync !== undefined) {
828
+ else if (in_params &&
829
+ in_params.inheritsFromAsync !== undefined &&
830
+ in_params.hasSchemaAsync !== undefined) {
808
831
  this._inheritsFromAsync = in_params.inheritsFromAsync;
809
832
  this._hasSchemaAsync = in_params.hasSchemaAsync;
810
833
  }
@@ -853,7 +876,8 @@ class TemplateValidator {
853
876
  validate(in_template, in_templatePrevious) {
854
877
  this._resultBuilder = new validationResultBuilder_1.ValidationResultBuilder(in_template ? in_template.typeid : "");
855
878
  let isDraft = false;
856
- if (in_template && in_template.typeid &&
879
+ if (in_template &&
880
+ in_template.typeid &&
857
881
  typeidHelper_1.TypeIdHelper.extractVersion(in_template.typeid).version === "draft") {
858
882
  if (this._allowDraft) {
859
883
  isDraft = true;
@@ -889,7 +913,9 @@ class TemplateValidator {
889
913
  }
890
914
  // semver format validation
891
915
  const version = _validateSemverFormat.call(this, in_template);
892
- const versionPrevious = in_templatePrevious ? _validateSemverFormat.call(this, in_templatePrevious) : null;
916
+ const versionPrevious = in_templatePrevious
917
+ ? _validateSemverFormat.call(this, in_templatePrevious)
918
+ : null;
893
919
  // semver format validation must pass.
894
920
  if (!this._resultBuilder.isValid()) {
895
921
  return this._resultBuilder.result;
@@ -907,10 +933,11 @@ class TemplateValidator {
907
933
  default:
908
934
  case -1:
909
935
  // previousVersion is greater. Violates rule 3b.
910
- this._resultBuilder.addError(new Error(MSG.VERSION_REGRESSION_1 + JSON.stringify({
911
- current: version,
912
- previous: versionPrevious,
913
- })));
936
+ this._resultBuilder.addError(new Error(MSG.VERSION_REGRESSION_1 +
937
+ JSON.stringify({
938
+ current: version,
939
+ previous: versionPrevious,
940
+ })));
914
941
  break;
915
942
  }
916
943
  }
@@ -963,9 +990,9 @@ class TemplateValidator {
963
990
  if (!this._resultBuilder.isValid()) {
964
991
  return Promise.resolve(this._resultBuilder.result);
965
992
  }
966
- return (in_templatePrevious) ?
967
- this._validateAsyncWithPreviousSchema(in_template, in_templatePrevious) :
968
- _validateSemanticAndSyntaxAsync.call(this, in_template);
993
+ return in_templatePrevious
994
+ ? this._validateAsyncWithPreviousSchema(in_template, in_templatePrevious)
995
+ : _validateSemanticAndSyntaxAsync.call(this, in_template);
969
996
  }
970
997
  /**
971
998
  * Called by validateAsync if a previous schema is passed in argument
@@ -978,7 +1005,10 @@ class TemplateValidator {
978
1005
  */
979
1006
  async _validateAsyncWithPreviousSchema(in_template, in_templatePrevious) {
980
1007
  const that = this;
981
- return _validateSemanticAndSyntaxAsync.call(that, in_template).then(() => _validateSemanticAndSyntaxAsync.call(that, in_templatePrevious)).then(function () {
1008
+ return _validateSemanticAndSyntaxAsync
1009
+ .call(that, in_template)
1010
+ .then(() => _validateSemanticAndSyntaxAsync.call(that, in_templatePrevious))
1011
+ .then(function () {
982
1012
  if (!that._resultBuilder.isValid()) {
983
1013
  // Here the previous template is not valid. Make sure the typeid in the returned info is
984
1014
  // the root of the template that failed validation.
@@ -988,7 +1018,9 @@ class TemplateValidator {
988
1018
  _validateSkipSemver.call(that, in_template, in_templatePrevious);
989
1019
  }
990
1020
  const version = _validateSemverFormat.call(that, in_template);
991
- const versionPrevious = in_templatePrevious ? _validateSemverFormat.call(that, in_templatePrevious) : null;
1021
+ const versionPrevious = in_templatePrevious
1022
+ ? _validateSemverFormat.call(that, in_templatePrevious)
1023
+ : null;
992
1024
  // Validate that the semver change is valid.
993
1025
  switch ((0, semver_1.compare)(version, versionPrevious)) {
994
1026
  case 0:
@@ -1001,10 +1033,11 @@ class TemplateValidator {
1001
1033
  default:
1002
1034
  case -1:
1003
1035
  // previousVersion is greater. Violates rule 3b.
1004
- that._resultBuilder.addError(new Error(MSG.VERSION_REGRESSION_1 + JSON.stringify({
1005
- current: version,
1006
- previous: versionPrevious,
1007
- })));
1036
+ that._resultBuilder.addError(new Error(MSG.VERSION_REGRESSION_1 +
1037
+ JSON.stringify({
1038
+ current: version,
1039
+ previous: versionPrevious,
1040
+ })));
1008
1041
  break;
1009
1042
  }
1010
1043
  return that._resultBuilder.result;