MCPcopy Create free account
hub / github.com/CodeForBreakfast/eventsourcing / isNullReturn

Function isNullReturn

packages/eslint-effect/src/rules/utils.js:35–51  ·  view source on GitHub ↗
(arrowFunc)

Source from the content-addressed store, hash-verified

33};
34
35export const isNullReturn = (arrowFunc) => {
36 if (arrowFunc.params.length !== 0) {
37 return false;
38 }
39
40 const body = arrowFunc.body;
41
42 if (body.type === 'Literal' && body.value === null) {
43 return true;
44 }
45
46 if (body.type === 'Identifier' && body.name === 'null') {
47 return true;
48 }
49
50 return false;
51};
52
53export const isUndefinedReturn = (arrowFunc) => {
54 if (arrowFunc.params.length !== 0) {

Callers 1

CallExpressionFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected