From 29c2344622a1be88a1e8618d10bdd5c4a9b03acf Mon Sep 17 00:00:00 2001 From: MillironX <25492070+MillironX@users.noreply.github.com> Date: Tue, 20 Jul 2021 10:30:42 -0500 Subject: [PATCH] Change dash back to underscore --- README.md | 6 +++--- src/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 084b4db..ae054d9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Docker Names -An implementation of [docker-names](https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) in TypeScript. This package unlike the normal docker name generator, generates with a `-` instead of an `_`. +An implementation of [docker-names](https://github.com/moby/moby/blob/master/pkg/namesgenerator/names-generator.go) in TypeScript. ## Usage @@ -29,7 +29,7 @@ console.log(dockerName); //Outputs goofy-panini-4 ``` -## Words +## Words The words can also be imported from the package if need be. @@ -45,4 +45,4 @@ console.log(right) //Outputs [albattani,allen, etc...] -``` \ No newline at end of file +``` diff --git a/src/index.ts b/src/index.ts index 606dd3b..d071d25 100644 --- a/src/index.ts +++ b/src/index.ts @@ -856,7 +856,7 @@ export const right = [ export function generateName(): string { const leftElement = left[Math.floor(Math.random() * left.length)]; const rightElement = right[Math.floor(Math.random() * right.length)]; - return `${leftElement}-${rightElement}` + return `${leftElement}_${rightElement}` } /** @@ -864,5 +864,5 @@ export function generateName(): string { * @returns {string} */ export function generateNameWithNumber() { - return `${generateName()}-${Math.floor(Math.random() * 6) + 1}` + return `${generateName()}_${Math.floor(Math.random() * 6) + 1}` }