Update Methods by implementing real values (#43104)

This commit is contained in:
Michel Bitter 2020-03-14 02:33:15 +01:00 committed by GitHub
parent cdc9c593eb
commit 698d4c6c1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 78 additions and 5 deletions

View File

@ -1,7 +1,78 @@
// Type definitions for methods 1.1
// Project: https://github.com/jshttp/methods
// Definitions by: Carlos Precioso <https://github.com/cprecioso>
// Michel Bitter <https://github.com/michelbitter>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const methods: string[];
type Method =
| 'ACL'
| 'BIND'
| 'CHECKOUT'
| 'CONNECT'
| 'COPY'
| 'DELETE'
| 'GET'
| 'HEAD'
| 'LINK'
| 'LOCK'
| 'M-SEARCH'
| 'MERGE'
| 'MKACTIVITY'
| 'MKCALENDAR'
| 'MKCOL'
| 'MOVE'
| 'NOTIFY'
| 'OPTIONS'
| 'PATCH'
| 'POST'
| 'PROPFIND'
| 'PROPPATCH'
| 'PURGE'
| 'PUT'
| 'REBIND'
| 'REPORT'
| 'SEARCH'
| 'SOURCE'
| 'SUBSCRIBE'
| 'TRACE'
| 'UNBIND'
| 'UNLINK'
| 'UNLOCK'
| 'UNSUBSCRIBE'
| 'acl'
| 'bind'
| 'checkout'
| 'connect'
| 'copy'
| 'delete'
| 'get'
| 'head'
| 'link'
| 'lock'
| 'm-search'
| 'merge'
| 'mkactivity'
| 'mkcalendar'
| 'mkcol'
| 'move'
| 'notify'
| 'options'
| 'patch'
| 'post'
| 'propfind'
| 'proppatch'
| 'purge'
| 'put'
| 'rebind'
| 'report'
| 'search'
| 'source'
| 'subscribe'
| 'trace'
| 'unbind'
| 'unlink'
| 'unlock'
| 'unsubscribe';
declare const methods: Method[];
export = methods;

View File

@ -1,5 +1,7 @@
import * as methods from "methods";
import * as methods from 'methods';
methods
.slice(0)
.map(method => method.toUpperCase());
methods.slice(0).map(method => method.toUpperCase());
methods.find(item => {
return item === 'get';
});