Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/better-sqlite3/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/better-sqlite3",
"version": "7.6.9999",
"version": "9.6.9999",
"projects": [
"https://github.com/JoshuaWise/better-sqlite3"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CodeMirror from "codemirror";
import "codemirror/addon/mode/loadMode";
import "codemirror/addon/mode/loadmode";

CodeMirror.requireMode("javascript", () => {
console.log("loaded");
Expand Down
2 changes: 1 addition & 1 deletion types/codemirror/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test/addon/lint/lint.ts",
"test/addon/lint/yaml-lint.ts",
"test/addon/merge/merge.ts",
"test/addon/mode/loadMode.ts",
"test/addon/mode/loadmode.ts",
"test/addon/mode/multiplex.ts",
"test/addon/mode/overlay.ts",
"test/addon/mode/simple.ts",
Expand Down
2 changes: 1 addition & 1 deletion types/luxon/src/datetime.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ export class DateTime<IsValid extends boolean = DefaultValidity> {
*
* @param o
*/
static isDateTime(o: unknown): o is DateTimeMaybeValid;
static isDateTime(o: unknown): o is DateTime;

/**
* Produce the format string for a set of options
Expand Down
24 changes: 20 additions & 4 deletions types/luxon/test/luxon-tests.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,25 @@ DateTime.min(now, now); // $ExpectType DateTime<true>
DateTime.min(...[dt, now].filter(date => date)); // $ExpectType DateTime<true> | DateTime<false> | undefined
DateTime.min(); // $ExpectType undefined

const anything: unknown = 0;
if (DateTime.isDateTime(anything)) {
anything; // $ExpectType DateTime<true> | DateTime<false>
// DateTime.isDateTime guard check
function isDateTimeCheck(case1: DateTime | string, case2: DateTime<true> | number, case3: DateTime<false> | boolean) {
if (DateTime.isDateTime(case1)) {
case1; // $ExpectType DateTime<boolean>
} else {
case1; // $ExpectType string
}

if (DateTime.isDateTime(case2)) {
case2; // $ExpectType DateTime<true>
} else {
case2; // $ExpectType number
}

if (DateTime.isDateTime(case3)) {
case3; // $ExpectType DateTime<false>
} else {
case3; // $ExpectType boolean
}
}

const { input, result, zone } = DateTime.fromFormatExplain("Aug 6 1982", "MMMM d yyyy");
Expand Down Expand Up @@ -349,7 +365,7 @@ dur.toFormat("", {
floor: true,
signMode: "negativeLargestOnly",
});

const anything: unknown = 0;
if (Duration.isDuration(anything)) {
anything; // $ExpectType Duration<true> | Duration<false>
}
Expand Down