use
Boolean(process.env.EXPORT_DB)
instead 26 case !!process.env.EXPORT_ALL: {
27 return undefined
28 }
29 case !!process.env.EXPORT_DB: { 30 return {
31 name: 'org-data',
32 }
use
Boolean(process.env.EXPORT_ALL)
instead 23
24const where = (): Prisma.TranslationNamespaceWhereInput | undefined => {
25 switch (true) {
26 case !!process.env.EXPORT_ALL: { 27 return undefined
28 }
29 case !!process.env.EXPORT_DB: {
Description
Prefer using explicit casts by calling Number
, Boolean
, or String
over using operators like +
, !!
or "" +
.
This is considered best practice as it improves readability.
Bad Practice
const b = !!foo;
// The `+` operator does not change the value of its operand
// unless it's already a number.
let n = +foo;
n = 1 * foo;
const s = "" + foo;
Recommended
const b = Boolean(foo);
const n = Number(foo);
const s = String(foo);