@kubernetes-models/validate
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -9,2 +9,11 @@ "use strict"; | ||
const rBase64 = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; | ||
// https://github.com/kubernetes/apimachinery/blob/8c18d83/pkg/api/resource/quantity.go | ||
const rSignedNumber = /[+-]?(?:\d+|\d+\.\d+|\d+\.|\.\d+)/; | ||
// https://physics.nist.gov/cuu/Units/binary.html | ||
const rBinarySI = /[KMGTPE]i/; | ||
// https://en.wikipedia.org/wiki/Metric_prefix#List_of_SI_prefixes | ||
const rDecimalSI = /(?:[YZEPTGMkhdcmunpfazy]|da)/; | ||
const rDecimalExponent = new RegExp(`[eE]${rSignedNumber.source}`); | ||
const rQuantitySuffix = new RegExp(`(?:${rBinarySI.source}|${rDecimalSI.source}|${rDecimalExponent.source})?`); | ||
const rQuantity = new RegExp(`^${rSignedNumber.source}${rQuantitySuffix.source}$`); | ||
exports.ajv = new ajv_1.default({ | ||
@@ -25,2 +34,6 @@ strictTypes: false | ||
}); | ||
exports.ajv.addFormat("quantity", { | ||
type: "string", | ||
validate: rQuantity | ||
}); | ||
//# sourceMappingURL=ajv.js.map |
{ | ||
"name": "@kubernetes-models/validate", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"main": "dist/index.js", | ||
@@ -39,3 +39,3 @@ "module": "dist/index.mjs", | ||
}, | ||
"gitHead": "1d070e18ef5d79465b983cd59a09cd0936c5448a" | ||
"gitHead": "0a52ed0650a97bbd91e1bf132d6a1752b8454a74" | ||
} |
Sorry, the diff of this file is not supported yet
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
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
105
10056
17