@@ -34450,7 +34450,7 @@ exports["default"] = previewUpdater;
3445034450Object.defineProperty(exports, "__esModule", ({ value: true }));
3445134451exports.defaultConfig = void 0;
3445234452exports.defaultConfig = {
34453- directory: '' ,
34453+ directory: undefined ,
3445434454 path: {
3445534455 readme: 'README.md'
3445634456 },
@@ -34462,27 +34462,27 @@ exports.defaultConfig = {
3446234462 fontSize: '100px',
3446334463 icon: 'code',
3446434464 packageManager: 'auto',
34465- packageName: '' ,
34465+ packageName: undefined ,
3446634466 packageGlobal: false,
34467- title: '' ,
34468- description: ''
34467+ title: undefined ,
34468+ description: undefined
3446934469 }
3447034470 },
3447134471 repository: {
34472- owner: '' ,
34473- repo: '' ,
34472+ owner: undefined ,
34473+ repo: undefined ,
3447434474 commit: {
3447534475 branch: 'preview/update-{random}',
3447634476 title: 'docs(preview): Update preview',
34477- body: '' ,
34477+ body: undefined ,
3447834478 author: {
3447934479 name: 'github-actions',
3448034480 email: 'github-actions@github.com'
3448134481 }
3448234482 },
3448334483 pullRequest: {
3448434484 title: 'Update preview',
34485- body: '' ,
34485+ body: undefined ,
3448634486 assignees: [],
3448734487 labels: []
3448834488 }
@@ -34560,14 +34560,13 @@ const writeFile = (config, filename, content) => {
3456034560 fs.writeFileSync(filePath(config, filename), content);
3456134561};
3456234562exports.writeFile = writeFile;
34563- const readConfig = (override, userConfigPath, baseConfig = undefined) => {
34564- const dataConfig = baseConfig ?? config_1.defaultConfig;
34565- const content = (0, exports.readFile)(override, userConfigPath);
34563+ const readConfig = (config, userConfigPath) => {
34564+ const content = (0, exports.readFile)(config, userConfigPath);
3456634565 if (content === '') {
34567- return (0, deepmerge_ts_1.deepmerge)(dataConfig, override );
34566+ return (0, deepmerge_ts_1.deepmerge)(config_1.defaultConfig, config );
3456834567 }
3456934568 const userConfig = yaml.load(content);
34570- return (0, deepmerge_ts_1.deepmerge)(dataConfig , userConfig, override );
34569+ return (0, deepmerge_ts_1.deepmerge)(config_1.defaultConfig , userConfig, config );
3457134570};
3457234571exports.readConfig = readConfig;
3457334572const exec = async (command) => {
@@ -34589,7 +34588,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
3458934588exports.getImages = void 0;
3459034589const packageManagers_1 = __nccwpck_require__(2453);
3459134590const encodeUri = (value) => {
34592- if (value === '') {
34591+ if (value === '' || value === undefined ) {
3459334592 return '';
3459434593 }
3459534594 return encodeURIComponent(value);
@@ -34621,7 +34620,12 @@ const packageManager = (config) => {
3462134620 return '';
3462234621 }
3462334622};
34624- const packageName = (image) => image.packageManager !== 'none' ? image.packageName : '';
34623+ const packageName = (image) => {
34624+ if (image.packageManager === 'none') {
34625+ return '';
34626+ }
34627+ return image?.packageName || '';
34628+ };
3462534629const render = (config, theme) => {
3462634630 const image = config.image.parameters;
3462734631 const params = new URLSearchParams({
@@ -34632,7 +34636,7 @@ const render = (config, theme) => {
3463234636 images: image.icon,
3463334637 packageManager: packageManager(config),
3463434638 packageName: packageName(image),
34635- description: image.description
34639+ description: image.description || ''
3463634640 });
3463734641 return config.image.url.replace('{title}', encodeUri(image.title)) + '?' + params.toString();
3463834642};
@@ -34934,11 +34938,16 @@ exports.Repository = Repository;
3493434938
3493534939Object.defineProperty(exports, "__esModule", ({ value: true }));
3493634940exports.titleCase = void 0;
34937- const titleCase = (title) => title
34938- .replace(/([A-Z])/g, '$1')
34939- .toLowerCase()
34940- .replace(/(^|\s|-|_)\S/g, (match) => match.toUpperCase())
34941- .replace(/[-_]/g, ' ');
34941+ const titleCase = (title) => {
34942+ if (title === '' || title === undefined) {
34943+ return '';
34944+ }
34945+ return title
34946+ .replace(/([A-Z])/g, '$1')
34947+ .toLowerCase()
34948+ .replace(/(^|\s|-|_)\S/g, (match) => match.toUpperCase())
34949+ .replace(/[-_]/g, ' ');
34950+ };
3494234951exports.titleCase = titleCase;
3494334952
3494434953
0 commit comments