Documentation comment not found for arrow function attrSuppDataMiddleware
67const processData = (data: z.infer<typeof NullableJsonValue> | undefined, action: Prisma.PrismaAction) =>
68 actions.read.includes(action) ? processRead(data) : processWrite(data)
69
70export const attrSuppDataMiddleware: Prisma.Middleware = async (params, next) => { 71 const start = Date.now()
72 if (params.model === 'AttributeSupplement') {
73 const { args, action } = params
Documentation comment not found for arrow function processData
64 return superjson.serialize(data) as unknown as z.infer<typeof NullableJsonValue>
65}
66
67const processData = (data: z.infer<typeof NullableJsonValue> | undefined, action: Prisma.PrismaAction) => 68 actions.read.includes(action) ? processRead(data) : processWrite(data)
69
70export const attrSuppDataMiddleware: Prisma.Middleware = async (params, next) => {
Documentation comment not found for arrow function processWrite
57 }
58 return superjson.parse(JSON.stringify(data))
59}
60const processWrite = (data?: z.infer<typeof NullableJsonValue>) => { 61 if (data === Prisma.DbNull || data === Prisma.JsonNull) {
62 return data
63 }
Documentation comment not found for arrow function processRead
51const hasSuppDataArr = (result: unknown): result is Results[] =>
52 ResultSchema.array().safeParse(result).success
53
54const processRead = (data?: z.infer<typeof NullableJsonValue>) => { 55 if (isSuperJSON(data)) {
56 return superjson.deserialize(data)
57 }
Documentation comment not found for arrow function hasSuppDataArr
48const isSuppArgs = (args: unknown): args is ArgsRecord => ArgsSchema.safeParse(args).success
49const isSuppArgsArr = (args: unknown): args is ArgsRecordArr => ArgsSchemaArr.safeParse(args).success
50const hasSuppData = (result: unknown): result is Results => ResultSchema.safeParse(result).success
51const hasSuppDataArr = (result: unknown): result is Results[] => 52 ResultSchema.array().safeParse(result).success
53
54const processRead = (data?: z.infer<typeof NullableJsonValue>) => {
Documentation comment not found for arrow function hasSuppData
47// AttributeSupplementSchema.safeParse(data).success
48const isSuppArgs = (args: unknown): args is ArgsRecord => ArgsSchema.safeParse(args).success
49const isSuppArgsArr = (args: unknown): args is ArgsRecordArr => ArgsSchemaArr.safeParse(args).success
50const hasSuppData = (result: unknown): result is Results => ResultSchema.safeParse(result).success 51const hasSuppDataArr = (result: unknown): result is Results[] =>
52 ResultSchema.array().safeParse(result).success
53
Documentation comment not found for arrow function isSuperJSON
40 [k in ActionKeys]: Prisma.PrismaAction[]
41}
42
43const isSuperJSON = (data: unknown): data is SuperJSONResult => 44 typeof data === 'object' && data !== null && Object.hasOwn(data, 'json')
45
46// const isSuppRecord = (data: unknown): data is z.infer<typeof AttributeSupplementSchema> =>
Documentation comment not found for arrow function isSuppArgsArr
46// const isSuppRecord = (data: unknown): data is z.infer<typeof AttributeSupplementSchema> =>
47// AttributeSupplementSchema.safeParse(data).success
48const isSuppArgs = (args: unknown): args is ArgsRecord => ArgsSchema.safeParse(args).success
49const isSuppArgsArr = (args: unknown): args is ArgsRecordArr => ArgsSchemaArr.safeParse(args).success 50const hasSuppData = (result: unknown): result is Results => ResultSchema.safeParse(result).success
51const hasSuppDataArr = (result: unknown): result is Results[] =>
52 ResultSchema.array().safeParse(result).success
Description
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
Bad Practice
function sum(a, b) {
return a + b;
}
Recommended
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}