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

@re-ai/free-api

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@re-ai/free-api - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

3

dist/services/base.js

@@ -23,2 +23,3 @@ "use strict";

const url = `${this.host || ""}${params.url}`;
Logger_1.Logger.debug("free api url:", url);
const response = await fetch(url, {

@@ -33,3 +34,3 @@ method: params.method,

const contentType = response.headers.get('content-type') || "";
Logger_1.Logger.debug("Base contentType", contentType);
// Logger.debug("Base contentType", contentType)
if (contentType.includes("application/json")) {

@@ -36,0 +37,0 @@ return await response.json();

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

})(LogLevel || (exports.LogLevel = LogLevel = {}));
const LOGGER_PREFIX = process.env.LOGGER_PREFIX || "[ReAI]";
const LOGGER_PREFIX = process.env.LOGGER_PREFIX || "[ReAI-Free-Api]";
class Logger {

@@ -19,3 +19,3 @@ static logLevel = LogLevel.INFO; // 默认日志级别

if (!this.initialized) {
const logLevelEnv = process.env.LOGGER_LEVEL || "INFO";
const logLevelEnv = process.env.LOGGER_LEVEL || process.env.LOGGER_LEVEL_FREE_API || "INFO";
if (logLevelEnv) {

@@ -22,0 +22,0 @@ this.logLevel = LogLevel[logLevelEnv] || LogLevel.INFO;

{
"name": "@re-ai/free-api",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -33,2 +33,3 @@ import { url } from "inspector";

const url = `${this.host || ""}${params.url}`
Logger.debug("free api url:", url)
const response = await fetch(url, {

@@ -45,3 +46,3 @@ method: params.method,

const contentType = response.headers.get('content-type') || ""
Logger.debug("Base contentType", contentType)
// Logger.debug("Base contentType", contentType)
if (contentType.includes("application/json")) {

@@ -48,0 +49,0 @@ return await response.json()

@@ -9,3 +9,3 @@ export enum LogLevel {

const LOGGER_PREFIX = process.env.LOGGER_PREFIX || "[ReAI]";
const LOGGER_PREFIX = process.env.LOGGER_PREFIX || "[ReAI-Free-Api]";

@@ -18,3 +18,3 @@ export class Logger {

if (!this.initialized) {
const logLevelEnv = process.env.LOGGER_LEVEL || "INFO";
const logLevelEnv = process.env.LOGGER_LEVEL || process.env.LOGGER_LEVEL_FREE_API || "INFO";
if (logLevelEnv) {

@@ -21,0 +21,0 @@ this.logLevel = LogLevel[logLevelEnv as keyof typeof LogLevel] || LogLevel.INFO;

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