
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
object-search-key
Advanced tools
Match the appropriate search keywords according to the key value definition of the object
Match the appropriate search keywords according to the key value definition of the object. Use yaml-joi as validator.
$ npm install object-search-key
or
$ yarn add object-search-key
import { getObjectSearchKeys } from 'object-search-key';
const AccountModelDefine = `
type: object
isSchema: true
limitation:
- keys:
id:
type: number
isSchema: true
limitation:
- min: 0
- max: 999999999
- integer: []
name:
type: string
isSchema: true
limitation:
- max: 32
age:
type: number
isSchema: true
limitation:
- min: 0
- integer: []
locked:
type: string
isSchema: true
limitation:
- only: [Y, N]
`;
const searchInput = '-123 hele xiaohuoni 24 1.2 N'.split(/(?:\s*)/);
const search = getObjectSearchKeys(AccountModelDefine, searchInput);
/**
* Result:
* {
* id: [24],
* name: ['-123', 'hele', 'xiaohuoni', '24', '1.2', 'N'],
* age: [24],
* locked: ['N'],
* }
*/
const or = Object.entries(search).reduce((prev, [key, value]) => {
return prev.concat(value.map(searchKey => ({ [key]: searchKey })));
}, []);
sequelize.Account.findAndCountAll({ where: { [Op.or]: or } });
/**
* [
* { id: '123' },
* { id: '24' },
* { name: '123' },
* { name: 'hele' },
* { name: 'xiaohuoni' },
* { name: '24' },
* { name: '1.2' },
* { name: 'N' },
* { age: '123' },
* { age: '24' },
* { locked: 'N' },
* ]
*/
Get more at cases.yml.
FAQs
Match the appropriate search keywords according to the key value definition of the object
The npm package object-search-key receives a total of 6 weekly downloads. As such, object-search-key popularity was classified as not popular.
We found that object-search-key demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.