mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #33135 from jantimon/fix/parseUnit
Allow to pass numbers to parse-unit
This commit is contained in:
Vendored
+1
-1
@@ -3,5 +3,5 @@
|
||||
// Definitions by: Jack Works <https://github.com/Jack-Works>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function parse(value: string): [number, string];
|
||||
declare function parse(value: string | number): [number, string];
|
||||
export = parse;
|
||||
|
||||
@@ -2,3 +2,7 @@ import parse = require('parse-unit');
|
||||
const [number, length] = parse('10px');
|
||||
number === 50;
|
||||
length === 'px';
|
||||
|
||||
parse(10).length === 2;
|
||||
parse(10)[0] === 10;
|
||||
parse(10)[1] === '';
|
||||
|
||||
Reference in New Issue
Block a user