# @kingjs/property-descriptor.rename

> Renames functions found in a descriptor.

Latest version **1.0.3** (published 2019-02-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @kingjs/property-descriptor.rename
pnpm add @kingjs/property-descriptor.rename
yarn add @kingjs/property-descriptor.rename
bun add @kingjs/property-descriptor.rename
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-02-05 |
| First published | 2019-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | kingces95 |

## Links

- npm: https://www.npmjs.com/package/@kingjs/property-descriptor.rename
- Repository: https://repository.kingjs.net/property-descriptor/rename
- npm.io page: https://npm.io/package/@kingjs/property-descriptor.rename

## Dependencies (3)

- [@kingjs/is](https://npm.io/package/@kingjs/is.md) ^1.0.9
- [@kingjs/string-ex.expand](https://npm.io/package/@kingjs/string-ex.expand.md) ^1.0.0
- [@kingjs/function-ex.rename](https://npm.io/package/@kingjs/function-ex.rename.md) ^1.0.0

## Recent versions

- 1.0.3 (latest) — 2019-02-05
- 1.0.2 — 2019-01-28
- 1.0.1 — 2019-01-25
- 1.0.0 — 2019-01-21

## README

# @[kingjs][@kingjs]/[property-descriptor][ns0].[rename][ns1]
Renames functions found in a descriptor.
## Usage
```js
var assert = require('assert');
var rename = require('@kingjs/property-descriptor.rename');

var foo = {
  value: function foo() { }
}
foo = rename.call(foo, '${name} (thunk)');
assert(foo.value.name == 'foo (thunk)');

var bar = {
  get: function getBar() { }, 
  set: function setBar(value) { }
}
bar = rename.call(bar, '${name} (stub)');
assert(bar.get.name == 'getBar (stub)');
assert(bar.set.name == 'setBar (stub)');

```

## API
```ts
rename(this, template)
```
### Parameters
- `this`: The descriptor whose functions will be renamed.
- `template`: The name to assign to each function. A  placeholder for `name` will be expanded to the name of  the function being replaced.
### Returns
Returns the descriptor with its functions renamed.

## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install @kingjs/property-descriptor.rename
```
## Source
https://repository.kingjs.net/property-descriptor/rename
## License
MIT

![Analytics](https://analytics.kingjs.net/property-descriptor/rename)

[@kingjs]: https://www.npmjs.com/package/kingjs
[ns0]: https://www.npmjs.com/package/@kingjs/property-descriptor
[ns1]: https://www.npmjs.com/package/@kingjs/property-descriptor.rename

---
_Source: https://npm.io/package/@kingjs/property-descriptor.rename · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
