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

@blockfrost/blockfrost-utils

Package Overview
Dependencies
Maintainers
3
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blockfrost/blockfrost-utils - npm Package Compare versions

Comparing version 1.0.0-alfa.3 to 1.0.0-alfa.4

1

lib/fastify.d.ts

@@ -11,3 +11,4 @@ /// <reference types="node" />

export declare const handle404: (reply: FastifyReply) => FastifyReply;
export declare const handle415: (reply: FastifyReply, error: FastifyError) => FastifyReply;
export declare const handle500: (reply: FastifyReply, error: unknown, request: FastifyRequest) => FastifyReply;
export declare const handleInvalidAddress: (reply: FastifyReply) => FastifyReply<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify/types/route").RouteGenericInterface, unknown, import("fastify").FastifySchema, import("fastify").FastifyTypeProviderDefault, unknown>;

19

lib/fastify.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handleInvalidAddress = exports.handle500 = exports.handle404 = exports.handle403Custom = exports.handle403 = exports.handle402 = exports.handle400Custom = exports.handle400 = exports.errorHandler = exports.notFoundHandler = void 0;
exports.handleInvalidAddress = exports.handle500 = exports.handle415 = exports.handle404 = exports.handle403Custom = exports.handle403 = exports.handle402 = exports.handle400Custom = exports.handle400 = exports.errorHandler = exports.notFoundHandler = void 0;
const notFoundHandler = (_request, reply) => {

@@ -22,2 +22,5 @@ return reply

}
if (error.statusCode === 415) {
return (0, exports.handle415)(reply, error);
}
// TODO: investigate if these are needed

@@ -30,6 +33,3 @@ if (reply.statusCode === 400) {

}
if (reply.statusCode >= 500 && reply.statusCode < 600) {
return (0, exports.handle500)(reply, error, request);
}
// Handle generic js errors
// Fallback and handling of generic js errors
return (0, exports.handle500)(reply, error, request);

@@ -92,2 +92,11 @@ };

exports.handle404 = handle404;
const handle415 = (reply, error) => reply
.code(415)
.header('Content-Type', 'application/json; charset=utf-8')
.send({
error: 'Unsupported Media Type',
message: error.message,
status_code: 415,
});
exports.handle415 = handle415;
const handle500 = (reply, error, request) => {

@@ -94,0 +103,0 @@ if (process.env.NODE_ENV !== 'test') {

{
"name": "@blockfrost/blockfrost-utils",
"version": "1.0.0-alfa.3",
"version": "1.0.0-alfa.4",
"repository": "git@github.com:blockfrost/blockfrost-utils.git",

@@ -5,0 +5,0 @@ "license": "Apache-2.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