gatsby-source-google-sheets icon indicating copy to clipboard operation
gatsby-source-google-sheets copied to clipboard

Camel Case not working on normal strings "User email"

Open tbaustin opened this issue 6 years ago • 2 comments

I think you stated this in the readme, maybe instead of lodash you could use the camelcase npm module https://www.npmjs.com/package/camelcase. I think it works on normal strings just fine and many others. It is actually what I use for my gatsby plugins to camelcase data before putting it into graphql.

const camelCase = require('camelcase');
type: camelCase(`googleSheet ${worksheetTitle} row`),

That should make strings like "User email" into userEmail.

tbaustin avatar May 23 '18 13:05 tbaustin

Thanks, i'll take a look!

Lodash should work fine on simple space delineated strings (see repl example here).

I can't remember exactly, but I think part of the problem is how google sheets handles spaces in column names. e.g., it might just strip them out with no indication as to where the spaces were.

Whatever the root cause, though, it's definitely a problem, so I'll keep this open to track it

brandonmp avatar May 31 '18 13:05 brandonmp

Awesome let me know if there is anything I can do to help!

tbaustin avatar May 31 '18 14:05 tbaustin