Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
pogo-builder
Advanced tools
npm i pogo-builder
Path: The first argument is a path string. With in the path
a :
represents a seperate key and defaults to an object. The terminal key in a path
defaults to an object if no data
is provided. []
at the end of a key represents an array; to have an array mid path, prefix the :
with a []
.
ex: foo:bar[]:fizz
becomes { foo: bar: [{ fizz: { } }] }
.
Data: The second argument is any data you want to be stored at the end of the object described in the path.
Reducing Object: The third argument is the object to add to, defaults to an object. If the terminal keys overlap with existing data in both, the data
argument will overwrite other values. However, if both are objects or both are arrays they will be combined. (Order preference to the data in the reducing object's array.)
// ex:
pogo(`foo:bar`, true, { foo: { bar: false } }) // => { foo: { bar: true } }
pogo(`foo:bar`, { fizz: {} }, { foo: { bar: { buzz: {} } } }) // => { foo: { bar: { buzz: {}, fizz: {} } } }
pogo(`foo:bar[]`, 5, { foo: { bar: [9] } }) // => { foo: { bar: [9, 5] } }
// more examples
const pogo = require('pogo')
// simple object
pogo('foo:bar') // => { foo: { bar: {} } }
// simple object with arr
const pojo = pogo('foo:bar[]') // => { foo: { bar: [] } }
pogo('foo:bar') // => { foo: { bar: {} } }
// simple object with arr and with data
const pojo = pogo('foo:bar[]', { fizz: true }) // => { foo: { bar: [{bar: true}] } }
// can add to and merge complex objects or arrays
pogo('foo:bar[]', { buzz: true }, pojo) // => { foo: { bar: [{ fizz: true }, { buzz: true }] })
Having written so many elasticsearch queries out by hand I wanted a simple way to build them without being tied to orm or something bulky. Pogo allows you to maintain fine control over queries while simplifying writing them.
FAQs
Javascript Pojo Builder
The npm package pogo-builder receives a total of 0 weekly downloads. As such, pogo-builder popularity was classified as not popular.
We found that pogo-builder 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.