Skip to content

Commit

Permalink
Replace lodash imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Oct 22, 2024
1 parent 1a0d006 commit 4ee3d73
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/configs/getAndroidConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = "";
Expand Down
8 changes: 3 additions & 5 deletions src/configs/getWebConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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",
Expand All @@ -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,
},
Expand Down
4 changes: 2 additions & 2 deletions src/transforms/kotlin/svgToDrawable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/transforms/swift/tokenTICamel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand All @@ -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);
Expand Down

0 comments on commit 4ee3d73

Please sign in to comment.