-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor TypeScript definition to CommonJS compatible export (#21)
- Loading branch information
1 parent
f6f5578
commit 96ab233
Showing
4 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,26 @@ | ||
/// <reference types="node"/> | ||
|
||
/** | ||
* Check if a string or buffer is [SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics). | ||
* | ||
* @param input - The data to check. | ||
* @returns Whether `input` is SVG or not. | ||
*/ | ||
export default function isSvg(input: string | Buffer): boolean; | ||
declare const isSvg: { | ||
/** | ||
Check if a string or buffer is [SVG](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics). | ||
@param input - The data to check. | ||
@returns Whether `input` is SVG or not. | ||
@example | ||
``` | ||
import isSvg = require('is-svg'); | ||
isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>'); | ||
//=> true | ||
``` | ||
*/ | ||
(input: string | Buffer): boolean; | ||
|
||
// TODO: Remove this for the next major release, refactor the whole definition to: | ||
// declare function isSvg(input: string | Buffer): boolean; | ||
// export = isSvg; | ||
default: typeof isSvg; | ||
}; | ||
|
||
export = isSvg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters