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

canonical-url

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canonical-url - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

8

build/canonical.js

@@ -18,6 +18,6 @@ "use strict";

class Canonical {
constructor(url, canonicalTag) {
constructor(url, canonicalTag, title) {
this.url = new URL(url);
this.canonicalTag = canonicalTag;
this.title = '';
this.title = title;
this.allSearchParams = [];

@@ -31,3 +31,5 @@ this.url.searchParams.sort();

return __awaiter(this, void 0, void 0, function* () {
this.title = yield this.getTitleFromUrl(this.url.href);
if (!this.title) {
this.title = yield this.getTitleFromUrl(this.url.href);
}
// test canonical tag

@@ -34,0 +36,0 @@ if (this.canonicalTag) {

{
"name": "canonical-url",
"version": "1.0.5",
"version": "1.0.6",
"description": "Attempt to find the least common denominator of similar urls",

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

@@ -12,7 +12,7 @@ import wretch from 'wretch';

constructor (url: string, canonicalTag: string) {
constructor (url: string, canonicalTag: string, title: string) {
this.url = new URL(url);
this.canonicalTag = canonicalTag;
this.title = '';
this.title = title;

@@ -27,3 +27,5 @@ this.allSearchParams = [];

async findUrl () {
this.title = await this.getTitleFromUrl(this.url.href);
if (!this.title) {
this.title = await this.getTitleFromUrl(this.url.href);
}
// test canonical tag

@@ -30,0 +32,0 @@ if (this.canonicalTag) {

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