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 Mar 5, 2024
1 parent b2df073 commit dc553b9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion package.json
Expand Up @@ -83,6 +83,11 @@
"types": "./dist/storage.d.ts",
"import": "./dist/storage.mjs",
"default": "./dist/storage.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 All @@ -105,4 +110,4 @@
"tabWidth": 2,
"useTabs": false
}
}
}
3 changes: 3 additions & 0 deletions src/entrypoints/date-get-day.d.ts
@@ -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
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
@@ -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 dc553b9

Please sign in to comment.