@js-joda/core 5.5.2 → 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.2
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)
@@ -4610,6 +4610,11 @@ var DateTimeFormatterBuilder = function () {
4610
4610
  this._appendInternalPrinterParser(SettingsParser.LENIENT);
4611
4611
  return this;
4612
4612
  };
4613
+ _proto.parseDefaulting = function parseDefaulting(field, value) {
4614
+ requireNonNull(field);
4615
+ this._appendInternal(new DefaultingParser(field, value));
4616
+ return this;
4617
+ };
4613
4618
  _proto.appendValue = function appendValue() {
4614
4619
  if (arguments.length === 1) {
4615
4620
  return this._appendValue1.apply(this, arguments);
@@ -5251,6 +5256,23 @@ var InstantPrinterParser = function () {
5251
5256
  };
5252
5257
  return InstantPrinterParser;
5253
5258
  }();
5259
+ var DefaultingParser = function () {
5260
+ function DefaultingParser(field, value) {
5261
+ this._field = field;
5262
+ this._value = value;
5263
+ }
5264
+ var _proto3 = DefaultingParser.prototype;
5265
+ _proto3.print = function print() {
5266
+ return true;
5267
+ };
5268
+ _proto3.parse = function parse(context, text, position) {
5269
+ if (context.getParsed(this._field) == null) {
5270
+ context.setParsedField(this._field, this._value, position, position);
5271
+ }
5272
+ return position;
5273
+ };
5274
+ return DefaultingParser;
5275
+ }();
5254
5276
  function _init$e() {
5255
5277
  ReducedPrinterParser.BASE_DATE = LocalDate.of(2000, 1, 1);
5256
5278
  DateTimeFormatterBuilder.CompositePrinterParser = CompositePrinterParser;