diff --git a/escape-string-regexp/escape-string-regexp-tests.ts b/escape-string-regexp/escape-string-regexp-tests.ts new file mode 100644 index 000000000..0e9e9e54c --- /dev/null +++ b/escape-string-regexp/escape-string-regexp-tests.ts @@ -0,0 +1,8 @@ +/// + +import escapeStringRegexp = require('escape-string-regexp'); + +var inputString: string = '^abc$'; +var outputString: string; + +outputString = escapeStringRegexp(inputString); diff --git a/escape-string-regexp/escape-string-regexp.d.ts b/escape-string-regexp/escape-string-regexp.d.ts new file mode 100644 index 000000000..74b095823 --- /dev/null +++ b/escape-string-regexp/escape-string-regexp.d.ts @@ -0,0 +1,12 @@ +// Type definitions for escape-string-regexp +// Project: https://github.com/sindresorhus/escape-string-regexp +// Definitions by: kruncher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "escape-string-regexp" { + + function escapeStringRegexp(str: string): string; + + export = escapeStringRegexp; + +} diff --git a/format-unicorn/format-unicorn-safe-tests.ts b/format-unicorn/format-unicorn-safe-tests.ts new file mode 100644 index 000000000..e83f2023f --- /dev/null +++ b/format-unicorn/format-unicorn-safe-tests.ts @@ -0,0 +1,11 @@ +/// + +import formatUnicorn = require('format-unicorn/safe'); + +// Safe version +var outputString: string; + +outputString = formatUnicorn('Hello, {name}; you have {favoriteNumber}', { + name: "kruncher", + favoriteNumber: 42 +}); diff --git a/format-unicorn/format-unicorn-safe.d.ts b/format-unicorn/format-unicorn-safe.d.ts new file mode 100644 index 000000000..adf3a62db --- /dev/null +++ b/format-unicorn/format-unicorn-safe.d.ts @@ -0,0 +1,12 @@ +// Type definitions for format-unicorn +// Project: https://github.com/tallesl/format-unicorn +// Definitions by: kruncher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'format-unicorn/safe' { + + function formatUnicornSafe(str: string, replacements: { }): string; + + export = formatUnicornSafe; + +} diff --git a/format-unicorn/format-unicorn-tests.ts b/format-unicorn/format-unicorn-tests.ts new file mode 100644 index 000000000..e256b65ae --- /dev/null +++ b/format-unicorn/format-unicorn-tests.ts @@ -0,0 +1,11 @@ +/// + +import 'format-unicorn'; + +// Unsafe version +var outputString: string; + +outputString = 'Hello, {name}; you have {favoriteNumber}'.formatUnicorn({ + name: "kruncher", + favoriteNumber: 42 +}); diff --git a/format-unicorn/format-unicorn.d.ts b/format-unicorn/format-unicorn.d.ts new file mode 100644 index 000000000..d1780140f --- /dev/null +++ b/format-unicorn/format-unicorn.d.ts @@ -0,0 +1,12 @@ +// Type definitions for format-unicorn +// Project: https://github.com/tallesl/format-unicorn +// Definitions by: kruncher +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface String { + formatUnicorn(replacements: { }): string; +} + +declare module "format-unicorn" { + +}