Socket
Socket
Sign inDemoInstall

reflect-metadata

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reflect-metadata - npm Package Compare versions

Comparing version 0.1.13 to 0.1.14

98

docs/ecmarkup.js

@@ -8,9 +8,14 @@ "use strict";

this.$searchResults = document.getElementById('menu-search-results');
this.loadBiblio();
document.addEventListener('keydown', this.documentKeydown.bind(this));
this.$searchBox.addEventListener('keydown', debounce(this.searchBoxKeydown.bind(this), { stopPropagation: true }));
this.$searchBox.addEventListener('keyup', debounce(this.searchBoxKeyup.bind(this), { stopPropagation: true }));
// Perform an initial search if the box is not empty.
if (this.$searchBox.value) {
this.search(this.$searchBox.value);
}
}

@@ -55,3 +60,3 @@

}
this.search(e.target.value);

@@ -79,15 +84,15 @@ }

var relevance = 0;
relevance = Math.max(0, 8 - result.match.chunks) << 7;
if (result.match.caseMatch) {
relevance *= 2;
}
if (result.match.prefix) {
relevance += 2048
}
relevance += Math.max(0, 255 - result.entry.key.length);
return relevance;

@@ -97,4 +102,2 @@ }

Search.prototype.search = function (searchString) {
var s = Date.now();
if (searchString === '') {

@@ -107,3 +110,3 @@ this.displayResults([]);

}
if (searchString.length === 1) {

@@ -113,3 +116,3 @@ this.displayResults([]);

}
var results;

@@ -125,3 +128,3 @@

results = [];
for (var i = 0; i < this.biblio.length; i++) {

@@ -139,7 +142,7 @@ var entry = this.biblio[i];

}
results.forEach(function (result) {
result.relevance = relevance(result, searchString);
});
results = results.sort(function (a, b) { return b.relevance - a.relevance });

@@ -152,3 +155,3 @@

}
this.displayResults(results);

@@ -170,3 +173,3 @@ }

}
this.$searchBox.value = '';

@@ -185,3 +188,3 @@ this.$searchBox.blur();

this.$searchResults.classList.remove('no-results');
var html = '<ul>';

@@ -203,3 +206,3 @@

cssClass = 'prod';
id = entry.id;
id = entry.id;
} else if (entry.type === 'op') {

@@ -216,3 +219,3 @@ text = entry.key;

if (text) {
html += '<li class=menu-search-result-' + cssClass + '><a href="#' + id + '">' + text + '</a></li>'
html += '<li class=menu-search-result-' + cssClass + '><a href="#' + id + '">' + text + '</a></li>';
}

@@ -240,3 +243,3 @@ });

this.search = new Search(this);
this._pinnedIds = {};

@@ -286,5 +289,5 @@ this.loadPinEntries();

if (offBottom) {
e.preventDefault();
}
})
e.preventDefault();
}
});
}

@@ -316,3 +319,3 @@

}
var current = this.$toc;

@@ -328,3 +331,3 @@ var index = 0;

var rect = children[i].getBoundingClientRect();
this.$toc.getBoundingClientRect().top
// this.$toc.getBoundingClientRect().top;
var tocRect = this.$toc.getBoundingClientRect();

@@ -340,5 +343,5 @@ if (rect.top + 10 > tocRect.bottom) {

break;
}
}
}
}

@@ -350,16 +353,14 @@ }

var $clause;
var found = false;
var path = path || [];
while ($clause = clauses.nextNode()) {
var rect = $clause.getBoundingClientRect();
var $header = $clause.children[0];
var $header = $clause.querySelector("h1");
var marginTop = parseInt(getComputedStyle($header)["margin-top"]);
if ((rect.top - marginTop) <= 0 && rect.bottom > 0) {
found = true;
return findActiveClause($clause, path.concat($clause)) || path;
}
}
return path;

@@ -389,3 +390,3 @@ }

);
return treeWalker;

@@ -473,3 +474,3 @@ }

}
var pinsString = window.localStorage.pinEntries;

@@ -506,2 +507,7 @@ if (!pinsString) return;

}));
document.addEventListener('keydown', debounce(function (e) {
if (e.code === "Escape" && Toolbox.active) {
Toolbox.deactivate();
}
}));
}

@@ -605,8 +611,7 @@

var finding = false;
var prefix = true;
if (qlen > tlen) {
return false;
}
if (qlen === tlen) {

@@ -621,3 +626,3 @@ if (searchString === haystack) {

}
outer: for (var i = 0, j = 0; i < qlen; i++) {

@@ -636,8 +641,8 @@ var nch = searchString[i];

}
if (caseInsensitive) { return false }
if (caseInsensitive) { return false; }
return fuzzysearch(searchString.toLowerCase(), haystack.toLowerCase(), true);
}
return { caseMatch: !caseInsensitive, chunks: chunks, prefix: j <= qlen };

@@ -799,3 +804,2 @@ }

var clause = menu.search.biblio.byId[cid];
var dupCount = 0;
return { id: id, clause: clause }

@@ -840,3 +844,3 @@ }).sort(function (a, b) {

}
var c1 = c1c[i];

@@ -843,0 +847,0 @@ var c2 = c2c[i];

{
"name": "reflect-metadata",
"version": "0.1.13",
"version": "0.1.14",
"description": "Polyfill for Metadata Reflection API",

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

@@ -66,3 +66,3 @@ /*! *****************************************************************************

var functionPrototype = Object.getPrototypeOf(Function);
var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
var usePolyfill = typeof process === "object" && process["env" + ""] && process["env" + ""]["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();

@@ -69,0 +69,0 @@ var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();

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