diff --git a/package-lock.json b/package-lock.json index d5849a8..525e41d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "svg-to-ts", - "version": "1.0.1", + "version": "1.1.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -6247,11 +6247,6 @@ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, - "lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" - }, "lodash.capitalize": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/lodash.capitalize/-/lodash.capitalize-4.2.1.tgz", @@ -6300,6 +6295,11 @@ "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=", "dev": true }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=" + }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", diff --git a/package.json b/package.json index b148444..e5c5944 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "dependencies": { "chalk": "^3.0.0", "commander": "^4.0.1", - "lodash.camelcase": "^4.3.0", + "lodash.snakecase": "^4.1.1", "prettier": "^1.19.1", "svgo": "^1.3.2" }, diff --git a/src/lib/convert.ts b/src/lib/convert.ts index f81a448..40080f3 100644 --- a/src/lib/convert.ts +++ b/src/lib/convert.ts @@ -1,6 +1,6 @@ import { svgo } from './svgo'; import { getInterfaceDefinition, getSvgConstant, getTypeDefinition } from './definitions'; -import camelCase from 'lodash.camelcase'; +import snakeCase from 'lodash.snakecase'; import * as prettier from 'prettier/standalone'; import chalk from 'chalk'; import typescriptParser from 'prettier/parser-typescript'; @@ -31,7 +31,7 @@ export const convert = async (convertionOptions: ConvertionOptions): Promise { - return `${convertionOptions.prefix}${capitalize(camelCase(filenameWithoutEnding))}`; + return `${convertionOptions.prefix}${capitalize(filenameWithoutEnding)}`; }; const extractSvgContent = async (fileName: string, directoryPath: string): Promise => { diff --git a/src/lib/definitions.ts b/src/lib/definitions.ts index a6f2ad4..e647629 100644 --- a/src/lib/definitions.ts +++ b/src/lib/definitions.ts @@ -1,5 +1,3 @@ -import { ConvertionOptions } from './convert'; - export const getInterfaceDefinition = (interfaceName: string, typeName: string) => { return `export interface ${interfaceName}{ name: ${typeName};