docs(changelog test): i test how to automate ChangeLog

This commit is contained in:
Mert Gör
2024-01-31 23:37:33 +03:00
parent 6dfce49cac
commit 57619fa0c1
4206 changed files with 206871 additions and 0 deletions

37
node_modules/inquirer/lib/objects/choice.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
'use strict';
/**
* Choice object
* Normalize input as choice object
* @constructor
* @param {Number|String|Object} val Choice value. If an object is passed, it should contains
* at least one of `value` or `name` property
*/
module.exports = class Choice {
constructor(val, answers) {
// Don't process Choice and Separator object
if (val instanceof Choice || val.type === 'separator') {
// eslint-disable-next-line no-constructor-return
return val;
}
if (typeof val === 'string' || typeof val === 'number') {
this.name = String(val);
this.value = val;
this.short = String(val);
} else {
Object.assign(this, val, {
name: val.name || val.value,
value: 'value' in val ? val.value : val.name,
short: val.short || val.name || val.value,
});
}
if (typeof val.disabled === 'function') {
this.disabled = val.disabled(answers);
} else {
this.disabled = val.disabled;
}
}
};

123
node_modules/inquirer/lib/objects/choices.js generated vendored Normal file
View File

@@ -0,0 +1,123 @@
'use strict';
const assert = require('assert');
const _ = {
filter: require('lodash/filter'),
map: require('lodash/map'),
};
const Separator = require('./separator');
const Choice = require('./choice');
/**
* Choices collection
* Collection of multiple `choice` object
*/
module.exports = class Choices {
/** @param {Array} choices All `choice` to keep in the collection */
constructor(choices, answers) {
this.choices = choices.map((val) => {
if (val.type === 'separator') {
if (!(val instanceof Separator)) {
val = new Separator(val.line);
}
return val;
}
return new Choice(val, answers);
});
this.realChoices = this.choices
.filter(Separator.exclude)
.filter((item) => !item.disabled);
Object.defineProperty(this, 'length', {
get() {
return this.choices.length;
},
set(val) {
this.choices.length = val;
},
});
Object.defineProperty(this, 'realLength', {
get() {
return this.realChoices.length;
},
set() {
throw new Error('Cannot set `realLength` of a Choices collection');
},
});
}
/**
* Get a valid choice from the collection
* @param {Number} selector The selected choice index
* @return {Choice|Undefined} Return the matched choice or undefined
*/
getChoice(selector) {
assert(typeof selector === 'number');
return this.realChoices[selector];
}
/**
* Get a raw element from the collection
* @param {Number} selector The selected index value
* @return {Choice|Undefined} Return the matched choice or undefined
*/
get(selector) {
assert(typeof selector === 'number');
return this.choices[selector];
}
/**
* Match the valid choices against a where clause
* @param {Object} whereClause Lodash `where` clause
* @return {Array} Matching choices or empty array
*/
where(whereClause) {
return _.filter(this.realChoices, whereClause);
}
/**
* Pluck a particular key from the choices
* @param {String} propertyName Property name to select
* @return {Array} Selected properties
*/
pluck(propertyName) {
return _.map(this.realChoices, propertyName);
}
// Expose usual Array methods
indexOf(...args) {
return this.choices.indexOf(...args);
}
forEach(...args) {
return this.choices.forEach(...args);
}
filter(...args) {
return this.choices.filter(...args);
}
reduce(...args) {
return this.choices.reduce(...args);
}
find(func) {
return this.choices.find(func);
}
push(...args) {
const objs = args.map((val) => new Choice(val));
this.choices.push(...objs);
this.realChoices = this.choices
.filter(Separator.exclude)
.filter((item) => !item.disabled);
return this.choices;
}
};

37
node_modules/inquirer/lib/objects/separator.js generated vendored Normal file
View File

@@ -0,0 +1,37 @@
'use strict';
const chalk = require('chalk');
const figures = require('figures');
/**
* Separator object
* Used to space/separate choices group
* @constructor
* @param {String} line Separation line content (facultative)
*/
class Separator {
constructor(line) {
this.type = 'separator';
this.line = chalk.dim(line || new Array(15).join(figures.line));
}
/**
* Stringify separator
* @return {String} the separator display string
*/
toString() {
return this.line;
}
}
/**
* Helper function returning false if object is a separator
* @param {Object} obj object to test against
* @return {Boolean} `false` if object is a separator
*/
Separator.exclude = function (obj) {
return obj.type !== 'separator';
};
module.exports = Separator;