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
- Favor using real paths (`../lib/schemas.ts`) over aliases (`@/app/lib/schemas`).
12
13
- Favor `for (const comment of comments) {` over `comments.forEach((comment) => {`
13
14
- Favor named exports over default exports, with the exception of Next.js pages
14
-
- Do not wrap each function body and function call in `try`/`catch` blocks. It pollutes the code. Assume we will always have an e.g. `main().catch((err) => { console.error(err); process.exit(1) })` to catch us. I repeat: Avoid over-use of try-catch such as `try { // foo } catch (err) { console.error('error while foo'); throw err }`, assume we catch errors on a higher level and do not need the extra explananation.
15
-
- Before creating new files and new code, see if we can leverage existing work, maybe slighty adapt that without breaking BC, to keep things DRY.
16
-
- Favor early exits, so quickly `continue`, `return false` (or `throw` if needed), over nesting everything in positive conditions, creating christmas trees.
15
+
- Do not wrap each function body and function call in `try`/`catch` blocks. It pollutes the code.
16
+
Assume we will always have an e.g.
17
+
`main().catch((err) => { console.error(err); process.exit(1) })` to catch us. I repeat: Avoid
18
+
over-use of try-catch such as
19
+
`try { // foo } catch (err) { console.error('error while foo'); throw err }`, assume we catch
20
+
errors on a higher level and do not need the extra explananation.
21
+
- If you must use try/catch, for simple cases, favor `alphalib/tryCatch.ts`
22
+
(`const [err, data] = await tryCatch(promise)`) over
Copy file name to clipboardExpand all lines: src/alphalib/types/robots/file-decompress.ts
-9Lines changed: 0 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -87,15 +87,6 @@ A possible array member is only \`"meta"\`.
87
87
You might see an error when trying to extract metadata from the files inside your archive. This happens, for example, for files with a size of zero bytes. Setting this to \`true\` will cause the <dfn>Robot</dfn> to not stop the file decompression (and the entire <dfn>Assembly</dfn>) when that happens.
88
88
89
89
To keep backwards compatibility, setting this parameter to \`true\` will set it to \`["meta"]\` internally.
90
-
`),
91
-
stack: z
92
-
.enum(['v1','v2'])
93
-
.default('v1')
94
-
.describe(`
95
-
Temporary parameter for backwards compatibility while we roll out new underlying tooling for the robot.
96
-
97
-
- \`v1\` uses the old decompression.
98
-
- \`v2\` uses the new decompression with better support for unicode and nested archives.
Copy file name to clipboardExpand all lines: src/alphalib/types/robots/image-resize.ts
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -416,6 +416,14 @@ Increases or decreases the saturation of the image by using a multiplier. For ex
416
416
.default(100)
417
417
.describe(`
418
418
Changes the hue by rotating the color of the image. The value \`100\` would produce no change whereas \`0\` and \`200\` will negate the colors in the image.
419
+
`),
420
+
contrast: z
421
+
.number()
422
+
.min(0)
423
+
.max(2)
424
+
.default(1)
425
+
.describe(`
426
+
Adjusts the contrast of the image. A value of \`1\` produces no change. Values below \`1\` decrease contrast (with \`0\` being minimum contrast), and values above \`1\` increase contrast (with \`2\` being maximum contrast). This works like the \`brightness\` parameter.
0 commit comments