UNPKG

kanel-kysely

Version:
22 lines (21 loc) 825 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.kyselyCamelCaseHook = void 0; const recase_1 = require("@kristiandupont/recase"); const toCamelCase = (0, recase_1.recase)(null, "camel"); const kyselyCamelCaseHook = (output) => Object.fromEntries(Object.entries(output).map(([path, fileContents]) => [ path, { ...fileContents, declarations: fileContents.declarations.map((declaration) => declaration.declarationType === "interface" ? { ...declaration, properties: declaration.properties.map((property) => ({ ...property, name: toCamelCase(property.name), })), } : declaration), }, ])); exports.kyselyCamelCaseHook = kyselyCamelCaseHook;