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

@2fn/data

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@2fn/data - npm Package Compare versions

Comparing version 1.0.1 to 1.0.4

12

dist/strapi.js

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

return __awaiter(this, void 0, void 0, function () {
var config;
var config, e_1;
return __generator(this, function (_a) {

@@ -50,4 +50,12 @@ switch (_a.label) {

config = conf_1.getConfig();
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 4]);
return [4 /*yield*/, axios_1["default"].get(config.dataSource.url + "/" + collection)];
case 1: return [2 /*return*/, (_a.sent()).data];
case 2: return [2 /*return*/, (_a.sent()).data];
case 3:
e_1 = _a.sent();
console.log("failed to retrieve data from strapi", e_1);
return [2 /*return*/, null];
case 4: return [2 /*return*/];
}

@@ -54,0 +62,0 @@ });

2

package.json
{
"name": "@2fn/data",
"version": "1.0.1",
"version": "1.0.4",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -5,3 +5,8 @@ import axios from 'axios';

const config = getConfig();
return (await axios.get(`${config.dataSource.url}/${collection}`)).data;
try {
return (await axios.get(`${config.dataSource.url}/${collection}`)).data;
} catch (e) {
console.log(`failed to retrieve data from strapi`, e);
return null;
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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