Skip to content

Commit 6fc7847

Browse files
committed
update compiles TS
1 parent b3306f3 commit 6fc7847

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/expression-utils.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { Expression } from "./types";
22
export declare class ExpressionUtils {
3-
private _defaultColumnSeparator;
4-
constructor(_defaultColumnSeparator?: string);
3+
private _defaultSeparator;
4+
constructor(_defaultSeparator?: string);
55
getValueByExpression<T>(instance: any, expression: Expression<T>): any;
66
getValueByProperties(instance: any, properties: string[]): any;
77
getValue(instance: any, property: string): any;
8-
getColumnByExpression<T>(expression: Expression<T>): string;
9-
getColumnByProperties(properties: string[]): string;
8+
getColumnByExpression<T>(expression: Expression<T>, separator?: string): string;
9+
getColumnByProperties(properties: string[], separator?: string): string;
1010
getPropertiesByExpression<T>(expression: Expression<T>): string[];
1111
private getPropertiesByExpressionString(expression);
1212
private getColumnByLambdaExpression<T>(expression);

src/expression-utils.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"use strict";
22
Object.defineProperty(exports, "__esModule", { value: true });
33
var ExpressionUtils = (function () {
4-
function ExpressionUtils(_defaultColumnSeparator) {
5-
if (_defaultColumnSeparator === void 0) { _defaultColumnSeparator = "_"; }
6-
this._defaultColumnSeparator = _defaultColumnSeparator;
4+
function ExpressionUtils(_defaultSeparator) {
5+
if (_defaultSeparator === void 0) { _defaultSeparator = "_"; }
6+
this._defaultSeparator = _defaultSeparator;
77
}
88
ExpressionUtils.prototype.getValueByExpression = function (instance, expression) {
99
return expression(instance);
@@ -22,11 +22,13 @@ var ExpressionUtils = (function () {
2222
}
2323
return void 0;
2424
};
25-
ExpressionUtils.prototype.getColumnByExpression = function (expression) {
26-
return this.getColumnByProperties(this.getPropertiesByExpression(expression));
25+
ExpressionUtils.prototype.getColumnByExpression = function (expression, separator) {
26+
if (separator === void 0) { separator = this._defaultSeparator; }
27+
return this.getColumnByProperties(this.getPropertiesByExpression(expression), separator);
2728
};
28-
ExpressionUtils.prototype.getColumnByProperties = function (properties) {
29-
return properties.join(this._defaultColumnSeparator);
29+
ExpressionUtils.prototype.getColumnByProperties = function (properties, separator) {
30+
if (separator === void 0) { separator = this._defaultSeparator; }
31+
return properties.join(separator);
3032
};
3133
ExpressionUtils.prototype.getPropertiesByExpression = function (expression) {
3234
var strAfterReturn = expression.toString().split("return")[1].trim();

0 commit comments

Comments
 (0)