balderdashy / balderdashy/sails

camelCased helper file names not working

Open
#4,592 7 comments 1 reaction 0 assignees View on GitHub
does this answer your question? orm question
Dominant language
JavaScript
Stars
22.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

**Sails version**:1.1.0
**Node version**:8.12.0
**NPM version**:6.2.0
**DB adapter name**: sails-mongo
**DB adapter version**: 1.0.1
**Operating system**:Windows 10



I created a helper `cleanUserData.js` inside the /api/helpers/ folder but it throws an error - `cleanUserData is not a function` when i try to use the helper function in my UserController.js
I changed the file name to be all lowercased - `cleanuserdata.js` and also changed the name in my `UserController.js` - where i was using it to be all lowercased and it works.

I've tried the same thing with other helpers i created subsequently but camelCased helper file names just don't work

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with /api/helpers/cleanUserData.js and its use in UserController.js, then compare it with the working all-lowercase filename. Trace how Sails discovers and exposes helper files, and verify that a camelCased helper can be called successfully without renaming it.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.