Socket
Socket
Sign inDemoInstall

@peerboard/core

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@peerboard/core - npm Package Compare versions

Comparing version 0.0.21 to 0.0.22

29

dist/lib/peerboard-core.js

@@ -59,11 +59,28 @@ "use strict";

exports.createForum = function (forumID, container, options) {
var opts = __assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true });
var opts = __assign(__assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true }), options);
if (!opts.usePathFromQs) {
// Auto resolve final location
opts.path = ((options.prefix && options.prefix !== "/")
// Auto resolve final location using part after the prefix
if (opts.prefix && opts.prefix !== "/") {
// Cut everything before the prefix to support /{lang}/{prefix}/{peer-board-path} cases
? document.location.pathname.replace(new RegExp(".*/" + trimLeftSlash(options.prefix)), '')
: document.location.pathname) + document.location.search + document.location.hash;
var matches = new RegExp("(.*/" + trimLeftSlash(opts.prefix) + ")(.*)").exec(document.location.pathname);
// Let's use current path and the root as best guess
var prefix = document.location.pathname;
var pbProductPath = "/";
if (matches) {
if (matches[1]) {
prefix = matches[1];
}
if (matches[2]) {
pbProductPath = matches[2];
}
}
opts.prefix = prefix; // override prefix to calculate proper path updates in remote embed script
opts.path = "/" + trimLeftSlash(pbProductPath);
}
else {
// TODO: For the root we cannot reliably detect language, country codes guess?
opts.path = document.location.pathname;
}
opts.path += document.location.search + document.location.hash;
}
Object.assign(opts, options);
return exports.loadSdk(options.sdkURL).then(function () {

@@ -70,0 +87,0 @@ if (!forumSDK) {

@@ -74,11 +74,28 @@ 'use strict';

var createForum = function (forumID, container, options) {
var opts = __assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true });
var opts = __assign(__assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true }), options);
if (!opts.usePathFromQs) {
// Auto resolve final location
opts.path = ((options.prefix && options.prefix !== "/")
// Auto resolve final location using part after the prefix
if (opts.prefix && opts.prefix !== "/") {
// Cut everything before the prefix to support /{lang}/{prefix}/{peer-board-path} cases
? document.location.pathname.replace(new RegExp(".*/" + trimLeftSlash(options.prefix)), '')
: document.location.pathname) + document.location.search + document.location.hash;
var matches = new RegExp("(.*/" + trimLeftSlash(opts.prefix) + ")(.*)").exec(document.location.pathname);
// Let's use current path and the root as best guess
var prefix = document.location.pathname;
var pbProductPath = "/";
if (matches) {
if (matches[1]) {
prefix = matches[1];
}
if (matches[2]) {
pbProductPath = matches[2];
}
}
opts.prefix = prefix; // override prefix to calculate proper path updates in remote embed script
opts.path = "/" + trimLeftSlash(pbProductPath);
}
else {
// TODO: For the root we cannot reliably detect language, country codes guess?
opts.path = document.location.pathname;
}
opts.path += document.location.search + document.location.hash;
}
Object.assign(opts, options);
return loadSdk(options.sdkURL).then(function () {

@@ -85,0 +102,0 @@ if (!forumSDK) {

@@ -76,11 +76,28 @@ (function (global, factory) {

var createForum = function (forumID, container, options) {
var opts = __assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true });
var opts = __assign(__assign(__assign({}, defaultOptions), { scrollToTopOnNavigationChanged: true }), options);
if (!opts.usePathFromQs) {
// Auto resolve final location
opts.path = ((options.prefix && options.prefix !== "/")
// Auto resolve final location using part after the prefix
if (opts.prefix && opts.prefix !== "/") {
// Cut everything before the prefix to support /{lang}/{prefix}/{peer-board-path} cases
? document.location.pathname.replace(new RegExp(".*/" + trimLeftSlash(options.prefix)), '')
: document.location.pathname) + document.location.search + document.location.hash;
var matches = new RegExp("(.*/" + trimLeftSlash(opts.prefix) + ")(.*)").exec(document.location.pathname);
// Let's use current path and the root as best guess
var prefix = document.location.pathname;
var pbProductPath = "/";
if (matches) {
if (matches[1]) {
prefix = matches[1];
}
if (matches[2]) {
pbProductPath = matches[2];
}
}
opts.prefix = prefix; // override prefix to calculate proper path updates in remote embed script
opts.path = "/" + trimLeftSlash(pbProductPath);
}
else {
// TODO: For the root we cannot reliably detect language, country codes guess?
opts.path = document.location.pathname;
}
opts.path += document.location.search + document.location.hash;
}
Object.assign(opts, options);
return loadSdk(options.sdkURL).then(function () {

@@ -87,0 +104,0 @@ if (!forumSDK) {

{
"name": "@peerboard/core",
"version": "0.0.21",
"version": "0.0.22",
"description": "peerboard.com frontend components",

@@ -5,0 +5,0 @@ "keywords": [

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

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