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}` }