mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-11-29 17:51:46 +00:00
is-svg: Allow Buffer input
This commit is contained in:
Vendored
+3
-1
@@ -3,6 +3,8 @@
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = isSvg;
|
||||
|
||||
declare function isSvg(input: string): boolean;
|
||||
declare function isSvg(input: string | Buffer): boolean;
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
import isSvg = require('is-svg');
|
||||
|
||||
const result: boolean = isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>');
|
||||
const dataString = '<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>';
|
||||
const dataBuffer = Buffer.from(dataString);
|
||||
|
||||
const resultString: boolean = isSvg(dataString);
|
||||
const resultBuffer: boolean = isSvg(dataBuffer);
|
||||
|
||||
Reference in New Issue
Block a user