@types/getenv
Advanced tools
Comparing version
@@ -8,3 +8,3 @@ // Type definitions for getenv 1.0 | ||
/// <reference types="node" /> | ||
import { UrlWithStringQuery } from 'url'; | ||
import { UrlWithStringQuery } from "url"; | ||
@@ -20,11 +20,11 @@ interface ParseMappings { | ||
type ParseTypes = keyof ParseMappings; | ||
type ParseWithFallback = [string, ParseMappings['string']]; | ||
type ParseWithFallback = [string, ParseMappings["string"]]; | ||
type ParseWithType<T extends ParseTypes> = [string, ParseMappings[T], T]; | ||
type ParseWithEachType = | ||
| ParseWithType<'string'> | ||
| ParseWithType<'int'> | ||
| ParseWithType<'float'> | ||
| ParseWithType<'bool'> | ||
| ParseWithType<'boolish'> | ||
| ParseWithType<'url'>; | ||
| ParseWithType<"string"> | ||
| ParseWithType<"int"> | ||
| ParseWithType<"float"> | ||
| ParseWithType<"bool"> | ||
| ParseWithType<"boolish"> | ||
| ParseWithType<"url">; | ||
@@ -36,4 +36,4 @@ /** | ||
name: string, | ||
fallback?: string | ||
): ParseMappings['string']; | ||
fallback?: string, | ||
): ParseMappings["string"]; | ||
@@ -46,4 +46,4 @@ declare namespace getenv { | ||
name: string, | ||
fallback?: ParseMappings['string'] | ||
): ParseMappings['string']; | ||
fallback?: ParseMappings["string"], | ||
): ParseMappings["string"]; | ||
@@ -55,4 +55,4 @@ /** | ||
name: string, | ||
fallback?: ParseMappings['int'] | ||
): ParseMappings['int']; | ||
fallback?: ParseMappings["int"], | ||
): ParseMappings["int"]; | ||
@@ -64,4 +64,4 @@ /** | ||
name: string, | ||
fallback?: ParseMappings['float'] | ||
): ParseMappings['float']; | ||
fallback?: ParseMappings["float"], | ||
): ParseMappings["float"]; | ||
@@ -73,4 +73,4 @@ /** | ||
name: string, | ||
fallback?: ParseMappings['bool'] | ||
): ParseMappings['bool']; | ||
fallback?: ParseMappings["bool"], | ||
): ParseMappings["bool"]; | ||
@@ -82,4 +82,4 @@ /** | ||
name: string, | ||
fallback?: ParseMappings['boolish'] | ||
): ParseMappings['boolish']; | ||
fallback?: ParseMappings["boolish"], | ||
): ParseMappings["boolish"]; | ||
@@ -91,6 +91,6 @@ /** | ||
*/ | ||
function array<T extends ParseTypes = 'string'>( | ||
function array<T extends ParseTypes = "string">( | ||
name: string, | ||
type?: T, | ||
fallback?: Array<ParseMappings[T]> | ||
fallback?: Array<ParseMappings[T]>, | ||
): Array<ParseMappings[T]>; | ||
@@ -112,9 +112,8 @@ | ||
[k: string]: string | ParseWithFallback | ParseWithEachType; | ||
} | ||
}, | ||
>( | ||
spec: S | ||
spec: S, | ||
): { | ||
[P in keyof S]: S[P][2] extends ParseTypes | ||
? ParseMappings[S[P][2]] | ||
: string | ||
[P in keyof S]: S[P][2] extends ParseTypes ? ParseMappings[S[P][2]] | ||
: string; | ||
}; | ||
@@ -127,4 +126,4 @@ | ||
name: string, | ||
fallback?: ParseMappings['url'] | ||
): ParseMappings['url']; | ||
fallback?: ParseMappings["url"], | ||
): ParseMappings["url"]; | ||
@@ -131,0 +130,0 @@ /** |
{ | ||
"name": "@types/getenv", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "TypeScript definitions for getenv", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/getenv", | ||
"license": "MIT", | ||
@@ -14,3 +15,3 @@ "contributors": [ | ||
"main": "", | ||
"types": "index", | ||
"types": "index.d.ts", | ||
"repository": { | ||
@@ -25,4 +26,4 @@ "type": "git", | ||
}, | ||
"typesPublisherContentHash": "928fba2b5adbd2fc7af3951d7211838d36d9a268d865c75cb7ee5f2f00e4c291", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "9b2e23443e818d3b20fa172e42ebe73e0046af259ed10bcd59f4db95f22ee53a", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/getenv | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/getenv. | ||
Additional Details | ||
* Last updated: Thu, 10 Oct 2019 20:02:20 GMT | ||
* Dependencies: @types/node | ||
### Additional Details | ||
* Last updated: Wed, 20 Sep 2023 17:08:03 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Ivan Pankratov <https://github.com/impankratov>. | ||
These definitions were written by [Ivan Pankratov](https://github.com/impankratov). |
Sorry, the diff of this file is not supported yet
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
6574
1.61%0
-100%131
-0.76%