Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@injex/stdlib

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injex/stdlib - npm Package Compare versions

Comparing version 2.1.0 to 3.0.0-alpha.0

2

lib/metadata.d.ts

@@ -0,1 +1,2 @@

import "reflect-metadata";
export declare type MetadataHandlers<T> = {

@@ -7,3 +8,4 @@ ensureMetadata: (target: any) => T;

pushMetadata: (target: any, key: keyof T, value: any) => void;
forEachProtoMetadata: (target: any, callback: (proto: object, metadata: T) => void) => void;
};
export declare function createMetadataHandlers<T = any>(metadataKey: symbol): MetadataHandlers<T>;

26

lib/metadata.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createMetadataHandlers = void 0;
require("reflect-metadata");
function createMetadataHandlers(metadataKey) {
function ensureMetadata(target) {
target[metadataKey] = target[metadataKey] || {};
return target[metadataKey];
if (!hasMetadata(target)) {
Reflect.defineMetadata(metadataKey, {}, target);
}
return getMetadata(target);
}
function setMetadata(target, key, value) {
ensureMetadata(target);
target[metadataKey][key] = value;
var metadata = ensureMetadata(target);
metadata[key] = value;
}
function getMetadata(target) {
return target[metadataKey];
return Reflect.getOwnMetadata(metadataKey, target);
}
function hasMetadata(target) {
return target && target instanceof Object && metadataKey in target;
return Reflect.hasOwnMetadata(metadataKey, target);
}

@@ -26,2 +29,12 @@ function pushMetadata(target, key, value) {

}
function forEachProtoMetadata(target, callback) {
var __proto__ = target === null || target === void 0 ? void 0 : target.__proto__;
while (__proto__) {
var meta = getMetadata(__proto__);
if (meta) {
callback(__proto__, meta);
}
__proto__ = __proto__.__proto__;
}
}
return {

@@ -33,2 +46,3 @@ ensureMetadata: ensureMetadata,

pushMetadata: pushMetadata,
forEachProtoMetadata: forEachProtoMetadata,
};

@@ -35,0 +49,0 @@ }

{
"name": "@injex/stdlib",
"version": "2.1.0",
"version": "3.0.0-alpha.0",
"description": "",

@@ -40,2 +40,3 @@ "keywords": [],

"dependencies": {
"reflect-metadata": "^0.1.13",
"tslib": "^2.0.1"

@@ -49,3 +50,3 @@ },

},
"gitHead": "1e2aaf520e73125f5108801bbc9c8c15550c5349"
"gitHead": "c52d04648f8dbd81e09f5e09f7770e55eac2014f"
}

Sorry, the diff of this file is not supported yet

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