PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/jsdoc_toolkit-2.2.1/jsdoc-toolkit/app/frame.js

http://jsdoc-toolkit.googlecode.com/
JavaScript | 33 lines | 25 code | 5 blank | 3 comment | 7 complexity | 36b1fb6e7c02f8d78d3622f5a742a35d MD5 | raw file
 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}