refactor method names
This commit is contained in:
		
							
								
								
									
										6
									
								
								dist/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								dist/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @@ -1,9 +1,9 @@ | ||||
| /** | ||||
|  * returns short strings that are unique to very high degree od certainty | ||||
|  */ | ||||
| export declare let getShortId: () => string; | ||||
| export declare let shortId: () => string; | ||||
| /** | ||||
|  * returns strings that are unique to a very high degree of certainty | ||||
|  */ | ||||
| export declare let getUuidv4: () => string; | ||||
| export declare let getUuidv5: (customStringArg: string, namespaceArg?: any) => string; | ||||
| export declare let uuid4: () => string; | ||||
| export declare let uuid5: (customStringArg: string, namespaceArg?: any) => string; | ||||
|   | ||||
							
								
								
									
										8
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @@ -4,16 +4,16 @@ const plugins = require("./smartunique.plugins"); | ||||
| /** | ||||
|  * returns short strings that are unique to very high degree od certainty | ||||
|  */ | ||||
| exports.getShortId = () => { | ||||
| exports.shortId = () => { | ||||
|     return plugins.shortid.generate(); | ||||
| }; | ||||
| /** | ||||
|  * returns strings that are unique to a very high degree of certainty | ||||
|  */ | ||||
| exports.getUuidv4 = () => { | ||||
| exports.uuid4 = () => { | ||||
|     return plugins.uuidv4(); | ||||
| }; | ||||
| exports.getUuidv5 = (customStringArg, namespaceArg = plugins.uuidv5.DNS) => { | ||||
| exports.uuid5 = (customStringArg, namespaceArg = plugins.uuidv5.DNS) => { | ||||
|     return plugins.uuidv5(customStringArg, namespaceArg); | ||||
| }; | ||||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLGlEQUFnRDtBQUVoRDs7R0FFRzt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sQ0FBQyxDQUFBIn0= | ||||
							
								
								
									
										45
									
								
								docs/index.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								docs/index.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,45 @@ | ||||
| # smartunique | ||||
| make things unique | ||||
|  | ||||
| ## Availabililty | ||||
| [](https://www.npmjs.com/package/smartunique) | ||||
| [](https://GitLab.com/pushrocks/smartunique) | ||||
| [](https://github.com/pushrocks/smartunique) | ||||
| [](https://pushrocks.gitlab.io/smartunique/) | ||||
|  | ||||
| ## Status for master | ||||
| [](https://GitLab.com/pushrocks/smartunique/commits/master) | ||||
| [](https://GitLab.com/pushrocks/smartunique/commits/master) | ||||
| [](https://www.npmjs.com/package/smartunique) | ||||
| [](https://david-dm.org/pushrocks/smartunique) | ||||
| [](https://www.bithound.io/github/pushrocks/smartunique/master/dependencies/npm) | ||||
| [](https://www.bithound.io/github/pushrocks/smartunique) | ||||
| [](https://nodejs.org/dist/latest-v6.x/docs/api/) | ||||
| [](https://nodejs.org/dist/latest-v6.x/docs/api/) | ||||
| [](http://standardjs.com/) | ||||
|  | ||||
| ## Usage | ||||
| Use TypeScript for best in class instellisense. | ||||
|  | ||||
| ```javascript | ||||
| // We are using TypeScript syntax here to have types in place | ||||
| import * as smartunique from 'smartunique' | ||||
|  | ||||
| // creates a short mathematically highly unique short string | ||||
| let myShortid = smartunique.shortid() | ||||
|  | ||||
| // creates a string that is possibly unique world wide | ||||
| let myUuid4 = smartunique.uuid4() | ||||
|  | ||||
| // creates a oneway repeatable unique id within a certain namespace | ||||
| let myUuid5 = smartunique.uuid('myobscureduser@somedomain.com', smartunique.uuid4()) | ||||
| ``` | ||||
|  | ||||
| Learn more about UUIDs: knowledgebase.gitzone.com/uuid.html | ||||
|  | ||||
| For further information read the linked docs at the top of this README. | ||||
|  | ||||
| > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) | ||||
| | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html) | ||||
|  | ||||
| [](https://push.rocks) | ||||
							
								
								
									
										13
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								package.json
									
									
									
									
									
								
							| @@ -9,6 +9,19 @@ | ||||
|   "scripts": { | ||||
|     "test": "(npmts)" | ||||
|   }, | ||||
|   "repository": { | ||||
|     "type": "git", | ||||
|     "url": "https://gitlab.com/pushrocks/smartunique.git" | ||||
|   }, | ||||
|   "keywords": [ | ||||
|     "unique", | ||||
|     "key", | ||||
|     "uuid", | ||||
|     "shortid", | ||||
|     "lossless", | ||||
|     "pushrocks", | ||||
|     "TypeScript" | ||||
|   ], | ||||
|   "devDependencies": { | ||||
|     "tapbundle": "^1.0.13" | ||||
|   }, | ||||
|   | ||||
							
								
								
									
										11
									
								
								test/test.ts
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								test/test.ts
									
									
									
									
									
								
							| @@ -2,17 +2,22 @@ import { expect, tap } from 'tapbundle' | ||||
| import * as smartunique from '../dist/index' | ||||
|  | ||||
| tap.test('should create shortid', async () => { | ||||
|   let result = smartunique.getShortId() | ||||
|   let result = smartunique.shortId() | ||||
|   console.log(result) | ||||
| }) | ||||
|  | ||||
| tap.test('should create uuidv4', async () => { | ||||
|   let result = smartunique.getUuidv4() | ||||
|   let result = smartunique.uuid4() | ||||
|   console.log(result) | ||||
| }) | ||||
|  | ||||
| tap.test('should create uuidv5', async () => { | ||||
|   let result = smartunique.getUuidv5('sometext') | ||||
|   let result = smartunique.uuid5('sometext') | ||||
|   console.log(result) | ||||
| }) | ||||
|  | ||||
| tap.test('should create uuidv5 within namespace', async () => { | ||||
|   let result = smartunique.uuid5('sometext', smartunique.uuid4()) | ||||
|   console.log(result) | ||||
| }) | ||||
|  | ||||
|   | ||||
| @@ -3,17 +3,17 @@ import * as plugins from './smartunique.plugins' | ||||
| /** | ||||
|  * returns short strings that are unique to very high degree od certainty | ||||
|  */ | ||||
| export let getShortId = (): string => { | ||||
| export let shortId = (): string => { | ||||
|   return plugins.shortid.generate() | ||||
| } | ||||
|  | ||||
| /** | ||||
|  * returns strings that are unique to a very high degree of certainty | ||||
|  */ | ||||
| export let getUuidv4 = (): string => { | ||||
| export let uuid4 = (): string => { | ||||
|   return plugins.uuidv4() | ||||
| } | ||||
|  | ||||
| export let getUuidv5 = (customStringArg: string, namespaceArg = plugins.uuidv5.DNS): string => { | ||||
| export let uuid5 = (customStringArg: string, namespaceArg = plugins.uuidv5.DNS): string => { | ||||
|   return plugins.uuidv5(customStringArg, namespaceArg) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user