@yamlresume/core 0.7.1 → 0.7.3

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.
package/dist/index.d.ts CHANGED
@@ -250,20 +250,20 @@ declare function getTemplateDetail(template: Template): {
250
250
  id: "moderncv-banking" | "moderncv-casual" | "moderncv-classic";
251
251
  };
252
252
  /** Provides default, empty item structures for each resume section type. */
253
- declare const resumeItems: ResumeItem;
253
+ declare const RESUME_SECTION_ITEMS: ResumeItem;
254
254
  /**
255
255
  * Default content structure for a new resume, containing empty or minimal
256
256
  * sections.
257
257
  */
258
- declare const defaultResumeContent: ResumeContent;
258
+ declare const DEFAULT_RESUME_CONTENT: ResumeContent;
259
259
  /**
260
260
  * Resume content structure containing one example item for each section.
261
261
  *
262
262
  * Useful for testing transformations and rendering.
263
263
  */
264
- declare const filledResumeContent: ResumeContent;
264
+ declare const FILLED_RESUME_CONTENT: ResumeContent;
265
265
  /** Available margin size options for resume layout. */
266
- declare const marginOptions: string[];
266
+ declare const MARGIN_OPTIONS: string[];
267
267
  /**
268
268
  * Get the language code and name of the given locale language.
269
269
  *
@@ -275,15 +275,15 @@ declare function getLocaleLanguageDetail(localeLanguage: LocaleLanguage): {
275
275
  name: string;
276
276
  };
277
277
  /** Default layout configuration for a new resume. */
278
- declare const defaultResumeLayout: ResumeLayout;
278
+ declare const DEFAULT_RESUME_LAYOUT: ResumeLayout;
279
279
  /** Default value when user creates a new `Resume` object. */
280
- declare const defaultResume: Resume;
280
+ declare const DEFAULT_RESUME: Resume;
281
281
  /**
282
282
  * Default value when user wants to use a filled resume.
283
283
  *
284
284
  * This is useful for testing transformations and rendering.
285
285
  */
286
- declare const filledResume: Resume;
286
+ declare const FILLED_RESUME: Resume;
287
287
 
288
288
  /**
289
289
  * MIT License
@@ -4254,7 +4254,7 @@ declare function getDateRange(startDate: string, endDate: string, language: Loca
4254
4254
  /**
4255
4255
  * The number of seconds in one day
4256
4256
  */
4257
- declare const oneDay: number;
4257
+ declare const ONE_DAY: number;
4258
4258
  /**
4259
4259
  * Get the current time in UTC seconds
4260
4260
  *
@@ -4374,39 +4374,6 @@ declare function removeKeysFromObject<T extends object>(obj: T, keysToRemove: (s
4374
4374
  * ```
4375
4375
  */
4376
4376
  declare function collectAllKeys(obj: unknown, keys?: Set<string | number | symbol>, visited?: WeakSet<object>): Set<string | number | symbol>;
4377
- /**
4378
- * Normamlize all leaf values that are `null` or `undefined` with empty strings.
4379
- *
4380
- * This function recursively traverses an object and replaces any `null` values
4381
- * with empty strings. It only affects leaf nodes (values that are not objects
4382
- * or arrays), preserving the structure of nested objects and arrays.
4383
- *
4384
- * @param obj - The object to process
4385
- * @returns A new object with all `null` leaf values replaced by empty strings
4386
- *
4387
- * @example
4388
- * ```typescript
4389
- * const obj = {
4390
- * name: 'John',
4391
- * email: null,
4392
- * details: {
4393
- * age: undefined,
4394
- * hobbies: ['reading', null, 'gaming']
4395
- * }
4396
- * }
4397
- * const result = replaceNullWithEmptyString(obj)
4398
- * // result will be:
4399
- * // {
4400
- * // name: 'John',
4401
- * // email: '',
4402
- * // details: {
4403
- * // age: '',
4404
- * // hobbies: ['reading', '', 'gaming']
4405
- * // }
4406
- * // }
4407
- * ```
4408
- */
4409
- declare function normalizeObjectLeafValues<T>(obj: T): T;
4410
4377
 
4411
4378
  /**
4412
4379
  * MIT License
@@ -4446,6 +4413,14 @@ declare function isEmptyString(value: string): boolean;
4446
4413
  * @returns The content if predicate is true, empty string otherwise
4447
4414
  */
4448
4415
  declare function showIf(predicate: boolean, content: string): string;
4416
+ /**
4417
+ * Show content if value is not empty
4418
+ *
4419
+ * @param value - The value to check (undefined, null, object, or string)
4420
+ * @param content - The content to show
4421
+ * @returns The content if value is not empty, empty string otherwise
4422
+ */
4423
+ declare function showIfNotEmpty(value: undefined | null | object | string, content: string): string;
4449
4424
  /**
4450
4425
  * Join an array of strings , but only if the string is not empty
4451
4426
  *
@@ -4463,4 +4438,4 @@ declare function joinNonEmptyString(codes: string[], separator?: string): string
4463
4438
  */
4464
4439
  declare function toCodeBlock(code?: string, lang?: string): string;
4465
4440
 
4466
- export { type Awards, type Basics, type BulletListNode, COUNTRY_OPTIONS, type Certificates, type Country, DEFAULT_SECTIONS_ORDER, DEGREE_OPTIONS, type Degree, type DocNode, type Education, EnglishCountryNames, ErrorType, FLUENCY_OPTIONS, FONTSPEC_NUMBERS_OPTIONS, FONT_SIZE_OPTIONS, type Fluency, type FontSize, type FontspecNumbers, type Interests, LANGUAGE_OPTIONS, LEVEL_OPTIONS, LOCALE_LANGUAGE_OPTIONS, type Language, type LanguageItem, type Languages, LatexCodeGenerator, type Level, type LocaleLanguage, type Location, MarkdownParser, NETWORK_OPTIONS, type Network, type Node, NorwegianCountryNames, ORDERABLE_SECTION_IDS, type OrderableSectionID, type OrderedListNode, PUNCTUATIONS, type ParagraphNode, type Parser, type ProfileItem, type Profiles, type Projects, type Publications, type Punctuation, type References, type Resume, type ResumeContent, type ResumeItem, type ResumeLayout, ResumeSchema, SECTION_IDS, type SectionID, SimplifiedChineseCountryNames, type Skills, SpanishCountryNames, TEMPLATE_OPTIONS, TERMS, type Template, type Term, type TextNode, TraditionalChineseCountryHKNames, TraditionalChineseCountryTWNames, type Volunteer, type Work, YAMLResumeError, collectAllKeys, defaultResume, defaultResumeContent, defaultResumeLayout, epochSecondsToLocaleDateString, escapeLatex, filledResume, filledResumeContent, getDateRange, getLocaleLanguageDetail, getOptionTranslation, getResumeRenderer, getTemplateDetail, getTemplateTranslations, isEmptyString, isEmptyValue, joinNonEmptyString, localizeDate, marginOptions, mergeArrayWithOrder, milliSecondsToSeconds, normalizeObjectLeafValues, nowInUTCSeconds, oneDay, parseDate, removeKeysFromObject, resumeItems, showIf, toCodeBlock, transformResume };
4441
+ export { type Awards, type Basics, type BulletListNode, COUNTRY_OPTIONS, type Certificates, type Country, DEFAULT_RESUME, DEFAULT_RESUME_CONTENT, DEFAULT_RESUME_LAYOUT, DEFAULT_SECTIONS_ORDER, DEGREE_OPTIONS, type Degree, type DocNode, type Education, EnglishCountryNames, ErrorType, FILLED_RESUME, FILLED_RESUME_CONTENT, FLUENCY_OPTIONS, FONTSPEC_NUMBERS_OPTIONS, FONT_SIZE_OPTIONS, type Fluency, type FontSize, type FontspecNumbers, type Interests, LANGUAGE_OPTIONS, LEVEL_OPTIONS, LOCALE_LANGUAGE_OPTIONS, type Language, type LanguageItem, type Languages, LatexCodeGenerator, type Level, type LocaleLanguage, type Location, MARGIN_OPTIONS, MarkdownParser, NETWORK_OPTIONS, type Network, type Node, NorwegianCountryNames, ONE_DAY, ORDERABLE_SECTION_IDS, type OrderableSectionID, type OrderedListNode, PUNCTUATIONS, type ParagraphNode, type Parser, type ProfileItem, type Profiles, type Projects, type Publications, type Punctuation, RESUME_SECTION_ITEMS, type References, type Resume, type ResumeContent, type ResumeItem, type ResumeLayout, ResumeSchema, SECTION_IDS, type SectionID, SimplifiedChineseCountryNames, type Skills, SpanishCountryNames, TEMPLATE_OPTIONS, TERMS, type Template, type Term, type TextNode, TraditionalChineseCountryHKNames, TraditionalChineseCountryTWNames, type Volunteer, type Work, YAMLResumeError, collectAllKeys, epochSecondsToLocaleDateString, escapeLatex, getDateRange, getLocaleLanguageDetail, getOptionTranslation, getResumeRenderer, getTemplateDetail, getTemplateTranslations, isEmptyString, isEmptyValue, joinNonEmptyString, localizeDate, mergeArrayWithOrder, milliSecondsToSeconds, nowInUTCSeconds, parseDate, removeKeysFromObject, showIf, showIfNotEmpty, toCodeBlock, transformResume };