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

runtime-type-checks

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

runtime-type-checks - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

2

index.d.ts

@@ -12,1 +12,3 @@ export interface CheckConfig {

export declare function CustomCheck(fn: Function): (type: any) => void;
export declare function objectWith(...props: any[]): (obj: any) => string;
export declare function arrayOf(check: Function): (array: any[]) => string;

@@ -50,2 +50,25 @@ var rm = require('reflect-metadata');

exports.CustomCheck = CustomCheck;
function objectWith() {
var props = [];
for (var _i = 0; _i < arguments.length; _i++) {
props[_i - 0] = arguments[_i];
}
return function (obj) {
var missing = props.filter(function (prop) { return !obj[prop]; });
return missing.length > 0 ? "Required properties are missing: " + missing.join(", ") : null;
};
}
exports.objectWith = objectWith;
function arrayOf(check) {
return function (array) {
for (var i = 0; i < array.length; ++i) {
var error = check(array[i]);
if (error) {
return "Error at index " + i + ". " + error;
}
}
return null;
};
}
exports.arrayOf = arrayOf;
function wrapMethod(descriptor, checks) {

@@ -52,0 +75,0 @@ return wrapValue(descriptor, function () {

2

package.json
{
"name": "runtime-type-checks",
"version": "0.0.3",
"version": "0.0.4",
"description": "Runtime type checks for JavaScript and TypeScript",

@@ -5,0 +5,0 @@ "main": "index.js",

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