1 | "use strict";
|
2 |
|
3 |
|
4 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
5 | if (k2 === undefined) k2 = k;
|
6 | var desc = Object.getOwnPropertyDescriptor(m, k);
|
7 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
8 | desc = { enumerable: true, get: function() { return m[k]; } };
|
9 | }
|
10 | Object.defineProperty(o, k2, desc);
|
11 | }) : (function(o, m, k, k2) {
|
12 | if (k2 === undefined) k2 = k;
|
13 | o[k2] = m[k];
|
14 | }));
|
15 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
16 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
17 | }) : function(o, v) {
|
18 | o["default"] = v;
|
19 | });
|
20 | var __importStar = (this && this.__importStar) || function (mod) {
|
21 | if (mod && mod.__esModule) return mod;
|
22 | var result = {};
|
23 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
24 | __setModuleDefault(result, mod);
|
25 | return result;
|
26 | };
|
27 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
28 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
29 | };
|
30 | Object.defineProperty(exports, "__esModule", { value: true });
|
31 | exports.DocumenterConfig = void 0;
|
32 | const path = __importStar(require("path"));
|
33 | const node_core_library_1 = require("@rushstack/node-core-library");
|
34 | const api_documenter_schema_json_1 = __importDefault(require("../schemas/api-documenter.schema.json"));
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | class DocumenterConfig {
|
41 | constructor(filePath, configFile) {
|
42 | this.configFilePath = filePath;
|
43 | this.configFile = configFile;
|
44 | switch (configFile.newlineKind) {
|
45 | case 'lf':
|
46 | this.newlineKind = node_core_library_1.NewlineKind.Lf;
|
47 | break;
|
48 | case 'os':
|
49 | this.newlineKind = node_core_library_1.NewlineKind.OsDefault;
|
50 | break;
|
51 | default:
|
52 | this.newlineKind = node_core_library_1.NewlineKind.CrLf;
|
53 | break;
|
54 | }
|
55 | }
|
56 | |
57 |
|
58 |
|
59 | static loadFile(configFilePath) {
|
60 | const configFile = node_core_library_1.JsonFile.loadAndValidate(configFilePath, DocumenterConfig.jsonSchema);
|
61 | return new DocumenterConfig(path.resolve(configFilePath), configFile);
|
62 | }
|
63 | }
|
64 |
|
65 |
|
66 |
|
67 | DocumenterConfig.jsonSchema = node_core_library_1.JsonSchema.fromLoadedObject(api_documenter_schema_json_1.default);
|
68 |
|
69 |
|
70 |
|
71 | DocumenterConfig.FILENAME = 'api-documenter.json';
|
72 | exports.DocumenterConfig = DocumenterConfig;
|
73 |
|
\ | No newline at end of file |