Giter Club home page Giter Club logo

common-xtext-expression-language's People

Contributors

ashpak-shaikh avatar bhavinshah7 avatar cnachino avatar hipstersmoothie avatar ishanidoshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

common-xtext-expression-language's Issues

Validate format for dateFormat and addToDate method

Is your feature request related to a problem? Please describe.

dateFormat and addToDate function does not validate the dateFormat supplied as input to the function and accepts any String.

Describe the solution you'd like

Restrict access to only valid dateFormats supported by SimpleDateFormat. The validation should be compile-time rather than at runtime.

Additional context

See Xtext Validations for pointers. You will either need to change the grammar or add custom validation.

Sorting support for primitive arrays

Is your feature request related to a problem? Please describe.

The sort function does not support sorting primitive arrays like below
sort(["foo", "bar", "foobar"])

Describe the solution you'd like
Support the example above

Add primitive array support for filter function.

Is your feature request related to a problem? Please describe.

The filter function does not support filtering primitive arrays like below
filter(["foo", "bar", "foobar"], length(it)==3)

This is mainly because it does not support the it reference

Describe the solution you'd like

Add support for it operator in filter function, so that it supports primitive array

Get difference in days/weeks/months/years between 2 dates

Is your feature request related to a problem? Please describe.

Given 2 dates, the function should return the difference in days/weeks/months/years

Describe the solution you'd like

Given 2 dates in a given format, I should be able to get the difference in either DAYS/WEEKS/MONTHS/YEAR.
Syntax: dateDifference(input1, input2, format, chronoUnit)

ChronoUnit values:
DAYS
WEEKS
MONTHS
YEARS

Formats it should support:
MM/dd/yyyy
yyyyMMdd
yyyy-MM-dd

Open to other suggestions for syntax

Add support to show dayOfWeek

Is your feature request related to a problem? Please describe.

The feature should provide the dayOfWeek for a given date

Describe the solution you'd like

Given a date (not the timestamp part), the feature should provide the day of the week -> dayOfWeek(input, format)
Open to other suggestions for the syntax
Format:
MM/dd/yyyy
yyyyMMdd
yyyy-MM-dd

Add support for primitive arrays in remove function

Is your feature request related to a problem? Please describe.

The filter function does not support filtering primitive arrays like below
remove(["foo", "bar", "foobar"], length(it)==3)

This is mainly because it does not support it reference

Describe the solution you'd like

Add support for it operator in remove function, so that it supports a primitive array

Improve code coverage

Is your feature request related to a problem? Please describe.

Code coverage is low because of insufficient tests

Describe the solution you'd like

Add tests to bring the coverage up.

Additional context

Tests are written in spock groovy framework.

Support `it` keyword in map function

Is your feature request related to a problem? Please describe.
I have an array of objects like below

[ 
  {...},
  {...}
  ...
]

I want to map it to a new array like below

[
  { "someKey" : {...} },
  { "someKey" : {...} },
  ...
]

It is not possible to perform such a transformation using the map method.

Describe the solution you'd like

Below is an example of pickFIrst function usage.

pickFirst(a,b,c -> it != null)

It already has a concept of it reference, which is a self-reference to the current object while iterating over a,b and c.

We can apply this concept to the map function so that the above transformation can be achieved by

map(myArray -> {
  someKey = it
 })

Describe alternatives you've considered
None of the supported functions support this usecase

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.