chrono-node
Advanced tools
Comparing version 2.6.0 to 2.6.1
@@ -29,3 +29,3 @@ "use strict"; | ||
const references = __importStar(require("../../../common/casualReferences")); | ||
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night|(?<!\d\s*)day\s*after\s*tomorrow|(?<!\d\s*)day\s*before\s*yesterday)(?=\W|$)/i; | ||
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i; | ||
class ENCasualDateParser extends AbstractParserWithWordBoundary_1.AbstractParserWithWordBoundaryChecking { | ||
@@ -60,8 +60,2 @@ innerPattern(context) { | ||
} | ||
if (lowerText.match(/after\s*tomorrow/)) { | ||
return references.theDayAfter(context.reference, 2); | ||
} | ||
if (lowerText.match(/before\s*yesterday/)) { | ||
return references.theDayBefore(context.reference, 2); | ||
} | ||
break; | ||
@@ -68,0 +62,0 @@ } |
@@ -5,3 +5,3 @@ import dayjs from "dayjs"; | ||
import * as references from "../../../common/casualReferences.js"; | ||
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night|(?<!\d\s*)day\s*after\s*tomorrow|(?<!\d\s*)day\s*before\s*yesterday)(?=\W|$)/i; | ||
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i; | ||
export default class ENCasualDateParser extends AbstractParserWithWordBoundaryChecking { | ||
@@ -36,8 +36,2 @@ innerPattern(context) { | ||
} | ||
if (lowerText.match(/after\s*tomorrow/)) { | ||
return references.theDayAfter(context.reference, 2); | ||
} | ||
if (lowerText.match(/before\s*yesterday/)) { | ||
return references.theDayBefore(context.reference, 2); | ||
} | ||
break; | ||
@@ -44,0 +38,0 @@ } |
@@ -18,3 +18,3 @@ { | ||
"license": "MIT", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"directories": { | ||
@@ -21,0 +21,0 @@ "source": "./src", |
@@ -8,4 +8,3 @@ import { ParsingContext } from "../../../chrono"; | ||
const PATTERN = | ||
/(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night|(?<!\d\s*)day\s*after\s*tomorrow|(?<!\d\s*)day\s*before\s*yesterday)(?=\W|$)/i; | ||
const PATTERN = /(now|today|tonight|tomorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i; | ||
@@ -49,11 +48,2 @@ export default class ENCasualDateParser extends AbstractParserWithWordBoundaryChecking { | ||
} | ||
if (lowerText.match(/after\s*tomorrow/)) { | ||
return references.theDayAfter(context.reference, 2); | ||
} | ||
if (lowerText.match(/before\s*yesterday/)) { | ||
return references.theDayBefore(context.reference, 2); | ||
} | ||
break; | ||
@@ -60,0 +50,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2302705
40560