source: trip-planner-front/node_modules/methods/index.js@ 6fe77af

Last change on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.0 KB
Line 
1/*!
2 * methods
3 * Copyright(c) 2013-2014 TJ Holowaychuk
4 * Copyright(c) 2015-2016 Douglas Christopher Wilson
5 * MIT Licensed
6 */
7
8'use strict';
9
10/**
11 * Module dependencies.
12 * @private
13 */
14
15var http = require('http');
16
17/**
18 * Module exports.
19 * @public
20 */
21
22module.exports = getCurrentNodeMethods() || getBasicNodeMethods();
23
24/**
25 * Get the current Node.js methods.
26 * @private
27 */
28
29function getCurrentNodeMethods() {
30 return http.METHODS && http.METHODS.map(function lowerCaseMethod(method) {
31 return method.toLowerCase();
32 });
33}
34
35/**
36 * Get the "basic" Node.js methods, a snapshot from Node.js 0.10.
37 * @private
38 */
39
40function getBasicNodeMethods() {
41 return [
42 'get',
43 'post',
44 'put',
45 'head',
46 'delete',
47 'options',
48 'trace',
49 'copy',
50 'lock',
51 'mkcol',
52 'move',
53 'purge',
54 'propfind',
55 'proppatch',
56 'unlock',
57 'report',
58 'mkactivity',
59 'checkout',
60 'merge',
61 'm-search',
62 'notify',
63 'subscribe',
64 'unsubscribe',
65 'patch',
66 'search',
67 'connect'
68 ];
69}
Note: See TracBrowser for help on using the repository browser.