fastify-type-provider-zod2
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -11,9 +11,22 @@ 'use strict'; | ||
function _construct(t, e, r) { | ||
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); | ||
var o = [null]; | ||
o.push.apply(o, e); | ||
var p = new (t.bind.apply(t, o))(); | ||
return r && _setPrototypeOf(p, r.prototype), p; | ||
} | ||
function _isNativeReflectConstruct() { | ||
try { | ||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
} catch (t) {} | ||
return (_isNativeReflectConstruct = function () { | ||
return !!t; | ||
})(); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
subClass.prototype = Object.create(superClass.prototype); | ||
subClass.prototype.constructor = subClass; | ||
_setPrototypeOf(subClass, superClass); | ||
} | ||
function _getPrototypeOf(o) { | ||
@@ -25,3 +38,2 @@ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | ||
} | ||
function _setPrototypeOf(o, p) { | ||
@@ -34,57 +46,23 @@ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
} | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
function _isNativeFunction(fn) { | ||
try { | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
return Function.toString.call(fn).indexOf("[native code]") !== -1; | ||
} catch (e) { | ||
return false; | ||
return typeof fn === "function"; | ||
} | ||
} | ||
function _construct(Parent, args, Class) { | ||
if (_isNativeReflectConstruct()) { | ||
_construct = Reflect.construct.bind(); | ||
} else { | ||
_construct = function _construct(Parent, args, Class) { | ||
var a = [null]; | ||
a.push.apply(a, args); | ||
var Constructor = Function.bind.apply(Parent, a); | ||
var instance = new Constructor(); | ||
if (Class) _setPrototypeOf(instance, Class.prototype); | ||
return instance; | ||
}; | ||
} | ||
return _construct.apply(null, arguments); | ||
} | ||
function _isNativeFunction(fn) { | ||
return Function.toString.call(fn).indexOf("[native code]") !== -1; | ||
} | ||
function _wrapNativeSuper(Class) { | ||
var _cache = typeof Map === "function" ? new Map() : undefined; | ||
_wrapNativeSuper = function _wrapNativeSuper(Class) { | ||
if (Class === null || !_isNativeFunction(Class)) return Class; | ||
if (typeof Class !== "function") { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
if (typeof _cache !== "undefined") { | ||
if (_cache.has(Class)) return _cache.get(Class); | ||
_cache.set(Class, Wrapper); | ||
} | ||
function Wrapper() { | ||
return _construct(Class, arguments, _getPrototypeOf(this).constructor); | ||
} | ||
Wrapper.prototype = Object.create(Class.prototype, { | ||
@@ -100,6 +78,4 @@ constructor: { | ||
}; | ||
return _wrapNativeSuper(Class); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
@@ -110,3 +86,2 @@ if (source == null) return {}; | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
@@ -117,3 +92,2 @@ key = sourceKeys[i]; | ||
} | ||
return target; | ||
@@ -132,4 +106,3 @@ } | ||
var schema = _ref2.schema, | ||
url = _ref2.url; | ||
url = _ref2.url; | ||
if (!schema) { | ||
@@ -141,13 +114,10 @@ return { | ||
} | ||
var response = schema.response, | ||
headers = schema.headers, | ||
querystring = schema.querystring, | ||
body = schema.body, | ||
params = schema.params, | ||
hide = schema.hide, | ||
rest = _objectWithoutPropertiesLoose(schema, _excluded); | ||
headers = schema.headers, | ||
querystring = schema.querystring, | ||
body = schema.body, | ||
params = schema.params, | ||
hide = schema.hide, | ||
rest = _objectWithoutPropertiesLoose(schema, _excluded); | ||
var transformed = {}; | ||
if (skipList.includes(url) || hide) { | ||
@@ -160,3 +130,2 @@ transformed.hide = true; | ||
} | ||
var zodSchemas = { | ||
@@ -168,6 +137,4 @@ headers: headers, | ||
}; | ||
for (var prop in zodSchemas) { | ||
var zodSchema = zodSchemas[prop]; | ||
if (zodSchema && zodSchema.safeParse) { | ||
@@ -177,13 +144,12 @@ transformed[prop] = zodToJsonSchema.zodToJsonSchema(zodSchema, zodToJsonSchemaOptions); | ||
} | ||
if (response) { | ||
transformed.response = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
transformed.response = {}; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
for (var _prop in response) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var _schema = resolveSchema(response[_prop]); //@ts-ignore | ||
var _schema = resolveSchema(response[_prop]); | ||
//@ts-ignore | ||
if (_schema && _schema.safeParse) { | ||
var transformedResponse = zodToJsonSchema.zodToJsonSchema( // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var transformedResponse = zodToJsonSchema.zodToJsonSchema( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
_schema, zodToJsonSchemaOptions); | ||
@@ -194,6 +160,4 @@ transformed.response[_prop] = transformedResponse; | ||
} | ||
for (var _prop2 in rest) { | ||
var meta = rest[_prop2]; | ||
if (meta) { | ||
@@ -203,3 +167,2 @@ transformed[_prop2] = meta; | ||
} | ||
return { | ||
@@ -214,7 +177,5 @@ schema: transformed, | ||
}); | ||
function hasOwnProperty(obj, prop) { | ||
return Object.prototype.hasOwnProperty.call(obj, prop); | ||
} | ||
function resolveSchema(maybeSchema) { | ||
@@ -224,10 +185,7 @@ if (hasOwnProperty(maybeSchema, 'safeParse')) { | ||
} | ||
if (hasOwnProperty(maybeSchema, 'properties')) { | ||
return maybeSchema.properties; | ||
} | ||
throw new Error("Invalid schema passed: " + JSON.stringify(maybeSchema)); | ||
} | ||
var ajv = /*#__PURE__*/new Ajv({ | ||
@@ -240,3 +198,2 @@ removeAdditional: 'all', | ||
var schema = _ref3.schema; | ||
//@ts-ignore | ||
@@ -258,3 +215,2 @@ if (schema.safeParse) { | ||
} | ||
return ajv.compile(schema); | ||
@@ -264,6 +220,4 @@ }; | ||
_inheritsLoose(ResponseValidationError, _Error); | ||
function ResponseValidationError(validationResult) { | ||
var _this; | ||
_this = _Error.call(this, "Response doesn't match the schema") || this; | ||
@@ -274,3 +228,2 @@ _this.name = 'ResponseValidationError'; | ||
} | ||
return ResponseValidationError; | ||
@@ -281,15 +234,11 @@ }( /*#__PURE__*/_wrapNativeSuper(Error)); | ||
var schema = resolveSchema(maybeSchema); | ||
if (schema.safeParse) { | ||
return function (data) { | ||
var result = schema.safeParse(data); | ||
if (result.success) { | ||
return JSON.stringify(result.data); | ||
} | ||
throw new ResponseValidationError(result); | ||
}; | ||
} | ||
return function (data) { | ||
@@ -296,0 +245,0 @@ return JSON.stringify(data); |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,e=(r=require("ajv"))&&"object"==typeof r&&"default"in r?r.default:r,t=require("zod-to-json-schema"),n=require("zod-validation-error");function o(r){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function a(r,e){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r})(r,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}function u(r,e,t){return(u=i()?Reflect.construct.bind():function(r,e,t){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(r,n));return t&&a(o,t.prototype),o}).apply(null,arguments)}function s(r){var e="function"==typeof Map?new Map:void 0;return(s=function(r){if(null===r||-1===Function.toString.call(r).indexOf("[native code]"))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(r))return e.get(r);e.set(r,t)}function t(){return u(r,arguments,o(this).constructor)}return t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),a(t,r)})(r)}var c=["response","headers","querystring","body","params","hide"],f={target:"openApi3",$refStrategy:"none"},p=function(r){var e=r.skipList;return function(r){var n=r.schema,o=r.url;if(!n)return{schema:n,url:o};var a=n.response,i=n.headers,u=n.querystring,s=n.body,p=n.params,l=n.hide,d=function(r,e){if(null==r)return{};var t,n,o={},a=Object.keys(r);for(n=0;n<a.length;n++)e.indexOf(t=a[n])>=0||(o[t]=r[t]);return o}(n,c),h={};if(e.includes(o)||l)return h.hide=!0,{schema:h,url:o};var m={headers:i,querystring:u,body:s,params:p};for(var v in m){var O=m[v];O&&O.safeParse&&(h[v]=t.zodToJsonSchema(O,f))}if(a)for(var b in h.response={},a){var g=y(a[b]);if(g&&g.safeParse){var j=t.zodToJsonSchema(g,f);h.response[b]=j}}for(var P in d){var w=d[P];w&&(h[P]=w)}return{schema:h,url:o}}},l=p({skipList:["/documentation/","/documentation/initOAuth","/documentation/json","/documentation/uiConfig","/documentation/yaml","/documentation/*","/documentation/static/*"]});function d(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function y(r){if(d(r,"safeParse"))return r;if(d(r,"properties"))return r.properties;throw new Error("Invalid schema passed: "+JSON.stringify(r))}var h=new e({removeAdditional:"all",useDefaults:!0,coerceTypes:"array"}),m=function(r){var e,t;function n(e){var t;return(t=r.call(this,"Response doesn't match the schema")||this).name="ResponseValidationError",t.details=e.error,t}return t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,a(e,t),n}(s(Error));exports.ResponseValidationError=m,exports.createJsonSchemaTransform=p,exports.jsonSchemaTransform=l,exports.serializerCompiler=function(r){var e=y(r.schema);return e.safeParse?function(r){var t=e.safeParse(r);if(t.success)return JSON.stringify(t.data);throw new m(t)}:function(r){return JSON.stringify(r)}},exports.validatorCompiler=function(r){var e=r.schema;return e.safeParse?function(r){try{return e.parse(r),{value:r}}catch(r){return{error:n.fromZodError(r)}}}:h.compile(e)}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r,e=(r=require("ajv"))&&"object"==typeof r&&"default"in r?r.default:r,t=require("zod-to-json-schema"),n=require("zod-validation-error");function o(r,e,t){if(a())return Reflect.construct.apply(null,arguments);var n=[null];n.push.apply(n,e);var o=new(r.bind.apply(r,n));return t&&u(o,t.prototype),o}function a(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(r){}return(a=function(){return!!r})()}function i(r){return(i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function u(r,e){return(u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,e){return r.__proto__=e,r})(r,e)}function s(r){var e="function"==typeof Map?new Map:void 0;return(s=function(r){if(null===r||!function(r){try{return-1!==Function.toString.call(r).indexOf("[native code]")}catch(e){return"function"==typeof r}}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(r))return e.get(r);e.set(r,t)}function t(){return o(r,arguments,i(this).constructor)}return t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),u(t,r)})(r)}var c=["response","headers","querystring","body","params","hide"],f={target:"openApi3",$refStrategy:"none"},p=function(r){var e=r.skipList;return function(r){var n=r.schema,o=r.url;if(!n)return{schema:n,url:o};var a=n.response,i=n.headers,u=n.querystring,s=n.body,p=n.params,l=n.hide,d=function(r,e){if(null==r)return{};var t,n,o={},a=Object.keys(r);for(n=0;n<a.length;n++)e.indexOf(t=a[n])>=0||(o[t]=r[t]);return o}(n,c),h={};if(e.includes(o)||l)return h.hide=!0,{schema:h,url:o};var v={headers:i,querystring:u,body:s,params:p};for(var m in v){var O=v[m];O&&O.safeParse&&(h[m]=t.zodToJsonSchema(O,f))}if(a)for(var b in h.response={},a){var g=y(a[b]);if(g&&g.safeParse){var j=t.zodToJsonSchema(g,f);h.response[b]=j}}for(var P in d){var w=d[P];w&&(h[P]=w)}return{schema:h,url:o}}},l=p({skipList:["/documentation/","/documentation/initOAuth","/documentation/json","/documentation/uiConfig","/documentation/yaml","/documentation/*","/documentation/static/*"]});function d(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function y(r){if(d(r,"safeParse"))return r;if(d(r,"properties"))return r.properties;throw new Error("Invalid schema passed: "+JSON.stringify(r))}var h=new e({removeAdditional:"all",useDefaults:!0,coerceTypes:"array"}),v=function(r){var e,t;function n(e){var t;return(t=r.call(this,"Response doesn't match the schema")||this).name="ResponseValidationError",t.details=e.error,t}return t=r,(e=n).prototype=Object.create(t.prototype),e.prototype.constructor=e,u(e,t),n}(s(Error));exports.ResponseValidationError=v,exports.createJsonSchemaTransform=p,exports.jsonSchemaTransform=l,exports.serializerCompiler=function(r){var e=y(r.schema);return e.safeParse?function(r){var t=e.safeParse(r);if(t.success)return JSON.stringify(t.data);throw new v(t)}:function(r){return JSON.stringify(r)}},exports.validatorCompiler=function(r){var e=r.schema;return e.safeParse?function(r){try{return e.parse(r),{value:r}}catch(r){return{error:n.fromZodError(r)}}}:h.compile(e)}; | ||
//# sourceMappingURL=fastify-type-provider-zod2.cjs.production.min.js.map |
@@ -5,9 +5,22 @@ import Ajv from 'ajv'; | ||
function _construct(t, e, r) { | ||
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); | ||
var o = [null]; | ||
o.push.apply(o, e); | ||
var p = new (t.bind.apply(t, o))(); | ||
return r && _setPrototypeOf(p, r.prototype), p; | ||
} | ||
function _isNativeReflectConstruct() { | ||
try { | ||
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
} catch (t) {} | ||
return (_isNativeReflectConstruct = function () { | ||
return !!t; | ||
})(); | ||
} | ||
function _inheritsLoose(subClass, superClass) { | ||
subClass.prototype = Object.create(superClass.prototype); | ||
subClass.prototype.constructor = subClass; | ||
_setPrototypeOf(subClass, superClass); | ||
} | ||
function _getPrototypeOf(o) { | ||
@@ -19,3 +32,2 @@ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | ||
} | ||
function _setPrototypeOf(o, p) { | ||
@@ -28,57 +40,23 @@ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | ||
} | ||
function _isNativeReflectConstruct() { | ||
if (typeof Reflect === "undefined" || !Reflect.construct) return false; | ||
if (Reflect.construct.sham) return false; | ||
if (typeof Proxy === "function") return true; | ||
function _isNativeFunction(fn) { | ||
try { | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
return Function.toString.call(fn).indexOf("[native code]") !== -1; | ||
} catch (e) { | ||
return false; | ||
return typeof fn === "function"; | ||
} | ||
} | ||
function _construct(Parent, args, Class) { | ||
if (_isNativeReflectConstruct()) { | ||
_construct = Reflect.construct.bind(); | ||
} else { | ||
_construct = function _construct(Parent, args, Class) { | ||
var a = [null]; | ||
a.push.apply(a, args); | ||
var Constructor = Function.bind.apply(Parent, a); | ||
var instance = new Constructor(); | ||
if (Class) _setPrototypeOf(instance, Class.prototype); | ||
return instance; | ||
}; | ||
} | ||
return _construct.apply(null, arguments); | ||
} | ||
function _isNativeFunction(fn) { | ||
return Function.toString.call(fn).indexOf("[native code]") !== -1; | ||
} | ||
function _wrapNativeSuper(Class) { | ||
var _cache = typeof Map === "function" ? new Map() : undefined; | ||
_wrapNativeSuper = function _wrapNativeSuper(Class) { | ||
if (Class === null || !_isNativeFunction(Class)) return Class; | ||
if (typeof Class !== "function") { | ||
throw new TypeError("Super expression must either be null or a function"); | ||
} | ||
if (typeof _cache !== "undefined") { | ||
if (_cache.has(Class)) return _cache.get(Class); | ||
_cache.set(Class, Wrapper); | ||
} | ||
function Wrapper() { | ||
return _construct(Class, arguments, _getPrototypeOf(this).constructor); | ||
} | ||
Wrapper.prototype = Object.create(Class.prototype, { | ||
@@ -94,6 +72,4 @@ constructor: { | ||
}; | ||
return _wrapNativeSuper(Class); | ||
} | ||
function _objectWithoutPropertiesLoose(source, excluded) { | ||
@@ -104,3 +80,2 @@ if (source == null) return {}; | ||
var key, i; | ||
for (i = 0; i < sourceKeys.length; i++) { | ||
@@ -111,3 +86,2 @@ key = sourceKeys[i]; | ||
} | ||
return target; | ||
@@ -126,4 +100,3 @@ } | ||
var schema = _ref2.schema, | ||
url = _ref2.url; | ||
url = _ref2.url; | ||
if (!schema) { | ||
@@ -135,13 +108,10 @@ return { | ||
} | ||
var response = schema.response, | ||
headers = schema.headers, | ||
querystring = schema.querystring, | ||
body = schema.body, | ||
params = schema.params, | ||
hide = schema.hide, | ||
rest = _objectWithoutPropertiesLoose(schema, _excluded); | ||
headers = schema.headers, | ||
querystring = schema.querystring, | ||
body = schema.body, | ||
params = schema.params, | ||
hide = schema.hide, | ||
rest = _objectWithoutPropertiesLoose(schema, _excluded); | ||
var transformed = {}; | ||
if (skipList.includes(url) || hide) { | ||
@@ -154,3 +124,2 @@ transformed.hide = true; | ||
} | ||
var zodSchemas = { | ||
@@ -162,6 +131,4 @@ headers: headers, | ||
}; | ||
for (var prop in zodSchemas) { | ||
var zodSchema = zodSchemas[prop]; | ||
if (zodSchema && zodSchema.safeParse) { | ||
@@ -171,13 +138,12 @@ transformed[prop] = zodToJsonSchema(zodSchema, zodToJsonSchemaOptions); | ||
} | ||
if (response) { | ||
transformed.response = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
transformed.response = {}; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
for (var _prop in response) { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var _schema = resolveSchema(response[_prop]); //@ts-ignore | ||
var _schema = resolveSchema(response[_prop]); | ||
//@ts-ignore | ||
if (_schema && _schema.safeParse) { | ||
var transformedResponse = zodToJsonSchema( // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
var transformedResponse = zodToJsonSchema( | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
_schema, zodToJsonSchemaOptions); | ||
@@ -188,6 +154,4 @@ transformed.response[_prop] = transformedResponse; | ||
} | ||
for (var _prop2 in rest) { | ||
var meta = rest[_prop2]; | ||
if (meta) { | ||
@@ -197,3 +161,2 @@ transformed[_prop2] = meta; | ||
} | ||
return { | ||
@@ -208,7 +171,5 @@ schema: transformed, | ||
}); | ||
function hasOwnProperty(obj, prop) { | ||
return Object.prototype.hasOwnProperty.call(obj, prop); | ||
} | ||
function resolveSchema(maybeSchema) { | ||
@@ -218,10 +179,7 @@ if (hasOwnProperty(maybeSchema, 'safeParse')) { | ||
} | ||
if (hasOwnProperty(maybeSchema, 'properties')) { | ||
return maybeSchema.properties; | ||
} | ||
throw new Error("Invalid schema passed: " + JSON.stringify(maybeSchema)); | ||
} | ||
var ajv = /*#__PURE__*/new Ajv({ | ||
@@ -234,3 +192,2 @@ removeAdditional: 'all', | ||
var schema = _ref3.schema; | ||
//@ts-ignore | ||
@@ -252,3 +209,2 @@ if (schema.safeParse) { | ||
} | ||
return ajv.compile(schema); | ||
@@ -258,6 +214,4 @@ }; | ||
_inheritsLoose(ResponseValidationError, _Error); | ||
function ResponseValidationError(validationResult) { | ||
var _this; | ||
_this = _Error.call(this, "Response doesn't match the schema") || this; | ||
@@ -268,3 +222,2 @@ _this.name = 'ResponseValidationError'; | ||
} | ||
return ResponseValidationError; | ||
@@ -275,15 +228,11 @@ }( /*#__PURE__*/_wrapNativeSuper(Error)); | ||
var schema = resolveSchema(maybeSchema); | ||
if (schema.safeParse) { | ||
return function (data) { | ||
var result = schema.safeParse(data); | ||
if (result.success) { | ||
return JSON.stringify(result.data); | ||
} | ||
throw new ResponseValidationError(result); | ||
}; | ||
} | ||
return function (data) { | ||
@@ -290,0 +239,0 @@ return JSON.stringify(data); |
{ | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"license": "MIT", | ||
@@ -56,3 +56,3 @@ "main": "dist/index.js", | ||
"testEnvironment": "jsdom", | ||
"collectCoverageFrom" : [ | ||
"collectCoverageFrom": [ | ||
"src/index.ts" | ||
@@ -63,23 +63,23 @@ ] | ||
"@fastify/swagger": "^8.7.0", | ||
"@fastify/swagger-ui": "^1.9.2", | ||
"@jest/globals": "29.5.0", | ||
"@size-limit/preset-small-lib": "8.2.4", | ||
"@fastify/swagger-ui": "^3.0.0", | ||
"@jest/globals": "29.7.0", | ||
"@size-limit/preset-small-lib": "11.0.2", | ||
"@types/jest": "^29.5.0", | ||
"@typescript-eslint/eslint-plugin": "5.59.11", | ||
"@typescript-eslint/parser": "5.59.11", | ||
"eslint": "8.42.0", | ||
"eslint-config-prettier": "8.8.0", | ||
"eslint-plugin-import": "2.27.5", | ||
"eslint-plugin-prettier": "4.2.1", | ||
"eslint-plugin-simple-import-sort": "10.0.0", | ||
"@typescript-eslint/eslint-plugin": "7.0.2", | ||
"@typescript-eslint/parser": "7.0.2", | ||
"eslint": "8.57.0", | ||
"eslint-config-prettier": "9.1.0", | ||
"eslint-plugin-import": "2.29.1", | ||
"eslint-plugin-prettier": "5.1.3", | ||
"eslint-plugin-simple-import-sort": "12.0.0", | ||
"graphql": "^16.7.1", | ||
"husky": "8.0.3", | ||
"husky": "9.0.11", | ||
"jest": "^29.5.0", | ||
"mercurius": "^13.0.0", | ||
"prettier": "2.8.8", | ||
"size-limit": "8.2.4", | ||
"prettier": "3.2.5", | ||
"size-limit": "11.0.2", | ||
"ts-jest": "^29.0.5", | ||
"tsdx": "0.14.1", | ||
"tslib": "2.5.3", | ||
"typescript": "5.1.3" | ||
"tslib": "2.6.2", | ||
"typescript": "5.3.3" | ||
}, | ||
@@ -91,4 +91,4 @@ "dependencies": { | ||
"zod-to-json-schema": "^3.21.3", | ||
"zod-validation-error": "^1.3.1" | ||
"zod-validation-error": "^3.0.0" | ||
} | ||
} |
@@ -12,2 +12,3 @@ import Ajv from 'ajv'; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
type FreeformRecord = Record<string, any>; | ||
@@ -107,2 +108,3 @@ | ||
prop: K, | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
): obj is T & Record<K, any> { | ||
@@ -109,0 +111,0 @@ return Object.prototype.hasOwnProperty.call(obj, prop); |
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
55978
653
+ Addedzod-validation-error@3.4.0(transitive)
- Removedzod-validation-error@1.5.0(transitive)
Updatedzod-validation-error@^3.0.0