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

sajari-website

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sajari-website - npm Package Compare versions

Comparing version 0.8.1 to 0.9.0

2

package.json
{
"name": "sajari-website",
"version": "0.8.1",
"version": "0.9.0",
"description": "Website extensions for the Sajari API. Automatically index site content, add user profiles, render search and recommendations, etc.",

@@ -5,0 +5,0 @@ "author": {

@@ -185,2 +185,29 @@ /*

/**
* Looks for specific field=value pairs on html elements
*/
fieldValMeta : function(node, attrs) {
var pre = this.prefix;
this.eachNode('field', function(node) {
var val = node.getAttribute(pre+"value");
var field = node.getAttribute(pre+"field");
var attr = "";
if (val !== undefined && val !== null) {
attr = val;
} else if (node.innerHTML !== undefined &&node.innerHTML !== null) {
attr = node.innerHTML;
}
if (attr !== "") {
if (typeof attrs[field] === 'undefined') {
attrs[field] = attr;
} else if (typeof attrs[field] === 'object') {
attrs[field].push(attr);
} else if (typeof attrs[field] === 'string') {
var old = attrs[field];
attrs[field] = [old, attr];
}
}
})
},
/**
* Returns the URI parameters of dynamic this.prefix attributes

@@ -187,0 +214,0 @@ */

@@ -32,3 +32,3 @@ require("./utils/polyfills");

'related', 'best', 'search-recent', 'search-noresults', 'search-error', 'personalization', 'overlay',
'local'
'local', 'field'
]

@@ -615,4 +615,4 @@ };

// Set the company
company: function(newCompany) {
opts.company = newCompany + '';
company: function(newProject) {
opts.project = newProject + '';
},

@@ -755,7 +755,8 @@

page.meta = hash.Meta(document);
dom.dynamicMeta(document, page.meta);
dom.dynamicMeta(document, page.meta); // old style, e.g. data-sj-meta-field
dom.fieldValMeta(document, page.meta); // new style e.g. data-sj-field="field"
// Add the readability MD5 hash for the page to the data sent with indexing ping
page.bodyMD5 = hash.Hash(document);
page.metaMD5 = hash.ObjHash(page.meta);
page.bodyChecksum = hash.Hash(document);
page.metaChecksum = hash.ObjHash(page.meta);

@@ -762,0 +763,0 @@ // Send page for indexing

Sorry, the diff of this file is too big to display

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