New package: parse-unit

Signed-off-by: Jack Works <zjwpeter@gmail.com>
This commit is contained in:
Jack Works
2017-02-20 12:46:38 +08:00
parent 56dbab7087
commit 81b60b07a3
4 changed files with 35 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
// Type definitions for parse-unit 1.0
// Project: https://github.com/mattdesl/parse-unit
// Definitions by: Jack Works <https://github.com/Jack-Works>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function parse(value: string): [number, string];
export = parse;
+4
View File
@@ -0,0 +1,4 @@
import parse = require('parse-unit')
let [number, length] = parse('10px')
number === 50
length === 'px'
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"parse-unit-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }