MCPcopy Create free account
hub / github.com/ascorbic/astro-loaders / camelize

Function camelize

packages/csv/src/csv-loader.ts:31–38  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

29}
30
31const camelize = (str: string) =>
32 str
33 .split(/[-_\s]+/)
34 .map(
35 (word, index) =>
36 `${index === 0 ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()}${word.slice(1)}`,
37 )
38 .join("");
39
40/**
41 * Loads entries from a CSV file. The file must contain an array of objects that contain unique `id` fields, or an object with string keys.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected