diff --git a/clone/clone-tests.ts b/clone/clone-tests.ts index 12a853534..6a25fb7c3 100644 --- a/clone/clone-tests.ts +++ b/clone/clone-tests.ts @@ -6,4 +6,5 @@ var original = { var copy = clone(original); copy = clone(original, false); -copy = clone(original, true); +copy = clone(original, true, 1); +copy = clone.clonePrototype(original); diff --git a/clone/clone.d.ts b/clone/clone.d.ts index cf11069e0..08acc62e4 100644 --- a/clone/clone.d.ts +++ b/clone/clone.d.ts @@ -7,18 +7,19 @@ * See clone JS source for API docs */ declare module "clone" { - var clone: { - /** - * @param val the value that you want to clone, any type allowed - * @param circular Call clone with circular set to false if you are certain that obj contains no circular references. This will give better performance if needed. There is no error if undefined or null is passed as obj. - * @param depth to wich the object is to be cloned (optional, defaults to infinity) - */ - (val: T, circular?: boolean, depth?: number): T; + /** + * @param val the value that you want to clone, any type allowed + * @param circular Call clone with circular set to false if you are certain that obj contains no circular references. This will give better performance if needed. There is no error if undefined or null is passed as obj. + * @param depth to wich the object is to be cloned (optional, defaults to infinity) + */ + function clone(val: T, circular?: boolean, depth?: number): T; + + module clone { /** * @param obj the object that you want to clone */ - clonePrototype(obj: T): T; - }; + function clonePrototype(obj: T): T; + } export = clone }