UNPKG

@r4lrgx/gitmoji

Version:

🧱 My customized Gitmoji Config - a fork of https://github.com/arvinxx/gitmoji-commit-workflow - just with several bug fixes and a cleaner look.

86 lines (83 loc) • 2.15 kB
import _ from 'lodash'; // @r4lrgx/gitmoji v1.0.3 // MIT License var { merge } = _; var commitTypeMap = { feat: { emoji: "\u2728", title: "Features", subtitle: "New features and enhancements" }, fix: { emoji: "\u{1F41B}", title: "Bug Fixes", subtitle: "Resolved bugs and issues" }, perf: { emoji: "\u26A1", title: "Performance Improvements", subtitle: "Faster, leaner, better" }, refactor: { emoji: "\u267B", title: "Code Refactoring", subtitle: "Code structure improvements" }, chore: { emoji: "\u{1F527}", title: "Chores", subtitle: "Other tasks and maintenance" }, docs: { emoji: "\u{1F4DD}", title: "Documentation", subtitle: "Docs updates and improvements" }, build: { emoji: "\u{1F4E6}\uFE0F", title: "Build System", subtitle: "Changes to build tools and processes" }, ci: { emoji: "\u{1F477}", title: "Continuous Integration", subtitle: "CI config updates and automation" }, test: { emoji: "\u2705", title: "Tests", subtitle: "Added or updated tests" }, style: { emoji: "\u{1F3A8}", title: "Styles", subtitle: "Visual tweaks and formatting" }, wip: { emoji: "\u{1F691}\uFE0F", title: "Cleaning", subtitle: "Work in progress or cleanup" }, revert: { emoji: "\u23EA", title: "Reverts", subtitle: "Undone changes and rollbacks" } }; var defineCommitTypeMap = (customCommitTypeMap) => { if (!customCommitTypeMap) return commitTypeMap; return merge(customCommitTypeMap, commitTypeMap); }; var displayCommitType = (commitType, config) => { const { withEmoji = true, customCommitTypeMap = void 0 } = config; const diplayCommitTypeMap = defineCommitTypeMap(customCommitTypeMap); if (commitType in diplayCommitTypeMap) { const item = diplayCommitTypeMap[commitType]; const { emoji, title } = item; return `${withEmoji ? `${emoji} ` : ""}${title}`; } return commitType; }; export { commitTypeMap, defineCommitTypeMap, displayCommitType }; //# sourceMappingURL=displayCommitType.js.map //# sourceMappingURL=displayCommitType.js.map