Skip to content

Commit

Permalink
feat: date-get-day
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangshanmeta committed Jul 7, 2023
1 parent 4d44ea0 commit 51c54ca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
"types": "./dist/array-index-of.d.ts",
"import": "./dist/array-index-of.mjs",
"default": "./dist/array-index-of.js"
},
"./date-get-day": {
"types": "./dist/date-get-day.d.ts",
"import": "./dist/date-get-day.mjs",
"default": "./dist/date-get-day.js"
}
},
"keywords": [],
Expand Down
3 changes: 3 additions & 0 deletions src/entrypoints/date-get-day.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface Date {
getDay(): 0 | 1 | 2 | 3 | 4 | 5 | 6
}
1 change: 1 addition & 0 deletions src/entrypoints/recommended.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/// <reference path="set-has.d.ts" />
/// <reference path="map-has.d.ts" />
/// <reference path="array-index-of.d.ts" />
/// <reference path="date-get-day.d.ts" />
7 changes: 7 additions & 0 deletions src/tests/date-get-day.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { doNotExecute, Equal, Expect } from "./utils";

doNotExecute(() => {
const result = new Date().getDay();

type tests = [Expect<Equal<typeof result, 0 | 1 | 2 | 3 | 4 | 5 | 6>>];
});

0 comments on commit 51c54ca

Please sign in to comment.