Skip to content

Commit

Permalink
🤖 Merge PR #56224 Add uuid-to-hex typings by @pmqueiroz
Browse files Browse the repository at this point in the history
* Add uuid-to-hex typings

* fix: function name

* fix: typo on dt header

* fix: prevent external dependency use
  • Loading branch information
pmqueiroz committed Oct 6, 2021
1 parent 2a98e11 commit 6586374
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
12 changes: 12 additions & 0 deletions types/uuid-to-hex/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Type definitions for uuid-to-hex 1.1
// Project: https://github.com/DeRain/uuid-to-hex
// Definitions by: Pedro Queiroz <https://github.com/pmqueiroz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/**
* Convert UUID string to hex string.
* @param uuidString The input uuid.
* @param addLeadingZero Identifies if you want the leading zero on return.
*/
declare function uuidToHex(uuidString: string, addLeadingZero?: boolean): string;
export = uuidToHex;
23 changes: 23 additions & 0 deletions types/uuid-to-hex/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"uuid-to-hex-tests.ts"
]
}
1 change: 1 addition & 0 deletions types/uuid-to-hex/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
10 changes: 10 additions & 0 deletions types/uuid-to-hex/uuid-to-hex-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import uuidToHex = require('uuid-to-hex');

// $ExpectType string
uuidToHex('d3fd3540-6718-4687-956b-c8618a26e335');

// $ExpectType string
uuidToHex('d3fd3540-6718-4687-956b-c8618a26e335', true);

// $ExpectError
uuidToHex();

0 comments on commit 6586374

Please sign in to comment.