Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@cheprasov/url-query-params
Advanced tools
The URLQueryParams class defines utility methods to work with the query string of a URL. It is a good replacement for standard URLSearchParams class
npm i @cheprasov/url-query-params
The URLQueryParams class defines utility methods to work with the query string of a URL. It is a good replacement for standard URLSearchParams class.
An object implementing URLQueryParams can directly be used in a for...of
structure.
application/x-www-form-urlencoded
format. While it's suitable for decoding URL queries, for encoding it can lead to unexpected results such as spaces being encoded as +
and extra characters such as ~
being percent-encoded.*
.> npm i @cheprasov/url-query-params
Import in .js / .ts file:
import { URLQueryParams } from '@chepraspv/url-query-params';
import { URLQueryParams } from '@chepraspv/url-query-params';
new URLQueryParams('foo=bar baz').toString(); // foo=bar%20baz
new URLQueryParams('a=1&b=2&c=3').toObject(); // { a: 1, b: 2, c: 3 }
// Returns a URLSearchParams object instance.
new URLQueryParams(init?: string[][] | Record<string, string> | string | URLSearchParams | URLQueryParams)
// Appends a specified key/value pair as a new search parameter.
URLQueryParams.append(name: string, value: string): void
// Deletes the given search parameter, and its associated value, from the list of all search parameters.
URLQueryParams.delete(name: string): void
// Returns an iterator allowing iteration through all key/value pairs contained in this object.
URLQueryParams.entries(): IterableIterator<[string, string]>
// Allows iteration through all values contained in this object via a callback function.
URLQueryParams.forEach(callbackfn: (value: string, key: string, parent: URLQueryParams) => void, thisArg?: any): void
// Returns the first value associated with the given search parameter.
URLQueryParams.get(name: string): string | null
// Returns all the values associated with a given search parameter.
URLQueryParams.getAll(name: string): string[]
// Returns a boolean value indicating if such a given parameter exists.
URLQueryParams.has(name: string): boolean
// Returns an iterator allowing iteration through all keys of the key/value pairs contained in this object.
URLQueryParams.keys(): IterableIterator<string>
// Sets the value associated with a given search parameter to the given value. If there are several values, the others are deleted.
URLQueryParams.set(name: string, value: string): void
// Sorts all key/value pairs, if any, by their keys.
URLQueryParams.sort(): void
// Returns new object created from key/values params.
URLQueryParams.toObject(): Record<string, string>
// Returns a string containing a query string suitable for use in a URL.
URLQueryParams.toString(): string
// Returns an iterator allowing iteration through all values of the key/value pairs contained in this object.
URLQueryParams.values(): IterableIterator<string>
Feel free to fork project, fix bugs, write tests and finally request for pull
FAQs
The URLQueryParams class defines utility methods to work with the query string of a URL. It is a good replacement for standard URLSearchParams class
The npm package @cheprasov/url-query-params receives a total of 18 weekly downloads. As such, @cheprasov/url-query-params popularity was classified as not popular.
We found that @cheprasov/url-query-params demonstrated a healthy version release cadence and project activity because the last version was released less than 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.