CIDARLAB / 3DuF

Either all code paths should have explicit returns, or none of them JS-0045
Anti-pattern
Minor
15 days ago3 years old
Expected to return a value at the end of arrow function
19router.use(express.json());
20
21/** RULES OF OUR API */
22router.use((req, res, next) => {23    // set the CORS policy
24    res.header("Access-Control-Allow-Origin", "*");
25    // set the CORS headers
Expected to return a value at the end of async arrow function
27    return res.send({"x-span":ret.xspan, "y-span":ret.yspan});
28};
29
30const getTerminals = async (req: Request, res: Response, next: NextFunction) => {31    let primitive = req.query.mint;
32    let key = primitive as string;
33    let technology = ComponentAPI.getComponentWithMINT(key);
Expected to return a value at the end of arrow function
43                }
44
45                spec.forEach(item => {
46                    ["min", "max", "units", "value"].forEach(key => {47                        if (!Object.hasOwnProperty.call(item, key)) {
48                            console.error("Missing key " + key + " from item", item);
49                            return "danger";
Expected to return a value at the end of function 'eventMove'
1438            }
1439        }
1440        // Handle movement on document for handle and range drag.
1441        function eventMove(event, data) {1442            // Fix #498
1443            // Check value of .buttons in 'start' to work around a bug in IE10 mobile (data.buttonsProperty).
1444            // https://connect.microsoft.com/IE/feedback/details/927005/mobile-ie10-windows-phone-buttons-property-of-pointermove-event-always-zero
Function expected a return value
1325                e.calcPoint = e.points[options.ort];
1326                // Call the event handler with the event [ and additional data ].
1327                callback(e, data);
1328                return;1329            };
1330            var methods = [];
1331            // Bind a closure on the target for every event type.