Skip to content

Commit 027f213

Browse files
committed
Recompile JS. Bump to 0.1.4 to avoid confusion
1 parent 29dbb2b commit 027f213

File tree

4 files changed

+20
-18
lines changed

4 files changed

+20
-18
lines changed

gulpfile.coffee

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
browserify = require('browserify')
2+
coffeeify = require('coffeeify')
23
del = require('del')
34
gulp = require('gulp')
45
gutil = require('gulp-util')

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-priority-queue",
3-
"version": "0.1.3",
3+
"version": "0.1.4",
44
"description": "Priority queue data structures",
55
"main": "priority-queue.js",
66
"scripts": {},

priority-queue.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PriorityQueue = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
22
var AbstractPriorityQueue, ArrayStrategy, BHeapStrategy, BinaryHeapStrategy, PriorityQueue,
3-
__hasProp = {}.hasOwnProperty,
4-
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
3+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
4+
hasProp = {}.hasOwnProperty;
55

66
AbstractPriorityQueue = require('./PriorityQueue/AbstractPriorityQueue');
77

@@ -11,8 +11,8 @@ BinaryHeapStrategy = require('./PriorityQueue/BinaryHeapStrategy');
1111

1212
BHeapStrategy = require('./PriorityQueue/BHeapStrategy');
1313

14-
PriorityQueue = (function(_super) {
15-
__extends(PriorityQueue, _super);
14+
PriorityQueue = (function(superClass) {
15+
extend(PriorityQueue, superClass);
1616

1717
function PriorityQueue(options) {
1818
options || (options = {});
@@ -41,14 +41,15 @@ var AbstractPriorityQueue;
4141

4242
module.exports = AbstractPriorityQueue = (function() {
4343
function AbstractPriorityQueue(options) {
44+
var ref;
4445
if ((options != null ? options.strategy : void 0) == null) {
4546
throw 'Must pass options.strategy, a strategy';
4647
}
4748
if ((options != null ? options.comparator : void 0) == null) {
4849
throw 'Must pass options.comparator, a comparator';
4950
}
5051
this.priv = new options.strategy(options);
51-
this.length = 0;
52+
this.length = (options != null ? (ref = options.initialValues) != null ? ref.length : void 0 : void 0) || 0;
5253
}
5354

5455
AbstractPriorityQueue.prototype.queue = function(value) {
@@ -102,10 +103,10 @@ binarySearchForIndexReversed = function(array, value, comparator) {
102103

103104
module.exports = ArrayStrategy = (function() {
104105
function ArrayStrategy(options) {
105-
var _ref;
106+
var ref;
106107
this.options = options;
107108
this.comparator = this.options.comparator;
108-
this.data = ((_ref = this.options.initialValues) != null ? _ref.slice(0) : void 0) || [];
109+
this.data = ((ref = this.options.initialValues) != null ? ref.slice(0) : void 0) || [];
109110
this.data.sort(this.comparator).reverse();
110111
}
111112

@@ -139,7 +140,7 @@ var BHeapStrategy;
139140

140141
module.exports = BHeapStrategy = (function() {
141142
function BHeapStrategy(options) {
142-
var arr, i, shift, value, _i, _j, _len, _ref, _ref1;
143+
var arr, i, j, k, len, ref, ref1, shift, value;
143144
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
144145
return a - b;
145146
};
@@ -154,15 +155,15 @@ module.exports = BHeapStrategy = (function() {
154155
}
155156
this._shift = shift;
156157
this._emptyMemoryPageTemplate = arr = [];
157-
for (i = _i = 0, _ref = this.pageSize; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
158+
for (i = j = 0, ref = this.pageSize; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
158159
arr.push(null);
159160
}
160161
this._memory = [];
161162
this._mask = this.pageSize - 1;
162163
if (options.initialValues) {
163-
_ref1 = options.initialValues;
164-
for (_j = 0, _len = _ref1.length; _j < _len; _j++) {
165-
value = _ref1[_j];
164+
ref1 = options.initialValues;
165+
for (k = 0, len = ref1.length; k < len; k++) {
166+
value = ref1[k];
166167
this.queue(value);
167168
}
168169
}
@@ -290,19 +291,19 @@ var BinaryHeapStrategy;
290291

291292
module.exports = BinaryHeapStrategy = (function() {
292293
function BinaryHeapStrategy(options) {
293-
var _ref;
294+
var ref;
294295
this.comparator = (options != null ? options.comparator : void 0) || function(a, b) {
295296
return a - b;
296297
};
297298
this.length = 0;
298-
this.data = ((_ref = options.initialValues) != null ? _ref.slice(0) : void 0) || [];
299+
this.data = ((ref = options.initialValues) != null ? ref.slice(0) : void 0) || [];
299300
this._heapify();
300301
}
301302

302303
BinaryHeapStrategy.prototype._heapify = function() {
303-
var i, _i, _ref;
304+
var i, j, ref;
304305
if (this.data.length > 0) {
305-
for (i = _i = 1, _ref = this.data.length; 1 <= _ref ? _i < _ref : _i > _ref; i = 1 <= _ref ? ++_i : --_i) {
306+
for (i = j = 1, ref = this.data.length; 1 <= ref ? j < ref : j > ref; i = 1 <= ref ? ++j : --j) {
306307
this._bubbleUp(i);
307308
}
308309
}

priority-queue.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)