1 export function merge(...sets:Array<string>):string {
3 sets[0] = sets[0].slice(0, -1);
4 const xl = sets.length - 1;
5 for (let x = 1; x < xl; ++x) {
6 sets[x] = sets[x].slice(1, -1);
8 sets[xl] = sets[xl].slice(1);
15 export function subexp(str:string):string {
16 return "(?:" + str + ")";
19 export function typeOf(o:any):string {
20 return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase());
23 export function toUpperCase(str:string):string {
24 return str.toUpperCase();
27 export function toArray(obj:any):Array<any> {
28 return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];
32 export function assign(target: object, source: any): any {
33 const obj = target as any;
35 for (const key in source) {
36 obj[key] = source[key];