chrono-node-rs 0.1.0

Behaviour-matched Rust port of chrono-node: natural-language date parsing, checked against chrono-node's own output
Documentation
//! upstream `src/locales/id/index.ts`: the named configurations' slots, in upstream order with
//! their constructor flags. Generated by `harness/onboard/onboard.js` from `tests/golden/configurations.json`; do not
//! edit. The `configurations` test checks them against chrono-node.

use crate::core::configuration::{Configuration, Flags};

/// `id.casual`: upstream's exported `casual`.
pub fn casual() -> Configuration {
    let mut c = Configuration::default();
    c.push_parser("IDRelativeDateFormatParser", Flags::none());
    c.push_parser("IDMonthNameParser", Flags::none());
    c.push_parser("IDCasualTimeParser", Flags::none());
    c.push_parser("IDCasualDateParser", Flags::none());
    c.push_parser("ISOFormatParser", Flags::none());
    c.push_parser("SlashDateFormatParser", Flags::of(&[("littleEndian", true)]));
    c.push_parser("IDMonthNameLittleEndianParser", Flags::none());
    c.push_parser("IDMonthNameMiddleEndianParser", Flags::none());
    c.push_parser("IDWeekdayParser", Flags::none());
    c.push_parser("IDTimeExpressionParser", Flags::of(&[("strictMode", false)]));
    c.push_parser("IDTimeUnitWithinFormatParser", Flags::none());
    c.push_parser("IDTimeUnitAgoFormatParser", Flags::none());
    c.push_parser("IDTimeUnitLaterFormatParser", Flags::none());
    c.push_refiner("OverlapRemovalRefiner", Flags::none());
    c.push_refiner("ExtractTimezoneOffsetRefiner", Flags::none());
    c.push_refiner("MergeWeekdayComponentRefiner", Flags::none());
    c.push_refiner("IDMergeDateTimeRefiner", Flags::none());
    c.push_refiner("IDMergeDateRangeRefiner", Flags::none());
    c.push_refiner("ExtractTimezoneAbbrRefiner", Flags::none());
    c.push_refiner("OverlapRemovalRefiner", Flags::none());
    c.push_refiner("ForwardDateRefiner", Flags::none());
    c.push_refiner("UnlikelyFormatFilter", Flags::of(&[("strictMode", false)]));
    c
}

/// `id.strict`: upstream's exported `strict`.
pub fn strict() -> Configuration {
    let mut c = Configuration::default();
    c.push_parser("ISOFormatParser", Flags::none());
    c.push_parser("SlashDateFormatParser", Flags::of(&[("littleEndian", true)]));
    c.push_parser("IDMonthNameLittleEndianParser", Flags::none());
    c.push_parser("IDMonthNameMiddleEndianParser", Flags::none());
    c.push_parser("IDWeekdayParser", Flags::none());
    c.push_parser("IDTimeExpressionParser", Flags::of(&[("strictMode", true)]));
    c.push_parser("IDTimeUnitWithinFormatParser", Flags::none());
    c.push_parser("IDTimeUnitAgoFormatParser", Flags::none());
    c.push_parser("IDTimeUnitLaterFormatParser", Flags::none());
    c.push_refiner("OverlapRemovalRefiner", Flags::none());
    c.push_refiner("ExtractTimezoneOffsetRefiner", Flags::none());
    c.push_refiner("MergeWeekdayComponentRefiner", Flags::none());
    c.push_refiner("IDMergeDateTimeRefiner", Flags::none());
    c.push_refiner("IDMergeDateRangeRefiner", Flags::none());
    c.push_refiner("ExtractTimezoneAbbrRefiner", Flags::none());
    c.push_refiner("OverlapRemovalRefiner", Flags::none());
    c.push_refiner("ForwardDateRefiner", Flags::none());
    c.push_refiner("UnlikelyFormatFilter", Flags::of(&[("strictMode", true)]));
    c
}