Skip to content

Commit

Permalink
V3 (#4)
Browse files Browse the repository at this point in the history
* new upadtes

* Finish v3
Co-authored-by: RedGuy12 <[email protected]>

* docs oof

Co-authored-by: RedGuy12 <[email protected]>

* dangit
version bump

Co-authored-by: RedGuy12 <[email protected]>

Co-authored-by: RedGuy12 <[email protected]>
  • Loading branch information
retronbv and cobaltt7 authored Aug 4, 2021
1 parent 4ccf26f commit dc94efe
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
.replit
.replit

node_modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
A short unique id.

```js
import { generate } from './index.js'
import generate from './index.js'

console.log(generate())
```
7 changes: 7 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//YAY TYPES

declare module "retronid" {
export = generate
export function generate(): string;

}
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { v5 } from 'uuid';
export generate() => {
uuid = v5(Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5), "1e230887-bf0e-477d-9f68-a2c27edcbdf6")
id = `${uuid.split("-")[0]}${uuid.substr(uuid.length - 2)}`
return id
}

export function generate() {
const uuid = v5(Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 5), "1e230887-bf0e-477d-9f68-a2c27edcbdf6")
return `${uuid.split("-")[0]}${uuid.substr(uuid.length - 2)}`
}

export default generate
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "retronid",
"version": "2.0.0",
"version": "3.0.0",
"description": "A short unique id.",
"main": "index.js",
"types": "index.d.ts",
"type": "module",
"scripts": {
"test": "node test.js",
Expand Down

0 comments on commit dc94efe

Please sign in to comment.