Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
blacklight-querystring
Advanced tools
Parse/stringify Blacklight query strings to/from normalized search objects. Uses qs under the hood.
npm install blacklight-querystring
var blqs = require('blacklight-querystring')
blqs.parse(queryString)
Parses a query string generated by Blacklight into an object with query
,
facets
, and options
keys. Values are uri-decoded and numeric-ish strings
are parsed into numbers.
query
is the search query used against Blacklight. The value is url-decoded.
(default: ''
)
var parsed = blqs.parse('q=cats+AND+dogs')
console.log(parsed.query)
// {
// query: 'cats AND dogs',
// }
facets
contains facet values found in the query string with the key wrapped
in f[
and ][]
. (default: {}
)
var parsed = blqs.parse('f%5Bformat_physical%5D%5B%5D=Videocassette+(VHS)')
console.log(parsed.facets)
// {
// facets: {
// format_physical: [
// 'Videocassette (VHS)'
// ]
// }
// }
options
contains values that are neither the query
or facets
. Keys/values
using object notation are parsed into objects. (default: {}
)
var parsed = blqs.parse('per_page=25&range%5Bpub_date%5D%5Bstart%5D=1991')
console.log(parsed.options)
// {
// per_page: 25,
// range: {
// pub_date: {
// begin: 1990
// }
// }
// }
blqs.stringify(obj)
Converts an object with keys query
, facets
, and options
into a query string
recognized by Blacklight. A query
key is converted to the key k
in the query
string, and facets
to f
.
var obj = {
query: 'cats AND dogs',
facets: {
format_physical: [
'Videocassette (VHS)'
],
},
options: {
per_page: 25,
range: {
pub_date: {
begin: 1990
}
}
}
}
console.log(blqs.stringify(queryObj))
// 'q=cats+AND+dogs&f%5Bformat_physical%5D%5B%5D=Videocassette+%28VHS%29&per_page=25&range%5Bpub_date%5D%5Bbegin%5D=1990'
GPL-3.0
FAQs
parse/stringify Blacklight search querystrings
We found that blacklight-querystring 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
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.