first working version
This commit is contained in:
5
ts/index.ts
Normal file
5
ts/index.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import * as plugins from "./lik.plugins";
|
||||
|
||||
// import modules
|
||||
|
||||
export * from "./lik.stringmap";
|
2
ts/lik.plugins.ts
Normal file
2
ts/lik.plugins.ts
Normal file
@ -0,0 +1,2 @@
|
||||
import "typings-global";
|
||||
export import q = require("q");
|
35
ts/lik.stringmap.ts
Normal file
35
ts/lik.stringmap.ts
Normal file
@ -0,0 +1,35 @@
|
||||
import * as plugins from "./lik.plugins";
|
||||
|
||||
/**
|
||||
* allows you to easily keep track of a bunch of strings;
|
||||
*/
|
||||
export class Stringmap {
|
||||
private _stringArray:string[] = [];
|
||||
constructor(){
|
||||
|
||||
};
|
||||
/**
|
||||
* add a string to the Stringmap
|
||||
*/
|
||||
addString(stringArg:string){
|
||||
this._stringArray.push(stringArg);
|
||||
};
|
||||
|
||||
/**
|
||||
* removes a string from Stringmap
|
||||
*/
|
||||
removeString(stringArg:string){
|
||||
for (let keyArg in this._stringArray){
|
||||
if(this._stringArray[keyArg] == stringArg){
|
||||
this._stringArray.splice(parseInt(keyArg),1);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* check if string is in Stringmap
|
||||
*/
|
||||
checkString(stringArg:string):boolean{
|
||||
return this._stringArray.indexOf(stringArg) != -1;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user