Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.