1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.createHelp = void 0;
|
7 |
|
8 | var _factory = require("../../utils/factory");
|
9 |
|
10 | var _customs = require("../../utils/customs");
|
11 |
|
12 | var _embeddedDocs = require("../embeddedDocs/embeddedDocs");
|
13 |
|
14 | var _object = require("../../utils/object");
|
15 |
|
16 | var name = 'help';
|
17 | var dependencies = ['typed', 'mathWithTransform', 'Help'];
|
18 | var createHelp =
|
19 |
|
20 | (0, _factory.factory)(name, dependencies, function (_ref) {
|
21 | var typed = _ref.typed,
|
22 | mathWithTransform = _ref.mathWithTransform,
|
23 | Help = _ref.Help;
|
24 |
|
25 | |
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | return typed(name, {
|
44 | any: function any(search) {
|
45 | var prop;
|
46 | var searchName = search;
|
47 |
|
48 | if (typeof search !== 'string') {
|
49 | for (prop in mathWithTransform) {
|
50 |
|
51 | if ((0, _object.hasOwnProperty)(mathWithTransform, prop) && search === mathWithTransform[prop]) {
|
52 | searchName = prop;
|
53 | break;
|
54 | }
|
55 | }
|
56 | |
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | }
|
71 |
|
72 | var doc = (0, _customs.getSafeProperty)(_embeddedDocs.embeddedDocs, searchName);
|
73 |
|
74 | if (!doc) {
|
75 | var searchText = typeof searchName === 'function' ? searchName.name : searchName;
|
76 | throw new Error('No documentation found on "' + searchText + '"');
|
77 | }
|
78 |
|
79 | return new Help(doc);
|
80 | }
|
81 | });
|
82 | });
|
83 | exports.createHelp = createHelp; |
\ | No newline at end of file |