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

tinspector

Package Overview
Dependencies
Maintainers
1
Versions
194
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tinspector - npm Package Compare versions

Comparing version 2.2.5 to 2.2.6

4

lib/index.d.ts

@@ -98,3 +98,3 @@ import "reflect-metadata";

var ignore: () => (...args: any[]) => void;
var type: (type: Class, info?: string | undefined) => (...args: any[]) => void;
var type: (type: Class | Class[], info?: string | undefined) => (...args: any[]) => void;
var array: (type: Class) => (...args: any[]) => void;

@@ -110,3 +110,3 @@ var parameterProperties: () => (target: any) => void;

var ignore: () => (...args: any[]) => void;
var type: (type: Class, info?: string | undefined) => (...args: any[]) => void;
var type: (type: Class | Class[], info?: string | undefined) => (...args: any[]) => void;
var array: (type: Class) => (...args: any[]) => void;

@@ -113,0 +113,0 @@ var parameterProperties: () => (target: any) => void;

{
"name": "tinspector",
"version": "2.2.5",
"version": "2.2.6",
"description": "TypeScript type inspector",

@@ -8,2 +8,3 @@ "main": "lib/index.js",

"scripts": {
"postinstall": "tsc",
"test": "jest",

@@ -10,0 +11,0 @@ "build": "tsc",

@@ -112,2 +112,37 @@ # tinspector

## Override Type Information
Tinspector uses TypeScript design type metadata information,
TypeScript doesn't provide enough information about some complex data type such as:
* Array item data type
* Any generic type such as `Partial` `Promise` etc
To do so, you need to specify the type manually by using `@reflect.type()`
### Array
Array type can be defined by providing array of the type like example below
```typescript
@decorate({})
class MyAwesomeClass {
constructor(
@reflect.type([Number])
public numbers:number[]
){}
}
```
### Generic
Generic can be defined with some extra information like example below
```typescript
@decorate({})
class MyAwesomeClass {
@reflect.type(Number, "Promise")
getAwesome():Promise<number> {
}
}
```
## Reflect With Decorator Information

@@ -114,0 +149,0 @@ Use predefined decorator `decorate`, `decorateClass`, `decorateMethod`, `decorateProperty`, `decorateParameter` to add

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