@js-joda/core 5.5.3 → 5.6.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,4 +1,4 @@
1
- //! @version @js-joda/core - 5.5.3
1
+ //! @version @js-joda/core - 5.6.0
2
2
  //! @copyright (c) 2015-present, Philipp Thürwächter, Pattrick Hüper & js-joda contributors
3
3
  //! @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
4
4
  //! @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
@@ -4612,6 +4612,11 @@ var DateTimeFormatterBuilder = function () {
4612
4612
  this._appendInternalPrinterParser(SettingsParser.LENIENT);
4613
4613
  return this;
4614
4614
  };
4615
+ _proto.parseDefaulting = function parseDefaulting(field, value) {
4616
+ requireNonNull(field);
4617
+ this._appendInternal(new DefaultingParser(field, value));
4618
+ return this;
4619
+ };
4615
4620
  _proto.appendValue = function appendValue() {
4616
4621
  if (arguments.length === 1) {
4617
4622
  return this._appendValue1.apply(this, arguments);
@@ -5253,6 +5258,23 @@ var InstantPrinterParser = function () {
5253
5258
  };
5254
5259
  return InstantPrinterParser;
5255
5260
  }();
5261
+ var DefaultingParser = function () {
5262
+ function DefaultingParser(field, value) {
5263
+ this._field = field;
5264
+ this._value = value;
5265
+ }
5266
+ var _proto3 = DefaultingParser.prototype;
5267
+ _proto3.print = function print() {
5268
+ return true;
5269
+ };
5270
+ _proto3.parse = function parse(context, text, position) {
5271
+ if (context.getParsed(this._field) == null) {
5272
+ context.setParsedField(this._field, this._value, position, position);
5273
+ }
5274
+ return position;
5275
+ };
5276
+ return DefaultingParser;
5277
+ }();
5256
5278
  function _init$e() {
5257
5279
  ReducedPrinterParser.BASE_DATE = LocalDate.of(2000, 1, 1);
5258
5280
  DateTimeFormatterBuilder.CompositePrinterParser = CompositePrinterParser;