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>
37 lines
807 B
TypeScript
37 lines
807 B
TypeScript
declare namespace stripJsonComments {
|
|
interface Options {
|
|
/**
|
|
Replace comments with whitespace instead of stripping them entirely.
|
|
|
|
@default true
|
|
*/
|
|
readonly whitespace?: boolean;
|
|
}
|
|
}
|
|
|
|
/**
|
|
Strip comments from JSON. Lets you use comments in your JSON files!
|
|
|
|
It will replace single-line comments `//` and multi-line comments `/**\/` with whitespace. This allows JSON error positions to remain as close as possible to the original source.
|
|
|
|
@param jsonString - Accepts a string with JSON.
|
|
@returns A JSON string without comments.
|
|
|
|
@example
|
|
```
|
|
const json = `{
|
|
// Rainbows
|
|
"unicorn": "cake"
|
|
}`;
|
|
|
|
JSON.parse(stripJsonComments(json));
|
|
//=> {unicorn: 'cake'}
|
|
```
|
|
*/
|
|
declare function stripJsonComments(
|
|
jsonString: string,
|
|
options?: stripJsonComments.Options
|
|
): string;
|
|
|
|
export = stripJsonComments;
|