UNPKG

@rxap/schematics-ts-morph

Version:

This package provides utilities for manipulating TypeScript code using ts-morph, particularly for Angular and NestJS projects. It offers functions to add, coerce, and modify code elements like classes, methods, decorators, and imports. The package also in

17 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CoerceTableSelectOperationRule = CoerceTableSelectOperationRule; const utilities_1 = require("@rxap/utilities"); const coerce_get_page_operation_1 = require("./coerce-get-page-operation"); function CoerceTableSelectOperationRule(options) { const { propertyList = [], idProperty, rowDisplayProperty, rowValueProperty = idProperty, } = options; if (!rowValueProperty) { throw new Error('The row value property is required'); } (0, utilities_1.CoerceArrayItems)(propertyList, [ Object.assign(Object.assign({}, rowValueProperty), { name: '__value', source: rowValueProperty.name }), Object.assign(Object.assign({}, rowDisplayProperty), { name: '__display', source: rowDisplayProperty.name }) ], { compareTo: (a, b) => a.name === b.name, unshift: true }); return (0, coerce_get_page_operation_1.CoerceGetPageOperation)(Object.assign(Object.assign({}, options), { propertyList: propertyList, idProperty })); } //# sourceMappingURL=coerce-table-select-operation.js.map