Breaking changes.

This commit is contained in:
Lars Jung 2015-10-24 19:20:31 +02:00
parent 2b2656b7e1
commit 1ae45f6cbb
56 changed files with 457 additions and 379 deletions

48
test/vendor/uniq.js vendored Normal file
View file

@ -0,0 +1,48 @@
/* uniq 0.3.1 - http://larsjung.de/uniq/ */
(function (root, factory) {
'use strict';
if (typeof module !== 'undefined') {
module.exports = factory();
} else {
root.uniq = factory();
}
}(this, function () {
'use strict';
var PREFIX = 'UNIQ-';
var SUFFIX = '-ID';
var LENGTH = 4;
var ZERO_PAD = new Array(LENGTH + 1).join('0');
var RE_ID = new RegExp('^' + PREFIX + '\\d{' + LENGTH + '}' + SUFFIX + '$');
var counter = 0;
function id() {
counter += 1;
return PREFIX + (ZERO_PAD + counter).substr(-LENGTH) + SUFFIX;
}
function isId(sequence) {
return RE_ID.test(sequence);
}
function obj() {
return {_uniq_id: id()};
}
function path(suffix) {
return '/_uniq_path/' + id() + (suffix ? suffix : '');
}
return {
id: id,
isId: isId,
obj: obj,
path: path
};
}));