
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@feedmepos/custom-attributes
Advanced tools
The `@feedmepos/custom-attributes` package provides a set of tools to manage and filter custom attributes for entities such as restaurants. The main features include:
The @feedmepos/custom-attributes
package provides a set of tools to manage and filter custom attributes for entities such as restaurants. The main features include:
FmCustomAttributeFilter
A vue component that enables users to build complex filter queries based on custom attributes.mongoQuery
A function that evaluates MongoDB-style queries against custom attribute data to determine if they match the specified rules.The mongoQuery
function is used to evaluate a set of rules against custom attribute data. It takes two parameters: the data to be evaluated and the rule to be applied. The function returns a boolean indicating whether the data matches the rule.
pnpm install
pnpm dev
pnpm install @feedmepos/custom-attributes
import '@feedmepos/custom-attributes/style.css';
import { FmCustomAttributeFilter } from '@feedmepos/custom-attributes';
<FmCustomAttributeFilter
:attributes="[
{ key: 'name', type: 'string', entity: 'restaurant' },
{ key: 'region', type: 'string', entity: 'restaurant' },
{ key: 'staffCount', type: 'number', entity: 'restaurant' },
{ key: 'memberCount', type: 'number', entity: 'restaurant' },
]"
:model-value="filter"
@update:model-value="(v) => (filter = v)"
/>
/**
* filter = { "logic": "AND", "rules": [ { "logic": "AND", "rules": [ { "property": "name", "operator": "$eq", "value": "123" } ] }, { "logic": "AND", "rules": [ { "property": "region", "operator": "$eq", "value": "123" } ] }, { "logic": "AND", "rules": [ { "property": "name", "operator": "$eq", "value": "123123" }, { "property": "staffCount", "operator": "$eq", "value": 123 } ] } ] }
*
* values: FdoCustomAttribute = {
* name: '123',
* region: '123',
* staffCount: 123,
* memberCount: 123123
* }
*/
const testResult = mongoQuery(values, filter);
const result = restaurants.filter((r) => mongoQuery(r.customAttribute, filter));
FAQs
## Package Features
The npm package @feedmepos/custom-attributes receives a total of 68 weekly downloads. As such, @feedmepos/custom-attributes popularity was classified as not popular.
We found that @feedmepos/custom-attributes demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.