Adjust European short trip heuristic from >3 days to >1 day to correctly detect when user has returned home from European trips. This fixes the April 29-30, 2023 case where the location incorrectly showed "Sankt Georg, Hamburg" instead of "Bristol" when the user was free (no events scheduled) after the foss-north trip ended on April 27. The previous logic required more than 3 days to pass before assuming return home from European countries, but for short European trips by rail/ferry, users typically return within 1-2 days. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
32 lines
985 B
JavaScript
32 lines
985 B
JavaScript
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const keywords_1 = __importDefault(require("./keywords"));
|
|
const ajvKeywords = (ajv, keyword) => {
|
|
if (Array.isArray(keyword)) {
|
|
for (const k of keyword)
|
|
get(k)(ajv);
|
|
return ajv;
|
|
}
|
|
if (keyword) {
|
|
get(keyword)(ajv);
|
|
return ajv;
|
|
}
|
|
for (keyword in keywords_1.default)
|
|
get(keyword)(ajv);
|
|
return ajv;
|
|
};
|
|
ajvKeywords.get = get;
|
|
function get(keyword) {
|
|
const defFunc = keywords_1.default[keyword];
|
|
if (!defFunc)
|
|
throw new Error("Unknown keyword " + keyword);
|
|
return defFunc;
|
|
}
|
|
exports.default = ajvKeywords;
|
|
module.exports = ajvKeywords;
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
module.exports.default = ajvKeywords;
|
|
//# sourceMappingURL=index.js.map
|