Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@particles/configurable-field-set
Advanced tools
Functions to determine column visibility and requiredness.
Functions to determine column visibility and requiredness.
isVisible(Object)(Object)(String) => Boolean
A function for checking if a column is visible or not. Returns true
if the item cannot be found.
isVisible = (
// defines frontend names to match to the corresponding
// backend configurable_field_set field names
nameMapObj: { someName: 'field_set_name' },
) => (
// the object of configurable_field_set field names
sourceOfValuesObj: { field_set_name: { visible: Boolean } },
) => (
'someName'
) =>
returns Boolean
isRequired(Object)(Object)(String) => Boolean
A function for checking if a column is required or not. Returns false
if the item cannot be found.
isRequired = (
// defines frontend names to match to the corresponding
// backend configurable_field_set field names
nameMapObj: { someName: 'field_set_name' },
) => (
// the object of configurable_field_set field names
sourceOfValuesObj: { field_set_name: { required: Boolean } },
) => (
'someName'
) =>
returns Boolean
filterVisibleColumns(Object)(Object)(Array, String) => Array
A function for filtering an array of columns to only visible columns.
filterVisibleColumns = (
// defines frontend names to match the corresponding
// backend configurable_field_set field names
nameMapObj: { someName: 'field_set_name' },
) => (
// the object of configurable_field_set field names
sourceOfValuesObj: { field_set_name: { visible: Boolean } },
) => (
// some arbitrary array of columns
columnsArr = [{ [colKey]: 'someName' }],
colKey: 'key' // defaults to 'key'
) =>
returns []
aggregateVisibility(Array) => Object
A function that takes in an array of CFS fields objects and returns a new set of fields where the visibility of each field is set to true if ANY of the input fieldsets have that field set to "visible: true", otherwise set to false.
aggregateVisibility = (
[
{ name: { visible: true }, status: { visible: true }, contact: { visible: false }},
{ name: { visible: true }, status: { visible: false }, contact: { visible: false }},
],
) =>
returns {} // { name: { visible: true }, status: { visible: true }, contact: { visible: false } }
'visible'
, has been removed from isVisible()(undefined, 'visible')()
. This is in order to determine keys soonertrue
, has been removed from isVisible(undefined, true)()()
. This is in order to determine defaults for different keys soonertrue
, has been removed from filterVisibleColumns()(undefined, true)()
. This is in order to determine defaults for different keys soonerisRequired
visibleColumns
is now filterVisibleColumns
, already knowing it's filter func. And filterVisibleColumns
is now visibleColumns
, needing a filter funcFAQs
Functions to determine column visibility and requiredness.
We found that @particles/configurable-field-set demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 27 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.