From 180f50f89ffc88732b7dda722177f38f776ac2a0 Mon Sep 17 00:00:00 2001 From: "killalau1988@hotmail.com" Date: Thu, 3 Jul 2014 22:45:39 +0800 Subject: [PATCH] Add missing API for underscore Add utility function unescape() --- underscore/underscore.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/underscore/underscore.d.ts b/underscore/underscore.d.ts index c9c6993266..5b64aceb13 100644 --- a/underscore/underscore.d.ts +++ b/underscore/underscore.d.ts @@ -1442,6 +1442,13 @@ interface UnderscoreStatic { **/ escape(str: string): string; + /** + * The opposite of escape, replaces &, <, >, ", and ' with their unescaped counterparts. + * @param str HTML escaped string. + * @return `str` Raw string. + **/ + unescape(str: string): string; + /** * If the value of the named property is a function then invoke it; otherwise, return it. * @param object Object to maybe invoke function `property` on. @@ -2283,6 +2290,12 @@ interface Underscore { **/ escape(): string; + /** + * Wrapped type `string`. + * @see _.unescape + **/ + unescape(): string; + /** * Wrapped type `object`. * @see _.result @@ -3106,6 +3119,12 @@ interface _Chain { **/ escape(): _Chain; + /** + * Wrapped type `string`. + * @see _.unescape + **/ + unescape(): _Chain; + /** * Wrapped type `object`. * @see _.result