Run tests on Travis-CI.
[dygraphs.git] / jsdoc-toolkit / app / frame.js
CommitLineData
629a09ae
DV
1IO.include("frame/Opt.js");
2IO.include("frame/Chain.js");
3IO.include("frame/Link.js");
4IO.include("frame/String.js");
5IO.include("frame/Hash.js");
6IO.include("frame/Namespace.js");
7//IO.include("frame/Reflection.js");
8
9/** A few helper functions to make life a little easier. */
10
11function defined(o) {
12 return (o !== undefined);
13}
14
15function copy(o) { // todo check for circular refs
16 if (o == null || typeof(o) != 'object') return o;
17 var c = new o.constructor();
18 for(var p in o) c[p] = copy(o[p]);
19 return c;
20}
21
22function isUnique(arr) {
23 var l = arr.length;
24 for(var i = 0; i < l; i++ ) {
25 if (arr.lastIndexOf(arr[i]) > i) return false;
26 }
27 return true;
28}
29
30/** Returns the given string with all regex meta characters backslashed. */
31RegExp.escapeMeta = function(str) {
32 return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
33}