Skip to content

Commit

Permalink
fix(deps): remove lodash-es dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
leon19 committed Mar 22, 2024
1 parent 49e163f commit 788465c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"npm": ">=10"
},
"dependencies": {
"lodash-es": "^4.17.21",
"yeoman-generator": "^7.1.1"
},
"devDependencies": {
Expand All @@ -28,7 +27,6 @@
"@commitlint/config-conventional": "^19.1.0",
"@faker-js/faker": "^8.4.1",
"@types/chai": "^4.3.14",
"@types/lodash-es": "^4.17.12",
"@types/mocha": "^10.0.6",
"@types/node": "*",
"@types/yeoman-assert": "^3.1.4",
Expand Down
5 changes: 4 additions & 1 deletion src/generators/app/Prompter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { isString } from 'lodash-es';
import type Generator from 'yeoman-generator';

export class Prompter {
Expand Down Expand Up @@ -51,3 +50,7 @@ export class Prompter {
return isString(authorEmail) ? authorEmail.trim() : '';
}
}

function isString(value: unknown): value is string {
return typeof value === 'string';
}
8 changes: 7 additions & 1 deletion src/generators/app/TsNodeStarterApp.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { mkdtempSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { kebabCase } from 'lodash-es';
import Generator from 'yeoman-generator';
import { Prompter } from './Prompter.js';
import type { Cli, CliArguments, CliOptions } from './cli.js';
Expand Down Expand Up @@ -153,3 +152,10 @@ function green(text: string): string {
function white(text: string): string {
return `\u001b[37m${text}\u001b[39m`;
}

function kebabCase(value: string): string {
return value
.replace(/\s+/, '-')
.replace(/([a-z])([A-Z])/g, '$1-$2')
.toLowerCase();
}

0 comments on commit 788465c

Please sign in to comment.