-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
111 lines (88 loc) · 3.77 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/**
* Module dependencies
*/
var build = require('./lib/build');
var getMethodName = require('./lib/get-method-name');
var pack = require('./lib/pack');
var buildWithCustomUsage = require('./lib/build-with-custom-usage');
var RELEASE_LICENSE = require('./package.json').license;
var RELEASE_SERIES = 'gen2';
var RELEASE_VERSION = require('./package.json').version;
/**
* Machine()
*
* @type {Function}
* @properties
* .build()
* .buildWithCustomUsage()
* .pack()
* .getMethodName()
*/
module.exports = build;
// ███████╗████████╗ █████╗ ████████╗██╗ ██████╗ ███╗ ███╗███████╗████████╗██╗ ██╗ ██████╗ ██████╗ ███████╗
// ██╔════╝╚══██╔══╝██╔══██╗╚══██╔══╝██║██╔════╝ ████╗ ████║██╔════╝╚══██╔══╝██║ ██║██╔═══██╗██╔══██╗██╔════╝
// ███████╗ ██║ ███████║ ██║ ██║██║ ██╔████╔██║█████╗ ██║ ███████║██║ ██║██║ ██║███████╗
// ╚════██║ ██║ ██╔══██║ ██║ ██║██║ ██║╚██╔╝██║██╔══╝ ██║ ██╔══██║██║ ██║██║ ██║╚════██║
// ███████║ ██║ ██║ ██║ ██║ ██║╚██████╗ ██║ ╚═╝ ██║███████╗ ██║ ██║ ██║╚██████╔╝██████╔╝███████║
// ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝
//
/**
* .getMethodName()
*
* See lib/get-method-name.js
*/
module.exports.getMethodName = getMethodName;
/**
* .pack()
*
* See lib/pack.js
*/
module.exports.pack = pack;
/**
* .VERSION
* .version
*
* @type {String}
*/
module.exports.VERSION = RELEASE_VERSION;
module.exports.version = RELEASE_VERSION;//« for backwards compatibility
/**
* [Symbol.for('nodejs.util.inspect.custom')]
* (formerly known as ".inspect()")
* https://github.com/node-machine/machine/pull/50/
*
* When the Machine constructor is inspected (e.g. `util.inspect()` / `console.log()`),
* pretty print the current version of node-machine, with license information and a link
* to the documentation.
*
* @returns {String}
*/
module.exports[Symbol.for('nodejs.util.inspect.custom')] = function () {
return ''+
'---------------------------------------------------\n'+
' machine'+/*' (runtime environment)'+*/'\n'+
' v'+RELEASE_VERSION+' ('+RELEASE_SERIES+')\n'+
' \n'+
' • License : '+RELEASE_LICENSE+'\n'+
' • Package : http://npmjs.com/package/machine\n'+
' • Questions : https://sailsjs.com/support\n'+
'---------------------------------------------------\n';
};
/**
* .build()
*
* Build a wet (callable) machine.
*
* @returns {Function}
*/
module.exports.build = build;
/**
* .buildWithCustomUsage()
*
* Return a machine function with a custom usage style.
*
* @property {Dictionary} def
* @property {String?} arginStyle ("named" or "serial")
* @property {String?} execStyle ("deferred" or "immediate")
*/
module.exports.buildWithCustomUsage = buildWithCustomUsage;