commitizen 4.3.2 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,399 +4,26 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- function cov_27tktivjps() {
8
- var path = "/home/runner/work/cz-cli/cz-cli/src/configLoader/getNormalizedConfig.js";
9
- var hash = "4f6f52b87cc201f346900b4ddb8d92d48fe58a78";
10
- var global = new Function("return this")();
11
- var gcv = "__coverage__";
12
- var coverageData = {
13
- path: "/home/runner/work/cz-cli/cz-cli/src/configLoader/getNormalizedConfig.js",
14
- statementMap: {
15
- "0": {
16
- start: {
17
- line: 7,
18
- column: 2
19
- },
20
- end: {
21
- line: 26,
22
- column: 3
23
- }
24
- },
25
- "1": {
26
- start: {
27
- line: 12,
28
- column: 4
29
- },
30
- end: {
31
- line: 22,
32
- column: 5
33
- }
34
- },
35
- "2": {
36
- start: {
37
- line: 13,
38
- column: 6
39
- },
40
- end: {
41
- line: 13,
42
- column: 39
43
- }
44
- },
45
- "3": {
46
- start: {
47
- line: 14,
48
- column: 11
49
- },
50
- end: {
51
- line: 22,
52
- column: 5
53
- }
54
- },
55
- "4": {
56
- start: {
57
- line: 17,
58
- column: 6
59
- },
60
- end: {
61
- line: 20,
62
- column: 7
63
- }
64
- },
65
- "5": {
66
- start: {
67
- line: 19,
68
- column: 8
69
- },
70
- end: {
71
- line: 19,
72
- column: 341
73
- }
74
- },
75
- "6": {
76
- start: {
77
- line: 21,
78
- column: 6
79
- },
80
- end: {
81
- line: 21,
82
- column: 30
83
- }
84
- },
85
- "7": {
86
- start: {
87
- line: 25,
88
- column: 4
89
- },
90
- end: {
91
- line: 25,
92
- column: 19
93
- }
94
- }
95
- },
96
- fnMap: {
97
- "0": {
98
- name: "getNormalizedConfig",
99
- decl: {
100
- start: {
101
- line: 5,
102
- column: 9
103
- },
104
- end: {
105
- line: 5,
106
- column: 28
107
- }
108
- },
109
- loc: {
110
- start: {
111
- line: 5,
112
- column: 47
113
- },
114
- end: {
115
- line: 28,
116
- column: 1
117
- }
118
- },
119
- line: 5
120
- }
121
- },
122
- branchMap: {
123
- "0": {
124
- loc: {
125
- start: {
126
- line: 7,
127
- column: 2
128
- },
129
- end: {
130
- line: 26,
131
- column: 3
132
- }
133
- },
134
- type: "if",
135
- locations: [{
136
- start: {
137
- line: 7,
138
- column: 2
139
- },
140
- end: {
141
- line: 26,
142
- column: 3
143
- }
144
- }, {
145
- start: {
146
- line: 23,
147
- column: 9
148
- },
149
- end: {
150
- line: 26,
151
- column: 3
152
- }
153
- }],
154
- line: 7
155
- },
156
- "1": {
157
- loc: {
158
- start: {
159
- line: 7,
160
- column: 6
161
- },
162
- end: {
163
- line: 7,
164
- column: 44
165
- }
166
- },
167
- type: "binary-expr",
168
- locations: [{
169
- start: {
170
- line: 7,
171
- column: 6
172
- },
173
- end: {
174
- line: 7,
175
- column: 13
176
- }
177
- }, {
178
- start: {
179
- line: 7,
180
- column: 18
181
- },
182
- end: {
183
- line: 7,
184
- column: 43
185
- }
186
- }],
187
- line: 7
188
- },
189
- "2": {
190
- loc: {
191
- start: {
192
- line: 12,
193
- column: 4
194
- },
195
- end: {
196
- line: 22,
197
- column: 5
198
- }
199
- },
200
- type: "if",
201
- locations: [{
202
- start: {
203
- line: 12,
204
- column: 4
205
- },
206
- end: {
207
- line: 22,
208
- column: 5
209
- }
210
- }, {
211
- start: {
212
- line: 14,
213
- column: 11
214
- },
215
- end: {
216
- line: 22,
217
- column: 5
218
- }
219
- }],
220
- line: 12
221
- },
222
- "3": {
223
- loc: {
224
- start: {
225
- line: 12,
226
- column: 8
227
- },
228
- end: {
229
- line: 12,
230
- column: 51
231
- }
232
- },
233
- type: "binary-expr",
234
- locations: [{
235
- start: {
236
- line: 12,
237
- column: 8
238
- },
239
- end: {
240
- line: 12,
241
- column: 22
242
- }
243
- }, {
244
- start: {
245
- line: 12,
246
- column: 26
247
- },
248
- end: {
249
- line: 12,
250
- column: 51
251
- }
252
- }],
253
- line: 12
254
- },
255
- "4": {
256
- loc: {
257
- start: {
258
- line: 14,
259
- column: 11
260
- },
261
- end: {
262
- line: 22,
263
- column: 5
264
- }
265
- },
266
- type: "if",
267
- locations: [{
268
- start: {
269
- line: 14,
270
- column: 11
271
- },
272
- end: {
273
- line: 22,
274
- column: 5
275
- }
276
- }, {
277
- start: {
278
- line: undefined,
279
- column: undefined
280
- },
281
- end: {
282
- line: undefined,
283
- column: undefined
284
- }
285
- }],
286
- line: 14
287
- },
288
- "5": {
289
- loc: {
290
- start: {
291
- line: 17,
292
- column: 6
293
- },
294
- end: {
295
- line: 20,
296
- column: 7
297
- }
298
- },
299
- type: "if",
300
- locations: [{
301
- start: {
302
- line: 17,
303
- column: 6
304
- },
305
- end: {
306
- line: 20,
307
- column: 7
308
- }
309
- }, {
310
- start: {
311
- line: undefined,
312
- column: undefined
313
- },
314
- end: {
315
- line: undefined,
316
- column: undefined
317
- }
318
- }],
319
- line: 17
320
- }
321
- },
322
- s: {
323
- "0": 0,
324
- "1": 0,
325
- "2": 0,
326
- "3": 0,
327
- "4": 0,
328
- "5": 0,
329
- "6": 0,
330
- "7": 0
331
- },
332
- f: {
333
- "0": 0
334
- },
335
- b: {
336
- "0": [0, 0],
337
- "1": [0, 0],
338
- "2": [0, 0],
339
- "3": [0, 0],
340
- "4": [0, 0],
341
- "5": [0, 0]
342
- },
343
- _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
344
- hash: "4f6f52b87cc201f346900b4ddb8d92d48fe58a78"
345
- };
346
- var coverage = global[gcv] || (global[gcv] = {});
347
- if (!coverage[path] || coverage[path].hash !== hash) {
348
- coverage[path] = coverageData;
349
- }
350
- var actualCoverage = coverage[path];
351
- {
352
- // @ts-ignore
353
- cov_27tktivjps = function () {
354
- return actualCoverage;
355
- };
356
- }
357
- return actualCoverage;
358
- }
359
- cov_27tktivjps();
360
7
  var _default = exports.default = getNormalizedConfig; // Given a config and content, plucks the actual
361
8
  // settings that we're interested in
362
9
  function getNormalizedConfig(config, content) {
363
- cov_27tktivjps().f[0]++;
364
- cov_27tktivjps().s[0]++;
365
- if ((cov_27tktivjps().b[1][0]++, content) && (cov_27tktivjps().b[1][1]++, config === 'package.json')) {
366
- cov_27tktivjps().b[0][0]++;
367
- cov_27tktivjps().s[1]++;
10
+ if (content && config === 'package.json') {
368
11
  // PACKAGE.JSON
369
12
 
370
13
  // Use the npm config key, be good citizens
371
- if ((cov_27tktivjps().b[3][0]++, content.config) && (cov_27tktivjps().b[3][1]++, content.config.commitizen)) {
372
- cov_27tktivjps().b[2][0]++;
373
- cov_27tktivjps().s[2]++;
14
+ if (content.config && content.config.commitizen) {
374
15
  return content.config.commitizen;
375
- } else {
376
- cov_27tktivjps().b[2][1]++;
377
- cov_27tktivjps().s[3]++;
378
- if (content.czConfig) {
379
- cov_27tktivjps().b[4][0]++;
380
- cov_27tktivjps().s[4]++;
381
- // Old method, will be deprecated in 3.0.0
16
+ } else if (content.czConfig) {
17
+ // Old method, will be deprecated in 3.0.0
382
18
 
383
- // Suppress during test
384
- if (typeof global.it !== 'function') {
385
- cov_27tktivjps().b[5][0]++;
386
- cov_27tktivjps().s[5]++;
387
- console.error("\n********\nWARNING: This repository's package.json is using czConfig. czConfig will be deprecated in Commitizen 3. \nPlease use this instead:\n{\n \"config\": {\n \"commitizen\": {\n \"path\": \"./path/to/adapter\"\n }\n }\n}\nFor more information, see: http://commitizen.github.io/cz-cli/\n********\n");
388
- } else {
389
- cov_27tktivjps().b[5][1]++;
390
- }
391
- cov_27tktivjps().s[6]++;
392
- return content.czConfig;
393
- } else {
394
- cov_27tktivjps().b[4][1]++;
19
+ // Suppress during test
20
+ /* istanbul ignore if */
21
+ if (typeof global.it !== 'function') {
22
+ console.error("\n********\nWARNING: This repository's package.json is using czConfig. czConfig will be deprecated in Commitizen 3. \nPlease use this instead:\n{\n \"config\": {\n \"commitizen\": {\n \"path\": \"./path/to/adapter\"\n }\n }\n}\nFor more information, see: http://commitizen.github.io/cz-cli/\n********\n");
395
23
  }
24
+ return content.czConfig;
396
25
  }
397
26
  } else {
398
- cov_27tktivjps().b[0][1]++;
399
- cov_27tktivjps().s[7]++;
400
27
  // .cz.json or .czrc
401
28
  return content;
402
29
  }