This commit is contained in:
hansrwindhoff
2015-04-20 17:30:50 -06:00
parent 08ae0b1793
commit 058e1f9054
2 changed files with 22 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
import unique = require("uniq");
var data = [1, 2, 2, 3, 4, 5, 5, 5, 6];
var datastr = ["1", "2", "2", "3", "4", "5", "5", "5", "6"];
var dataMix = ["1", 2,"2", {"2":2}, "3", "4", "5", "5", "5", "6"];
console.log(unique(data));
console.log(unique(datastr));
console.log(unique(dataMix));
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for uniq
// Project: https://www.npmjs.com/package/uniq
// Definitions by: Hans Windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Uniq{
<T>(ip:Array<T>): Array<T>;
}
declare var uniq :Uniq;
declare module "uniq" {
export = uniq;
}