Skip to content

WIP: Implemented the 'lookups' function and added documentation for it.#47

Open
jesselee34 wants to merge 1 commit intomainfrom
fields-utility
Open

WIP: Implemented the 'lookups' function and added documentation for it.#47
jesselee34 wants to merge 1 commit intomainfrom
fields-utility

Conversation

@jesselee34
Copy link
Copy Markdown
Contributor

The lookups function accepts a RegentRule and returns an array of the lookups referenced by that rule. The RegentRule provided can be arbitrarily complex.

Arguments

  • RegentRule (Plain Object)

Returns

Array: an array containing all the lookups present in the provided rule.

Example

import { equals, lessThan, lookups } from 'regent';

const isRaining = equals('@weather.precipitation', true);
const isCalm = lessThan('@weather.wind.speed', 25);
const isRainingAndCalm = and(isRaining, isCalm);

const paths = lookups(isRainingAndCalm);

// [
//   '@weather.precipitation',
//   '@weather.wind.speed',
// ]

@jesselee34 jesselee34 changed the title Implemented the 'lookups' function and added documentation for it. WIP: Implemented the 'lookups' function and added documentation for it. Sep 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant