mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Vendored
+8
-3
@@ -1,8 +1,13 @@
|
||||
// Type definitions for is-svg 2.1
|
||||
// Type definitions for is-svg 3.0
|
||||
// Project: https://github.com/sindresorhus/is-svg#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = isSvg;
|
||||
/// <reference types="node" />
|
||||
|
||||
declare function isSvg(input: string): boolean;
|
||||
declare function isSvg(input?: string | Buffer | false | null): boolean;
|
||||
|
||||
// So that `import * as X` is possible
|
||||
declare namespace isSvg {}
|
||||
|
||||
export = isSvg;
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
import isSvg = require('is-svg');
|
||||
import * as isSvg from 'is-svg';
|
||||
|
||||
const result: boolean = isSvg('<svg xmlns="http://www.w3.org/2000/svg"><path fill="#00CD9F"/></svg>');
|
||||
const data = '<svg></svg>';
|
||||
let result = false;
|
||||
|
||||
result = isSvg(data);
|
||||
result = isSvg(Buffer.from(data));
|
||||
result = isSvg(false);
|
||||
result = isSvg(null);
|
||||
result = isSvg(undefined);
|
||||
result = isSvg();
|
||||
|
||||
Reference in New Issue
Block a user