Skip to content

Instantly share code, notes, and snippets.

@subdigital
Created December 1, 2021 21:50
Show Gist options
  • Save subdigital/d5e968e8ef044fa1c88dc23e952dafe9 to your computer and use it in GitHub Desktop.
Save subdigital/d5e968e8ef044fa1c88dc23e952dafe9 to your computer and use it in GitHub Desktop.
Boop script that allows camelCase to work on lines
/**
{
"api": 1,
"name": "Camel Case Lines",
"description": "Camel Case, but for each line",
"author": "Ben Scheirman",
"icon": "tortoise",
"tags": "camelCase"
}
**/
const { camelCase } = require('@boop/lodash.boop')
function camelText(string) {
const strings = string.split(/\s+/);
return strings.map ((s) => camelCase(s)).join("\n")
}
function main(input) {
input.text = camelText(input.text);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment