mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Make tests work with typescript@next (#36964)
Which has better narrowing for element access, so some code needs to be reworded to work with old versions as well as typescript@next.
This commit is contained in:
parent
15bfc9eedb
commit
fb16a158ff
@ -12,11 +12,12 @@ app.use(morgan('tiny'));
|
||||
app.use(morgan(':remote-addr :method :url'));
|
||||
|
||||
const tokenCallback: morgan.TokenCallbackFn = (req: IncomingMessage, res: ServerResponse): string => {
|
||||
if (req.headers['request-id']) {
|
||||
if (Array.isArray(req.headers['request-id'])) {
|
||||
return (req.headers['request-id'] as string[]).join(';');
|
||||
const rqid = req.headers['request-id'];
|
||||
if (rqid) {
|
||||
if (Array.isArray(rqid)) {
|
||||
return rqid.join(';');
|
||||
} else {
|
||||
return req.headers['request-id'] as string;
|
||||
return rqid;
|
||||
}
|
||||
} else {
|
||||
return '-';
|
||||
|
||||
@ -411,8 +411,8 @@ stripe.customers.create({
|
||||
let metadata: Stripe.IOptionsMetadata;
|
||||
const num = 123;
|
||||
metadata["test"] = str;
|
||||
metadata["test"] = num;
|
||||
metadata["test"] === str;
|
||||
metadata["test"] = num;
|
||||
metadata["test"] === num;
|
||||
metadata.testStr = str;
|
||||
metadata.testNum = num;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user