
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
default-proxy-handler
Advanced tools
A template for creating npm packages using TypeScript and VSCode
• Const DefaultProxyHandler: <T>() => DefaultProxyHandler<T>
• new DefaultProxyHandler<T>(): DefaultProxyHandler<T>
A class of proxy handler that forward all properties and methods to the original target.
DefaultProxyHandler can be used as the super class for creating a more
sophisticated proxy handler.
Example
A proxy whose handler is an DefaultProxyHandler should have the same
properties as the original object.
import { DefaultProxyHandler } from 'default-proxy-handler';
const helloWorld = { hello: 'world' };
const helloWorldProxy = new Proxy(helloWorld, new DefaultProxyHandler());
expect(helloWorldProxy.hello).toBe(helloWorld.hello);
Example
You can extend DefaultProxyHandler to change the behavior of the proxy.
import { DefaultProxyHandler } from 'default-proxy-handler';
class RepeatedProxyHandler extends DefaultProxyHandler<{ hello: string }> {
override get(target: { hello: string; }, p: string | symbol, receiver: any) {
const originalValue: unknown =
super.get(target, p, receiver);
return [ originalValue, originalValue ];
}
}
const helloWorld = { hello: 'world' };
const helloWorldProxy = new Proxy(helloWorld, new RepeatedProxyHandler());
expect(helloWorldProxy.hello).toEqual(['world', 'world']);
| Name | Type |
|---|---|
T | extends object |
| Name | Type |
|---|---|
T | extends object |
ProxyHandler<T>
↳ DefaultProxyHandler
▸ apply(target, thisArg, argArray): any
| Name | Type |
|---|---|
target | T |
thisArg | any |
argArray | any[] |
any
ProxyHandler.apply
▸ construct(target, argArray, newTarget): object
| Name | Type |
|---|---|
target | T |
argArray | any[] |
newTarget | Function |
object
ProxyHandler.construct
▸ defineProperty(target, property, attributes): boolean
| Name | Type |
|---|---|
target | T |
property | string | symbol |
attributes | PropertyDescriptor |
boolean
ProxyHandler.defineProperty
▸ deleteProperty(target, p): boolean
| Name | Type |
|---|---|
target | T |
p | string | symbol |
boolean
ProxyHandler.deleteProperty
▸ get(target, p, receiver): any
| Name | Type |
|---|---|
target | T |
p | string | symbol |
receiver | any |
any
ProxyHandler.get
▸ getOwnPropertyDescriptor(target, p): undefined | PropertyDescriptor
| Name | Type |
|---|---|
target | T |
p | string | symbol |
undefined | PropertyDescriptor
ProxyHandler.getOwnPropertyDescriptor
▸ getPrototypeOf(target): null | object
| Name | Type |
|---|---|
target | T |
null | object
ProxyHandler.getPrototypeOf
▸ has(target, p): boolean
| Name | Type |
|---|---|
target | T |
p | string | symbol |
boolean
ProxyHandler.has
▸ isExtensible(target): boolean
| Name | Type |
|---|---|
target | T |
boolean
ProxyHandler.isExtensible
▸ ownKeys(target): ArrayLike<string | symbol>
| Name | Type |
|---|---|
target | T |
ArrayLike<string | symbol>
ProxyHandler.ownKeys
▸ preventExtensions(target): boolean
| Name | Type |
|---|---|
target | T |
boolean
ProxyHandler.preventExtensions
▸ set(target, p, newValue, receiver): boolean
| Name | Type |
|---|---|
target | T |
p | string | symbol |
newValue | any |
receiver | any |
boolean
ProxyHandler.set
▸ setPrototypeOf(target, v): boolean
| Name | Type |
|---|---|
target | T |
v | null | object |
boolean
ProxyHandler.setPrototypeOf
FAQs
A template for creating npm packages using TypeScript and VSCode
The npm package default-proxy-handler receives a total of 3 weekly downloads. As such, default-proxy-handler popularity was classified as not popular.
We found that default-proxy-handler 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.