@js-joda/core 5.5.3 → 5.6.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.
package/dist/js-joda.js CHANGED
@@ -1,4 +1,4 @@
1
- //! @version @js-joda/core - 5.5.3
1
+ //! @version @js-joda/core - 5.6.1
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)
@@ -4616,6 +4616,11 @@
4616
4616
  this._appendInternalPrinterParser(SettingsParser.LENIENT);
4617
4617
  return this;
4618
4618
  };
4619
+ _proto.parseDefaulting = function parseDefaulting(field, value) {
4620
+ requireNonNull(field);
4621
+ this._appendInternal(new DefaultingParser(field, value));
4622
+ return this;
4623
+ };
4619
4624
  _proto.appendValue = function appendValue() {
4620
4625
  if (arguments.length === 1) {
4621
4626
  return this._appendValue1.apply(this, arguments);
@@ -5257,6 +5262,23 @@
5257
5262
  };
5258
5263
  return InstantPrinterParser;
5259
5264
  }();
5265
+ var DefaultingParser = function () {
5266
+ function DefaultingParser(field, value) {
5267
+ this._field = field;
5268
+ this._value = value;
5269
+ }
5270
+ var _proto3 = DefaultingParser.prototype;
5271
+ _proto3.print = function print() {
5272
+ return true;
5273
+ };
5274
+ _proto3.parse = function parse(context, text, position) {
5275
+ if (context.getParsed(this._field) == null) {
5276
+ context.setParsedField(this._field, this._value, position, position);
5277
+ }
5278
+ return position;
5279
+ };
5280
+ return DefaultingParser;
5281
+ }();
5260
5282
  function _init$e() {
5261
5283
  ReducedPrinterParser.BASE_DATE = LocalDate.of(2000, 1, 1);
5262
5284
  DateTimeFormatterBuilder.CompositePrinterParser = CompositePrinterParser;