Skip to content

Commit f9f3649

Browse files
committed
Trivial readme change
1 parent a26f8c2 commit f9f3649

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ This library aims to allow you to define environment variables in a more type-sa
1212
example:
1313

1414
```ts
15-
const environment = process.env.ENVIRONMENT;
15+
const environment = process.env.ENVIRONMENT
1616

1717
const makePayment = (amount: bigint) => {
1818
if (environment === 'prod') {
19-
makeRealPayment(amount);
19+
makeRealPayment(amount)
2020
} else {
21-
makeMockPayment(amount);
21+
makeMockPayment(amount)
2222
}
23-
};
23+
}
2424
```
2525

2626
What if you configured your server with `ENVIRONMENT=production` instead of `ENVIRONMENT=prod`?
@@ -31,30 +31,30 @@ If you'd used TypedEnv instead, you'd get this
3131

3232
```ts
3333
const env = TypedEnv({
34-
ENVIRONMENT: EnumVar({options: ['dev', 'staging', 'production']}),
35-
});
34+
ENVIRONMENT: EnumVar({ options: ['dev', 'staging', 'production'] }),
35+
})
3636

3737
const makePayment = (amount: bigint) => {
3838
if (env.ENVIRONMENT === 'prod') {
3939
// TypeError!
4040
// `This condition will always return 'false' since
4141
// the types '"dev" | "staging" | "production"' and
4242
// '"prod"' have no overlap.`
43-
return makeRealPayment(amount);
43+
return makeRealPayment(amount)
4444
} else {
45-
return makeFakePayment(amount);
45+
return makeFakePayment(amount)
4646
}
47-
};
47+
}
4848
```
4949

5050
## What types are supported?
5151

52-
Currently, strings, integers, and enums are supported, although you can define your own custom type
52+
Currently, strings, enums, integers, and dates are supported, although you can define your own custom type
5353
using the `Declaration<T>` type
5454

5555
```ts
5656
export type Declaration<T> = {
57-
variable?: string; // The name of the environment variable; defaults to match the key if not specified
58-
parser: Parser<T>; // A function (value: string) => T
59-
};
57+
variable?: string // The name of the environment variable; defaults to match the key if not specified
58+
parser: Parser<T> // A function (value: string) => T
59+
}
6060
```

0 commit comments

Comments
 (0)