You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@honeypot-run/core

Package Overview
Dependencies
Maintainers
0
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@honeypot-run/core - npm Package Compare versions

Comparing version

to
0.2.41

28

dist/cjs/src/public/Honeypot.js

@@ -150,20 +150,7 @@ "use strict";

get() {
var _a, _b;
var _a;
return __awaiter(this, void 0, void 0, function* () {
let timeoutMs = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.timeoutMs) || 600;
const loadWithTimeout = (url) => __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => reject(new Error("Load timeout")), timeoutMs + 5);
this.load(url).then(() => {
clearTimeout(timeout);
resolve(null);
}).catch((error) => {
clearTimeout(timeout);
reject(error);
});
});
});
if (!this.didLoad && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.url)) {
if (!this.didLoad && ((_a = this.config) === null || _a === void 0 ? void 0 : _a.url)) {
try {
yield loadWithTimeout(this.config.url);
yield this.load(this.config.url);
if (window.honeypot) {

@@ -174,7 +161,6 @@ return window.honeypot.get();

catch (error) {
throw new Error(`Failed to load within the specified timeout: ${timeoutMs}`);
throw new Error(`Failed to load`);
}
}
return new Promise((resolve, reject) => {
let t = Date.now();
const e = () => {

@@ -184,7 +170,7 @@ if (window.honeypot && window.honeypot.honey) {

}
else if (Date.now() - t >= timeoutMs) {
reject(new Error("Honey not found"));
else if (window.honeypot) {
return window.honeypot.get();
}
else {
setTimeout(e, 50);
reject(new Error("Honey not found"));
}

@@ -191,0 +177,0 @@ };

@@ -6,3 +6,2 @@ import { honeypot } from "./Honeypot";

url?: string;
timeoutMs?: number;
debug?: boolean;

@@ -9,0 +8,0 @@ }

@@ -147,20 +147,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

get() {
var _a, _b;
var _a;
return __awaiter(this, void 0, void 0, function* () {
let timeoutMs = ((_a = this.config) === null || _a === void 0 ? void 0 : _a.timeoutMs) || 600;
const loadWithTimeout = (url) => __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => reject(new Error("Load timeout")), timeoutMs + 5);
this.load(url).then(() => {
clearTimeout(timeout);
resolve(null);
}).catch((error) => {
clearTimeout(timeout);
reject(error);
});
});
});
if (!this.didLoad && ((_b = this.config) === null || _b === void 0 ? void 0 : _b.url)) {
if (!this.didLoad && ((_a = this.config) === null || _a === void 0 ? void 0 : _a.url)) {
try {
yield loadWithTimeout(this.config.url);
yield this.load(this.config.url);
if (window.honeypot) {

@@ -171,7 +158,6 @@ return window.honeypot.get();

catch (error) {
throw new Error(`Failed to load within the specified timeout: ${timeoutMs}`);
throw new Error(`Failed to load`);
}
}
return new Promise((resolve, reject) => {
let t = Date.now();
const e = () => {

@@ -181,7 +167,7 @@ if (window.honeypot && window.honeypot.honey) {

}
else if (Date.now() - t >= timeoutMs) {
reject(new Error("Honey not found"));
else if (window.honeypot) {
return window.honeypot.get();
}
else {
setTimeout(e, 50);
reject(new Error("Honey not found"));
}

@@ -188,0 +174,0 @@ };

@@ -6,3 +6,2 @@ import { honeypot } from "./Honeypot";

url?: string;
timeoutMs?: number;
debug?: boolean;

@@ -9,0 +8,0 @@ }

@@ -5,3 +5,3 @@ {

"author": "https://honeypot.run",
"version": "0.2.4",
"version": "0.2.41",
"license": "BUSL-1.1",

@@ -41,3 +41,4 @@ "keywords": [

"dependencies": {
"@rrweb/record": "^2.0.0-alpha.15"
"@rrweb/record": "^2.0.0-alpha.4",
"rrweb": "^2.0.0-alpha.4"
},

@@ -44,0 +45,0 @@ "devDependencies": {