New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@bleed-believer/meta

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bleed-believer/meta

Adds metadata easifuly to your objects.

  • 0.1.2
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
71
increased by61.36%
Maintainers
1
Weekly downloads
 
Created
Source

@bleed-believer/meta

Adds metadata easifuly to your objects.

Installation

Using npm:

npm i --save @bleed-believer/meta

How to use

import { MetaManager } from '@bleed-believer/meta';

// This is the metadata struct
interface ClassMeta {
    text: string;
    value: number;
}

// This class is the target to assign metadata
class Target {}

// The instance to manage metadata
const CLASSMETA = new MetaManager<ClassMeta>(
    // Set here a friendly name to the metadata
    'trolled'
);

// Set the metadata value to the target
CLASSMETA.set(Target, {
    text: 'jajaja',
    value: 666
});

// Get the metadata stored in the target
const metaValue = CLASSMETA.get(Target);
console.log(metaValue);

// Check if the target has this metadata with value
const hasMetadata = CLASSMETA.some(Target);
console.log(hasMetadata);

FAQs

Package last updated on 14 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc