diff --git a/uniq/uniq-tests.ts b/uniq/uniq-tests.ts new file mode 100644 index 0000000000..b9facc8e23 --- /dev/null +++ b/uniq/uniq-tests.ts @@ -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)); diff --git a/uniq/uniq.d.ts b/uniq/uniq.d.ts new file mode 100644 index 0000000000..f682262c91 --- /dev/null +++ b/uniq/uniq.d.ts @@ -0,0 +1,15 @@ +// Type definitions for uniq +// Project: https://www.npmjs.com/package/uniq +// Definitions by: Hans Windhoff +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +interface Uniq{ + (ip:Array): Array; +} + +declare var uniq :Uniq; + +declare module "uniq" { +export = uniq; +}