Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
encodeuri-plus
Advanced tools
encodeURI that is safe, and doesn't do too much in a specific scenario
Minimally and safely encode URIComponents for use in shorter URLs. Avoid Percent-encoding.
export interface IURLEncoderOptions {
/**
* Do not encode non-ASCII, i.e. `/[^\x00-\x7F]/`
*
* @default true
*/
allowNonAscii?: boolean
/**
* Do not encode
*/
keep?: (string | RegExp)[]
/**
* Fallback with `fixedEncodeURIComponent`, which is a stricter version of `encodeURIComponent`
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
*
* As `fixedEncodeURIComponent` will NOT encode UNRESERVED characters
* and `/`, `\` may throw errors even if they are percent-encoded.
* Further force encoding is required -- `StarEncoder.encode`.
*
* For `.`, `..`, as long as it is not alone, it should work.
* Perhaps prefix it with `~` (as it will not be URI_encoded)?
*/
forceEncode?: (string | RegExp)[]
/**
* Throw error if matches
*/
throws?: (string | RegExp)[]
/**
* `encodeURI` is required to make RESERVED set work by default.
*
* However, it can be enhanced with `forceEncode`
*
* @default encodeURI
*/
encoder?: (s: string) => string
/**
* decodeURIComponent seems to decode all percent-encoded anyway, and doesn't need fallback.
*
* @default decodeURIComponent
*/
decoder?: (s: string) => string
/**
* Set to `false` to disable error
*/
onError?: boolean | ((e: Error) => any)
}
Path params seem to have to most limitations. Avoid ./\
, or encode it first.
This library has no dependencies, and is browser-compatible, therefore
<script src="https://unpkg.com/encodeuri-plus"></script>
Also available on NPM.
npm i encodeuri-plus
FAQs
encodeURI that is safe, and doesn't do too much in a specific scenario
The npm package encodeuri-plus receives a total of 8 weekly downloads. As such, encodeuri-plus popularity was classified as not popular.
We found that encodeuri-plus 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.