
Security News
CISA Rebuffs Funding Concerns as CVE Foundation Draws Criticism
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Does repetition in code bother you to what others call an unreasonable degree?
Is DRY (Don't Repeat Yourself) such a governing rule when you write code that you regularly apply it to real life scenarios?
Do blocks of code with even this level of repetition offend you at a visceral level?
let thing = operator('thing')
let aThing = operator('aThing')
let thisThing = operator('thisThing')
let thatThing = operator('thatThing')
let theOtherThing = operator('theOtherThing')
Be offended no more: just make it drier
!
let {thing, aThing, thisThing,
thatThing, theOtherThing} = require('drier')(operator)
...and through the magic of destructuring and proxies, never stutter variables in code again!
drier
is a function which invokes its input function with a string of each variable name on the left of the destructuring assignment,
removing the need to repeat them, and maybe encouraging more meaningful names.
Or you could describe it as an iterator across variable names.
const drier = require('./drier.js')
const dryquire = drier(require)
const {fs, crypto, util, http, os, repl, express, "package.json":{scripts}} = dryquire
const {sqlA, sqlB, sqlC, sqlD} = drier(s => fs.readFileSync(`${__dirname}/${s}.sql`))
FAQs
eliminate repetition or stutter in assignments
We found that drier 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
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.