diff --git a/src/configs/getAndroidConfig.ts b/src/configs/getAndroidConfig.ts index bfd1db75..afc78460 100644 --- a/src/configs/getAndroidConfig.ts +++ b/src/configs/getAndroidConfig.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import _ from "lodash-es"; +import { camelCase, upperFirst } from "lodash-es"; import StyleDictionary from "style-dictionary"; import type { FormatFnArguments, @@ -123,7 +123,7 @@ export function getAndroidConfig(theme: Theme): PlatformConfig { name: "compose/icons", format: composeIcons, }); - const className = _.upperFirst(_.camelCase(theme)); + const className = upperFirst(camelCase(theme)); let valName = ""; let themeName = ""; let tokenClassName = ""; diff --git a/src/configs/getWebConfig.ts b/src/configs/getWebConfig.ts index 43964c64..245c0255 100644 --- a/src/configs/getWebConfig.ts +++ b/src/configs/getWebConfig.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import _ from "lodash-es"; +import { camelCase } from "lodash-es"; import type { File, PlatformConfig } from "style-dictionary/types"; import type { Theme } from "../@types"; import { isCoreColor } from "../filters/isCoreColor"; @@ -63,7 +63,7 @@ function getFilesFormat(theme: Theme, target: "css" | "js" | "ts"): File[] { if (target === "ts") { return [ { - destination: `${_.camelCase( + destination: `${camelCase( `${COMPOUND_TOKENS_NAMESPACE}.${theme}`, )}.d.ts`, format: "typescript/es6-declarations", @@ -74,9 +74,7 @@ function getFilesFormat(theme: Theme, target: "css" | "js" | "ts"): File[] { if (target === "js") { return [ { - destination: `${_.camelCase( - `${COMPOUND_TOKENS_NAMESPACE}.${theme}`, - )}.js`, + destination: `${camelCase(`${COMPOUND_TOKENS_NAMESPACE}.${theme}`)}.js`, format: "javascript/es6", options, }, diff --git a/src/transforms/kotlin/svgToDrawable.ts b/src/transforms/kotlin/svgToDrawable.ts index 29dc8a1e..102df257 100644 --- a/src/transforms/kotlin/svgToDrawable.ts +++ b/src/transforms/kotlin/svgToDrawable.ts @@ -17,7 +17,7 @@ limitations under the License. import path from "node:path"; import { fileURLToPath } from "node:url"; import fs from "fs-extra"; -import _ from "lodash-es"; +import { snakeCase } from "lodash-es"; import type { Transform } from "style-dictionary/types"; import svg2vectordrawable from "svg2vectordrawable"; @@ -38,7 +38,7 @@ export default { // Snake case and replace `icon` with `ic` as this is the convention on Android // and on Material - const imageId = _.snakeCase(token.name.replace("icon", "ic_compound_")); + const imageId = snakeCase(token.name.replace("icon", "ic_compound_")); const options = { fillBlack: true, // Add black color to path element, defaults to false diff --git a/src/transforms/swift/tokenTICamel.ts b/src/transforms/swift/tokenTICamel.ts index 73e8b309..02a1c40a 100644 --- a/src/transforms/swift/tokenTICamel.ts +++ b/src/transforms/swift/tokenTICamel.ts @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import _ from "lodash-es"; +import { camelCase } from "lodash-es"; import type { Transform } from "style-dictionary/types"; /** @@ -30,7 +30,7 @@ export default { if (options?.prefix) { prefix = options.prefix; } - const name = _.camelCase( + const name = camelCase( [prefix].concat(token.path.slice(1, token.path.length)).join(" "), ); return escapeName(name);