Skip to content

Commit

Permalink
Travis CI - [ci skip] - automatic dist folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed Dec 24, 2015
1 parent 0b45d8a commit a92e374
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 72 deletions.
115 changes: 45 additions & 70 deletions dist/kuzzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,74 +4,53 @@
// Copyright (c) 2010-2012 Robert Kieffer
// MIT License - http://opensource.org/licenses/mit-license.php

/*global window, require, define */
(function(_window) {
'use strict';
(function() {
var _global = this;

// Unique ID creation requires a high quality random # generator. We feature
// detect to determine the best RNG source, normalizing to a function that
// returns 128-bits of randomness, since that's what's usually required
var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot;

function setupBrowser() {
// Allow for MSIE11 msCrypto
var _crypto = _window.crypto || _window.msCrypto;

if (!_rng && _crypto && _crypto.getRandomValues) {
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
//
// Moderately fast, high quality
try {
var _rnds8 = new Uint8Array(16);
_whatwgRNG = _rng = function whatwgRNG() {
_crypto.getRandomValues(_rnds8);
return _rnds8;
};
_rng();
} catch(e) {}
}

if (!_rng) {
// Math.random()-based (RNG)
//
// If all else fails, use Math.random(). It's fast, but is of unspecified
// quality.
var _rnds = new Array(16);
_mathRNG = _rng = function() {
for (var i = 0, r; i < 16; i++) {
if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; }
_rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
var _rng;

return _rnds;
};
if ('undefined' !== typeof console && console.warn) {
console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()");
}
}
// Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
//
// Moderately fast, high quality
if (typeof(_global.require) == 'function') {
try {
var _rb = _global.require('crypto').randomBytes;
_rng = _rb && function() {return _rb(16);};
} catch(e) {}
}

function setupNode() {
// Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
if (!_rng && _global.crypto && crypto.getRandomValues) {
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
//
// Moderately fast, high quality
if ('function' === typeof require) {
try {
var _rb = require('crypto').randomBytes;
_nodeRNG = _rng = _rb && function() {return _rb(16);};
_rng();
} catch(e) {}
}
var _rnds8 = new Uint8Array(16);
_rng = function whatwgRNG() {
crypto.getRandomValues(_rnds8);
return _rnds8;
};
}

if (_window) {
setupBrowser();
} else {
setupNode();
if (!_rng) {
// Math.random()-based (RNG)
//
// If all else fails, use Math.random(). It's fast, but is of unspecified
// quality.
var _rnds = new Array(16);
_rng = function() {
for (var i = 0, r; i < 16; i++) {
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
_rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
}

return _rnds;
};
}

// Buffer class to use
var BufferClass = ('function' === typeof Buffer) ? Buffer : Array;
var BufferClass = typeof(_global.Buffer) == 'function' ? _global.Buffer : Array;

// Maps for number <-> hex string conversion
var _byteToHex = [];
Expand Down Expand Up @@ -140,17 +119,17 @@

options = options || {};

var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq;
var clockseq = options.clockseq != null ? options.clockseq : _clockseq;

// UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
var msecs = (options.msecs != null) ? options.msecs : new Date().getTime();
var msecs = options.msecs != null ? options.msecs : new Date().getTime();

// Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1;
var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;

// Time since last uuid creation (in msecs)
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
Expand Down Expand Up @@ -216,8 +195,8 @@
// Deprecated - 'format' argument, as supported in v1.2
var i = buf && offset || 0;

if (typeof(options) === 'string') {
buf = (options === 'binary') ? new BufferClass(16) : null;
if (typeof(options) == 'string') {
buf = options == 'binary' ? new BufferClass(16) : null;
options = null;
}
options = options || {};
Expand Down Expand Up @@ -245,32 +224,28 @@
uuid.parse = parse;
uuid.unparse = unparse;
uuid.BufferClass = BufferClass;
uuid._rng = _rng;
uuid._mathRNG = _mathRNG;
uuid._nodeRNG = _nodeRNG;
uuid._whatwgRNG = _whatwgRNG;

if (('undefined' !== typeof module) && module.exports) {
if (typeof(module) != 'undefined' && module.exports) {
// Publish as node.js module
module.exports = uuid;
} else if (typeof define === 'function' && define.amd) {
} else if (typeof define === 'function' && define.amd) {
// Publish as AMD module
define(function() {return uuid;});


} else {
// Publish as global (in browsers)
_previousRoot = _window.uuid;
var _previousRoot = _global.uuid;

// **`noConflict()` - (browser only) to reset global 'uuid' var**
uuid.noConflict = function() {
_window.uuid = _previousRoot;
_global.uuid = _previousRoot;
return uuid;
};

_window.uuid = uuid;
_global.uuid = uuid;
}
})('undefined' !== typeof window ? window : null);
}).call(this);

},{}],2:[function(require,module,exports){
var
Expand Down
Loading

0 comments on commit a92e374

Please sign in to comment.