Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@reverecre/next-query-params
Advanced tools
@reverecre/next-query-params
enum QueryParamKind
Members:
STRING
: Immediately flushed single string value.STRING_DEFERRED
: String value that uses local state updates and defers updating the URL.STRING_LIST
: Value is set multiple times in the URL, decoded as a list.STRING_SET
: Value is set multiple times in the URL, decoded as a set.STRING_LIST_DEFAULT_UNDEFINED
: Value is undefined when not present, a list when it is.STRING_REQUIRED
: String value that will throw an error if not found.NUMBER
: Parsed and serialized as a number.NUMBER_DEFERRED
: Number value that uses local state updates and defers updating the URL.parseQuery
Returns a normalized value of a parsed query param object.
Example Usage
import { parseQuery, QueryParamKind } from "@reverecre/next-query-params";
const { sortDir } = parseQuery(req.query, {
sortDir: QueryParamKind.STRING,
});
QueryParamsProvider
Provides an application with the shared query parameter state. This is used to sync deferred updates across the application.
useQueryParams
A hook that reads from Next.js's useQuery
and returns read, write, and reset functions.
Example Usage
import {
QueryParamKind,
QueryParamsProvider,
useQueryParams,
} from "@reverecre/next-query-params";
function MyApp() {
return (
<QueryParamsProvider>
<MyComponent />
</QueryParamsProvider>
);
}
function MyComponent() {
const [query, setQuery, resetQuery] = useQueryParams({
sortDir: QueryParamKind.STRING,
sortBy: QueryParamKind.STRING,
search: QueryParamKind.STRING_DEFERRED,
selectedOptions: QueryParamKind.STRING_SET,
});
const updateSearch = useCallback(
(next: string) => {
setQuery({ search: next });
},
[setQuery]
);
// ...
}
FAQs
## API
The npm package @reverecre/next-query-params receives a total of 12 weekly downloads. As such, @reverecre/next-query-params popularity was classified as not popular.
We found that @reverecre/next-query-params demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.