netspective-labs / sql-aide

SQL Aide (SQLa) Typescript template literal text supplier optimized for emitting SQL
https://www.sql-aide.com/
MIT License
15 stars 17 forks source link

Refactor Key Assignments for Improved Code Clarity #169

Closed jobyjames1 closed 10 months ago

jobyjames1 commented 10 months ago

This pull request streamlines key assignments within the codebase by refactoring the structure of exported constants. Previously, the export statements were split for 'autoIncPrimaryKey' and 'ulidPrimaryKey,' leading to redundancy. The modification consolidates these assignments into a single line, enhancing code readability and maintainability. The change is as follows:

// Before export const { autoIncPrimaryKey: autoIncPK } = gm.keys; export const { ulidPrimaryKey: ulidPrimaryKey } = gm.keys;

// After export const { autoIncPrimaryKey: autoIncPK, ulidPrimaryKey: ulidPrimaryKey } = gm.keys;

This adjustment not only simplifies the code but also aligns with best practices for exporting named constants from a module. The consolidated export statement is now more concise and easier to comprehend, contributing to a cleaner and more efficient codebase.