https://github.com/cfware/symbols
An iterator which generates Symbol's
https://github.com/cfware/symbols
Last synced: 7 months ago
JSON representation
An iterator which generates Symbol's
- Host: GitHub
- URL: https://github.com/cfware/symbols
- Owner: cfware
- License: mit
- Created: 2020-09-06T19:35:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-15T16:28:48.000Z (over 2 years ago)
- Last Synced: 2025-09-04T09:31:49.725Z (7 months ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @cfware/symbols [![NPM Version][npm-image]][npm-url]
An iterator which generates Symbol's
## Usage
```js
import Symbols from '@cfware/symbols';
export [Bar1, Bar2] = Symbols;
export class Foo {
[Bar1] = 'protected field';
[Bar2]() {
return 'protected method';
}
}
```
This allows declaration of protected fields. A primary goal is to be terser friendly,
the `Bar1` field will be safely shortened even when it is used across sources.
[npm-image]: https://img.shields.io/npm/v/@cfware/symbols.svg
[npm-url]: https://npmjs.org/package/@cfware/symbols