netspective-labs / sql-aide

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

Refactor Key Assignments for Improved Code Clarity #169

Closed jobyjames1 closed 1 year ago

jobyjames1 commented 1 year 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.