0.1.1 • Published 5 years ago

@ganuz/has-own-metadata v0.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

@ganuz/has-own-metadata

Source Code Version MIT License Bundle Size TypeScript

Has Own Metadata is package from Ganuz library

Install

$ yarn add @ganuz/has-own-metadata

Or

$ npm install --save @ganuz/has-own-metadata

Use

Module

import {
  default as hasOwnMetadata
} from '@ganuz/has-own-metadata';

Browser

<script src="https://unpkg.com/@ganuz/has-own-metadata/bundle.umd.min.js"></script>
let {
  hasOwnMetadata
} = G;

Examples

 hasOwnMetadata('key', null, 'prop'); // throw TypeError
 hasOwnMetadata('key', class {}, 'prop'); // => false

 class C{}
 defineMetadata('foo', 'bar', C);
 hasOwnMetadata('foo', C); // => true

Note: It is based on es6 WeakMap and Map no need for polyfill (built-in library support).

License

Copyright © Yisrael Eliev, Licensed under the MIT license.