You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
index d4953f2f47b79701e5f125b9c041fb185668dd53..a39a37b30cd206e037ecbbb66bc90dacd6adb3af 100644
3
+
--- a/nullthrows.d.ts
4
+
+++ b/nullthrows.d.ts
5
+
@@ -1,5 +1,15 @@
6
+
/**
7
+
* Throws if value is null or undefined, otherwise returns value.
8
+
*/
9
+
+declare function nullthrows<T>(
10
+
+ value?: T | null,
11
+
+ message?: string,
12
+
+): NonNullable<T>;
13
+
+
14
+
+// Patched based on https://github.com/microsoft/TypeScript/issues/46770#issuecomment-1039459991 and https://github.com/zertosh/nullthrows/pull/15
15
+
+
16
+
+declare namespace nullthrows {
17
+
+ export { nullthrows as default };
18
+
+}
19
+
+export = nullthrows;
20
+
21
+
-export default function nullthrows<T>(value?: T | null, message?: string): T;
Copy file name to clipboardExpand all lines: workspaces/download-leetcode-submissions/README.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ To use:
19
19
nano secrets_DO_NOT_COMMIT_OR_SHARE.json
20
20
```
21
21
22
-
2.**Run the script!**
22
+
2.**Run the script!** You can run a development version:
23
23
24
24
```sh
25
25
# Install dependencies, if you haven't already:
@@ -33,7 +33,26 @@ To use:
33
33
yarn start
34
34
```
35
35
36
-
Submissions will be downloaded to a directory named `submissions`, grouped by problem and problem number range. Filenames take the form `{yyyymmdd-date}-{submission-id}-{result}.{extension}`, resulting in full paths like `submissions/2101-2200/2163-kth-distinct-string-in-an-array/20240805-1345920313-ac.c` for an accepted C solution submitted on August 5th, 2024.
36
+
Or, build and run a distribution version:
37
+
38
+
```sh
39
+
# It's easiest to do this from the package's directory:
40
+
cd workspaces/download-leetcode-submissions
41
+
42
+
# Install dependencies, if you haven't already:
43
+
yarn
44
+
45
+
# Package the script into an executable:
46
+
yarn build
47
+
48
+
# Run it with Node!
49
+
node dist/download-leetcode-submissions.cjs
50
+
51
+
# Or if your system can handle executable files, try running it directly:
52
+
./dist/download-leetcode-submissions.cjs
53
+
```
54
+
55
+
Submissions will be downloaded to a directory named `submissions`, grouped by problem and problem number range. Filenames take the form `{yyyymmdd-date}-{submission-id}-{result}.{extension}`, resulting in full paths like `submissions/2101-2200/2163-kth-distinct-string-in-an-array/20240805-1345920313-ac.c` for an accepted C solution submitted on August 5th, 2024.
37
56
38
57
## Metadata Files
39
58
@@ -79,6 +98,10 @@ As such it's safe to run the script multiple times, without redoing too much wor
79
98
80
99
Like the rest of the [Code Chronicles Leetcode ecosystem](../../), this package is structured as a Node module, using [Yarn](https://yarnpkg.com/) as the package manager.
81
100
82
-
You can install dependencies by running `yarn`, either in this package's directory, or in the repository root. The usual `yarn format`, `yarn lint`, and `yarn typecheck` scripts are available to aid in development and occasionally to annoy.
101
+
You can install dependencies by running `yarn`, either in this package's directory, or in the repository root. The usual `yarn format`, `yarn lint`, and `yarn typecheck` scripts are available to aid in development and occasionally to annoy. Read more in the repository's general [development guide](../../DEVELOPMENT.md).
102
+
103
+
This package supports an additional `package.json` script:
104
+
105
+
### `yarn build`
83
106
84
-
See also the repository's general [development guide](../../DEVELOPMENT.md).
107
+
Builds a distribution version of this package, in a `dist` directory within the package's workspace.
0 commit comments