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

tsbuffer-validator

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsbuffer-validator - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

4

package.json
{
"name": "tsbuffer-validator",
"version": "0.2.0",
"version": "0.3.0",
"description": "Validator for TSBuffer values",

@@ -37,3 +37,3 @@ "main": "index.js",

"k8w-extend-native": "^1.1.0",
"tsbuffer-schema": "^0.6.0"
"tsbuffer-schema": "^0.7.0"
},

@@ -40,0 +40,0 @@ "nyc": {

@@ -10,3 +10,3 @@ import { TSBufferProto, TSBufferSchema } from "tsbuffer-schema";

/** 将ReferenceTYpeSchema层层转换为它最终实际引用的类型 */
parseReference(schema: TypeReference): Exclude<TSBufferSchema, TypeReference>;
parseReference(schema: TSBufferSchema): Exclude<TSBufferSchema, TypeReference>;
isInterface(schema: TSBufferSchema, excludeReference?: boolean): schema is InterfaceTypeSchema | InterfaceReference;

@@ -13,0 +13,0 @@ isTypeReference(schema: TSBufferSchema): schema is TypeReference;

@@ -33,3 +33,3 @@ "use strict";

// IndexedAccess
else {
else if (schema.type === 'IndexedAccess') {
if (!this.isInterface(schema.objectType)) {

@@ -74,2 +74,5 @@ throw new Error("Error objectType: " + schema.objectType.type);

}
else {
return schema;
}
};

@@ -131,5 +134,5 @@ ProtoHelper.prototype.isInterface = function (schema, excludeReference) {

for (var _b = 0, _c = schema.extends; _b < _c.length; _b++) {
var extendsRef = _c[_b];
var extend = _c[_b];
// 解引用
var parsedExtRef = this.parseReference(extendsRef);
var parsedExtRef = this.parseReference(extend.type);
if (parsedExtRef.type !== 'Interface') {

@@ -136,0 +139,0 @@ throw new Error('SchemaError: extends must from interface but from ' + parsedExtRef.type);

@@ -204,5 +204,8 @@ "use strict";

extends: [{
type: 'Reference',
path: 'a',
targetName: 'a1'
id: 0,
type: {
type: 'Reference',
path: 'a',
targetName: 'a1'
}
}]

@@ -209,0 +212,0 @@ }

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