0.1.4 • Published 5 years ago

lambda-expression v0.1.4

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

npm version

lambda-expression

Utility to analyze function (js) and arrow functions (ts), and create metadata of expressions, the initial scope is that it seeks to solve simple expressions. And later advance to encompass complex expressions.

Created use to Typescript

Usage

First, install the package using npm:

npm install lambda-expression --save

In Typescript:

import { ExpressionUtils, Expression } from "lambda-expression";

export class ExpressionUsage {

    private readonly _expressionUtils: ExpressionUtils;

    constructor() {
        this._expressionUtils = new ExpressionUtils();
    }

    public expression<T>(exp: Expression<T>){
        console.log(this._expressionUtils.getColumnByExpression(exp));
    }

    public test(){
        this.expression<ModelTest>(x => x.id); // id
        this.expression<ModelTest>(x => x.description); // description
        this.expression<ModelTest>(x => x.date); // date
        this.expression<ModelTest>(x => x.isValid); // isValid
        this.expression<ModelTest>(x => x.reference.name); // reference_name
    }
}

class ModelTest{
    id: number;
    name: string;
    description: string;
    date: Date;
    isValid: boolean;
    reference: ReferencesModelTest;
}

class ReferencesModelTest{
    id: number;
    name: string;
}

License

Apache 2.0

0.1.4

5 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.10

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago