Skip to content

Releases: CarbonPackages/Carbon.Eel

1.12.0

18 May 14:23
1aa275c
Compare
Choose a tag to compare

✨ Features

Carbon.String.merge(mixed1, mixed2, mixedN)

Merge strings and arrays to a string with unique values, separated by an empty space.

Examples:

Expression Result
Carbon.String.merge('', 'one') 'one'
Carbon.String.merge(['one two three'], ['one', 'four']) 'one two three four'
Carbon.String.merge(null, null) null
Carbon.String.merge('one two three', ['one', 'four'] 'one two three four'

Return The merged string

Carbon.Array.check(variable)

Check if a variable is iterable and has items

Return The variable or null if it is empty or not an iterable

Carbon.Array.intersect(firstArray, secondArray)

Returns an array containing all the values of firstArray that are present in all the arguments.

Carbon.Array.length(array)

The method counts elements of a given array or a countable object. Return 0 if it is not an countable object.

count = ${Carbon.Array.length(countable)}

Carbon.Array.hasKey(array, key)

Returns a boolean if the array has a specific key

bool = ${Carbon.Array.hasKey(array, key)}

Carbon.Array.hasValue(array, value)

Returns a boolean if the array has a specific value

bool = ${Carbon.Array.hasValue(array, value)}

Carbon.Array.getValueByPath(array, path)

Returns the value of a nested array by following the specified path.

value = ${Carbon.Array.getValueByPath(array, path)}

Carbon.Array.setValueByPath(array, path)

Sets the given value in a nested array or object by following the specified path.

array = ${Carbon.Array.setValueByPath(subject, path, value)}

Carbon.Date.secondsUntil(string)

Return seconds until the given offset. . Very useful for maximumLifetime on the @cache entry.

  • string (string) The offset in DateInterval format starting from midnight
  • dateinerval (boolean, optional) true if interval should be used or the $offset should be parsed, defaults to true

In this example, we clear the cache at midnight by adding an offset of 0 hours.

@cache {
    mode = 'cached'
    maximumLifetime = ${Carbon.Date.secondsUntil('PT0H')}
    ...
}

To get the seconds until next year, you can do it like this:

secondUntilNextYear = ${Carbon.Date.secondsUntil('first day of January next year', false)}

Return The timespan in seconds (integer)

Carbon.Date.timeToDateInterval(string)

Convert time duration (1:00) into a DateInterval

Return The duration as DateInterval

1.11.0

27 Feb 01:29
2219267
Compare
Choose a tag to compare

✨ Feature

Add decimalDigits helper

🐛 Bugfix

Number of digits in number helper

1.10.0

17 Feb 21:07
92c7ce9
Compare
Choose a tag to compare

✨ Add backend helper

  • Carbon.Backend.language(): Return interface language
  • Carbon.Backend.translate(id, originalLabel, arguments, source, package, quantity, locale) Translate string in the interface language

1.9.0

11 Dec 19:14
523c647
Compare
Choose a tag to compare

⬆️ Allow next version of Flow

1.8.0

18 Nov 15:51
f84dce9
Compare
Choose a tag to compare

✨ Add Number helper

1.7.1

25 Jun 09:50
8eef12f
Compare
Choose a tag to compare

🐛 Fix PropTypes decleration

1.7.0

17 Nov 22:39
1fa3be4
Compare
Choose a tag to compare

✨ Add extended pregReplace string helper (with limit option)

1.6.3

14 Oct 22:16
Compare
Choose a tag to compare

♻️ Replace Eel call on fusion prototype
♻️ Integrate BEM functions as service

1.6.2

23 Sep 06:06
3d74acb
Compare
Choose a tag to compare

⬆️ Relax version constraint for Flow 6

1.6.1

19 Aug 15:33
Compare
Choose a tag to compare

🐛 BEM helper accept now also integers as modifiers