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

@liskhq/lisk-validator

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@liskhq/lisk-validator - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

1

dist-node/formats.d.ts
export declare const hex: (data: unknown) => boolean;
export declare const bytes: (data: unknown) => boolean;
export declare const int64: (data: string) => boolean;

@@ -3,0 +4,0 @@ export declare const uint64: (data: string) => boolean;

@@ -5,2 +5,3 @@ "use strict";

exports.hex = validation_1.isHexString;
exports.bytes = validation_1.isBytes;
exports.int64 = (data) => validation_1.isNumberString(data) && validation_1.isSInt64(BigInt(data));

@@ -7,0 +8,0 @@ exports.uint64 = (data) => validation_1.isNumberString(data) && validation_1.isUInt64(BigInt(data));

14

dist-node/validation.d.ts
import { gte as isVersionGte, gtr as isGreaterThanVersionInRange, ltr as isLessThanVersionInRange } from 'semver';
export declare const isNumberString: (num: unknown) => boolean;
export declare const isString: (data: unknown) => boolean;
export declare const isBoolean: (data: unknown) => boolean;
export declare const isSInt32: (data: unknown) => boolean;
export declare const isUInt32: (data: unknown) => boolean;
export declare const isSInt64: (data: unknown) => boolean;
export declare const isUInt64: (data: unknown) => boolean;
export declare const isBytes: (data: unknown) => boolean;
export declare const isValidInteger: (num: unknown) => boolean;

@@ -18,8 +25,1 @@ export declare const isHexString: (data: unknown) => boolean;

export declare const isCsv: (data: string) => boolean;
export declare const isString: (data: unknown) => boolean;
export declare const isBoolean: (data: unknown) => boolean;
export declare const isSInt32: (data: unknown) => boolean;
export declare const isUInt32: (data: unknown) => boolean;
export declare const isSInt64: (data: unknown) => boolean;
export declare const isUInt64: (data: unknown) => boolean;
export declare const isBytes: (data: unknown) => boolean;

@@ -12,2 +12,19 @@ "use strict";

};
exports.isString = (data) => typeof data === 'string';
exports.isBoolean = (data) => typeof data === 'boolean';
exports.isSInt32 = (data) => {
if (typeof data === 'number' && Number.isInteger(data)) {
return data <= constants_1.MAX_SINT32 && data >= constants_1.MIN_SINT32;
}
return false;
};
exports.isUInt32 = (data) => {
if (typeof data === 'number' && Number.isInteger(data)) {
return data <= constants_1.MAX_UINT32 && data >= 0;
}
return false;
};
exports.isSInt64 = (data) => typeof data === 'bigint' ? data <= constants_1.MAX_SINT64 && data >= constants_1.MIN_SINT64 : false;
exports.isUInt64 = (data) => typeof data === 'bigint' ? data <= constants_1.MAX_UINT64 && data >= BigInt(0) : false;
exports.isBytes = (data) => Buffer.isBuffer(data);
exports.isValidInteger = (num) => typeof num === 'number' ? Math.floor(num) === num : false;

@@ -50,19 +67,2 @@ exports.isHexString = (data) => {

};
exports.isString = (data) => typeof data === 'string';
exports.isBoolean = (data) => typeof data === 'boolean';
exports.isSInt32 = (data) => {
if (typeof data === 'number' && Number.isInteger(data)) {
return data <= constants_1.MAX_SINT32 && data >= constants_1.MIN_SINT32;
}
return false;
};
exports.isUInt32 = (data) => {
if (typeof data === 'number' && Number.isInteger(data)) {
return data <= constants_1.MAX_UINT32 && data >= 0;
}
return false;
};
exports.isSInt64 = (data) => typeof data === 'bigint' ? data <= constants_1.MAX_SINT64 && data >= constants_1.MIN_SINT64 : false;
exports.isUInt64 = (data) => typeof data === 'bigint' ? data <= constants_1.MAX_UINT64 && data >= BigInt(0) : false;
exports.isBytes = (data) => Buffer.isBuffer(data);
//# sourceMappingURL=validation.js.map
{
"name": "@liskhq/lisk-validator",
"version": "0.5.0",
"version": "0.5.1",
"description": "Validation library according to the Lisk protocol",

@@ -40,3 +40,3 @@ "author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>",

"dependencies": {
"@liskhq/lisk-cryptography": "^3.0.0",
"@liskhq/lisk-cryptography": "^3.0.1",
"@types/node": "12.12.11",

@@ -43,0 +43,0 @@ "@types/semver": "7.1.0",

Sorry, the diff of this file is not supported yet

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