You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

wildstring

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

wildstring - npm Package Compare versions

Comparing version

to
1.0.9

documentation/styles/site.dibs-bootstrap.css

0

documentation/scripts/bootstrap-dropdown.js

@@ -0,0 +0,0 @@ /* ============================================================

44

documentation/scripts/toc.js

@@ -7,6 +7,8 @@ (function($) {

var container = $(opts.container);
var tocs = [];
var headings = $(opts.selectors, container);
var headingOffsets = [];
var activeClassName = opts.prefix+'-active';
var activeClassName = 'active';
var navbarHeight = $('.navbar').height();
var ANCHOR_PREFIX = "__anchor";

@@ -17,5 +19,6 @@ var scrollTo = function(e) {

var elScrollTo = $(e.target).attr('href');
var $el = $(elScrollTo);
var offsetTop = $el.offset().top - navbarHeight;
var $el = $(elScrollTo.replace('#.', '#\\.') + ANCHOR_PREFIX);
var offsetTop = $el.offset().top - (navbarHeight + opts.navbarOffset);
$('body,html').animate({ scrollTop: offsetTop }, 400, 'swing', function() {

@@ -29,2 +32,10 @@ location.hash = elScrollTo;

var calcHadingOffsets = function() {
headingOffsets = [];
headings.each(function(i, heading) {
var top = $(heading).prev("span").offset().top - (navbarHeight + opts.navbarOffset);
headingOffsets.push(top > 0 ? top : 0);
});
}
//highlight on scroll

@@ -40,6 +51,6 @@ var timeout;

for (var i = 0, c = headingOffsets.length; i < c; i++) {
if (headingOffsets[i] >= top) {
if (headingOffsets[i] >= top || (headingOffsets[i + 1] && headingOffsets[i + 1] > top)) {
$('li', self).removeClass(activeClassName);
if (i > 0) {
highlighted = $('li:eq('+(i-1)+')', self).addClass(activeClassName);
if (i >= 0) {
highlighted = tocs[i].addClass(activeClassName);
opts.onHighlight(highlighted);

@@ -54,3 +65,6 @@ }

$(window).bind('scroll', highlightOnScroll);
highlightOnScroll();
$(window).bind('load resize', function() {
calcHadingOffsets();
highlightOnScroll();
});
}

@@ -62,8 +76,7 @@

var ul = $('<ul/>');
headings.each(function(i, heading) {
var $h = $(heading);
headingOffsets.push($h.offset().top - opts.highlightOffset);
//add anchor
var anchor = $('<span/>').attr('id', opts.anchorName(i, heading, opts.prefix)).insertBefore($h);
var anchor = $('<span/>').attr('id', opts.anchorName(i, heading, opts.prefix) + ANCHOR_PREFIX).insertBefore($h);

@@ -74,3 +87,3 @@ //build TOC item

.attr('href', '#' + opts.anchorName(i, heading, opts.prefix))
.bind('click', function(e) {
.bind('click', function(e) {
scrollTo(e);

@@ -84,6 +97,13 @@ el.trigger('selected', $(this).attr('href'));

tocs.push(li);
ul.append(li);
});
el.html(ul);
calcHadingOffsets();
});
};

@@ -99,3 +119,3 @@

highlightOnScroll: true,
highlightOffset: 100,
navbarOffset: 0,
anchorName: function(i, heading, prefix) {

@@ -102,0 +122,0 @@ return prefix+i;

@@ -29,3 +29,3 @@ 'use strict';

destination: 'documentation',
template : 'node_modules/grunt-jsdoc/node_modules/ink-docstrap/template',
template : 'node_modules/ink-docstrap/template',
configure : 'jsdoc.conf.json'

@@ -32,0 +32,0 @@ }

@@ -270,2 +270,14 @@ 'use strict';

});
it('should be able to see the same character as a wildcard', function() {
// Given: a string with the same character multiple times, and a pattern with a wildcard and some of the same character
var pattern = '*zz',
string = 'zzz';
// When: we call wildstring.match
var result = wildstring.match(pattern, string);
// Then: we should see that they match
assert.equal(result, true);
});
});

@@ -272,0 +284,0 @@

{
"name": "wildstring",
"version": "1.0.8",
"version": "1.0.9",
"description": "Simple String Wildcard Handling",

@@ -32,2 +32,3 @@ "main": "wildstring.js",

"chai": "^3.2.0",
"grunt": "^0.4.5",
"grunt-cli": "^0.1.13",

@@ -49,5 +50,5 @@ "grunt-contrib-jshint": "^0.11.0",

"mocha": "^2.2.5",
"phantomjs": "^1.9.18",
"phantomjs": "^2.1.0",
"time-grunt": "^1.1.0"
}
}

@@ -264,2 +264,14 @@ 'use strict';

});
it('should be able to see the same character as a wildcard', function() {
// Given: a string with the same character multiple times, and a pattern with a wildcard and some of the same character
var pattern = '*zz',
string = 'zzz';
// When: we call wildstring.match
var result = wildstring.match(pattern, string);
// Then: we should see that they match
assert.equal(result, true);
});
});

@@ -266,0 +278,0 @@

@@ -33,3 +33,2 @@ 'use strict';

rollbackStrings.pop();
break;
}

@@ -36,0 +35,0 @@

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

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

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

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

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

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

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

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

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

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