1
0
Fork 0
mirror of https://github.com/MillironX/docker-names.git synced 2024-12-22 09:58:16 +00:00

Change dash back to underscore

This commit is contained in:
MillironX 2021-07-20 10:30:42 -05:00
parent fa5c207540
commit 29c2344622
Signed by: millironx
GPG key ID: 139C07724802BC5D
2 changed files with 5 additions and 5 deletions

View file

@ -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...]
```
```

View file

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