# @udia/deep-proxy

> Utility function for creating a deep proxy of an object.

Latest version **1.0.2** (published 2022-08-29) · AGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @udia/deep-proxy
pnpm add @udia/deep-proxy
yarn add @udia/deep-proxy
bun add @udia/deep-proxy
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-08-29 |
| First published | 2022-08-28 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexander Wong |
| Maintainers | awwong1 |

## Links

- npm: https://www.npmjs.com/package/@udia/deep-proxy
- Repository: https://github.com/udiaca/common
- Homepage: https://github.com/udiaca/common#readme
- Issues: https://github.com/udiaca/common/issues
- npm.io page: https://npm.io/package/@udia/deep-proxy

## Recent versions

- 1.0.2 (latest) — 2022-08-29
- 1.0.1 — 2022-08-28
- 1.0.0 — 2022-08-28

## README

# @udia/deep-proxy

[![udia-deep-proxy-npmjs-badge]][udia-deep-proxy-npmjs]
[![udia-deep-proxy-build-test-badge]][udia-deep-proxy-build-test]

Function for creating deep object proxy.

See also [JavaScript Proxy object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)

## Example

```bash
npm i @udia/deep-proxy
# or
yarn add @udia/deep-proxy
```

```javascript
import deepProxy from '@udia/deep-proxy'

const stub = { attr: { foo: 'bar' } }

const stubProxy = deepProxy(stub, {
  set(root, target, path, value, receiver) {
    setStub(root, target, path, value, receiver)
    console.log('==== property set called!')
    return true
  },
  deleteProperty(root, target, path) {
    delPropStub(root, target, path)
    return true
  },
})

stubProxy.attr.foo = 'barrio'
// ==== property set called!
```

## License

[`AGPL-3.0`](../../LICENSE)

```text
Copyright (C) 2021-2022 Alexander Wong <alex@udia.ca>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.
```

[udia-deep-proxy-gh]: https://github.com/udiaca/common/tree/main/packages/udia-deep-proxy
[udia-deep-proxy-npmjs-badge]: https://badge.fury.io/js/@udia%2Fdeep-proxy.svg
[udia-deep-proxy-npmjs]: https://www.npmjs.com/package/@udia/deep-proxy
[udia-deep-proxy-build-test-badge]: https://github.com/udiaca/common/actions/workflows/udia-deep-proxy-build-test.yml/badge.svg
[udia-deep-proxy-build-test]: https://github.com/udiaca/common/actions/workflows/udia-deep-proxy-build-test.yml

---
_Source: https://npm.io/package/@udia/deep-proxy · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
