tsbuffer-validator
Advanced tools
Comparing version 2.1.1 to 2.1.2-dev.0
/*! | ||
* TSBuffer Validator v2.1.1 | ||
* TSBuffer Validator v2.1.2-dev.0 | ||
* ----------------------------------------- | ||
* MIT LICENSE | ||
* KingWorks (C) Copyright 2022 | ||
* KingWorks (C) Copyright 2023 | ||
* https://github.com/k8w/tsbuffer-validator | ||
@@ -7,0 +7,0 @@ */ |
11
index.js
/*! | ||
* TSBuffer Validator v2.1.1 | ||
* TSBuffer Validator v2.1.2-dev.0 | ||
* ----------------------------------------- | ||
* MIT LICENSE | ||
* KingWorks (C) Copyright 2022 | ||
* KingWorks (C) Copyright 2023 | ||
* https://github.com/k8w/tsbuffer-validator | ||
@@ -21,2 +21,3 @@ */ | ||
this._flatInterfaceSchemaCache = {}; | ||
this._parseMappedTypeCache = new WeakMap(); | ||
this.proto = proto; | ||
@@ -373,2 +374,6 @@ } | ||
ProtoHelper.prototype.parseMappedType = function (schema) { | ||
var cache = this._parseMappedTypeCache.get(schema); | ||
if (cache) { | ||
return cache; | ||
} | ||
// 解嵌套,例如:Pick<Pick<Omit, XXX, 'a'|'b'>>> | ||
@@ -383,2 +388,3 @@ var parents = []; | ||
if (child.type === tsbufferSchema.SchemaType.Interface) { | ||
this._parseMappedTypeCache.set(schema, child); | ||
return child; | ||
@@ -403,2 +409,3 @@ } | ||
}; | ||
this._parseMappedTypeCache.set(schema, newSchema); | ||
return newSchema; | ||
@@ -405,0 +412,0 @@ } |
{ | ||
"name": "tsbuffer-validator", | ||
"version": "2.1.1", | ||
"version": "2.1.2-dev.0", | ||
"description": "Validator for TSBuffer values", | ||
@@ -63,13 +63,13 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@microsoft/api-documenter": "^7.19.14", | ||
"@microsoft/api-extractor": "^7.31.2", | ||
"@microsoft/api-documenter": "^7.23.15", | ||
"@microsoft/api-extractor": "^7.39.0", | ||
"@types/mocha": "^8.2.3", | ||
"@types/node": "^15.14.9", | ||
"@types/node": "^20.10.5", | ||
"mocha": "^9.2.2", | ||
"nyc": "^15.1.0", | ||
"rollup": "^2.79.1", | ||
"rollup-plugin-typescript2": "^0.34.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.8.3" | ||
"rollup-plugin-typescript2": "^0.36.0", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^4.9.5" | ||
} | ||
} |
# TSBuffer Validator | ||
Runtime type validator for [TSBuffer](https://github.com/k8w/tsbuffer) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110047
2336
1