File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1
1
export = CssPropertyParser ;
2
2
3
3
declare namespace CssPropertyParser {
4
+ class ParseError extends Error {
5
+ }
6
+ class UnsupportedPropertyError extends Error {
7
+ readonly property : string ;
8
+ constructor ( property : string ) ;
9
+ }
10
+ class UnknownPropertyError extends Error {
11
+ readonly property : string ;
12
+ constructor ( property : string ) ;
13
+ }
4
14
interface Declarations {
5
15
[ property : string ] : string ;
6
16
}
Original file line number Diff line number Diff line change 5
5
module . exports = class UnknownPropertyError extends Error {
6
6
constructor ( property ) {
7
7
super ( `Unknown property error: ${ property } is not a known property` ) ;
8
+ this . _property = property ;
8
9
Error . captureStackTrace ( this , UnknownPropertyError ) ;
9
10
}
11
+ get property ( ) {
12
+ return this . _property ;
13
+ }
10
14
} ;
Original file line number Diff line number Diff line change 6
6
module . exports = class UnsupportedPropertyError extends Error {
7
7
constructor ( property ) {
8
8
super ( `Unsupported property error: ${ property } is not a supported property` ) ;
9
+ this . _property = property ;
9
10
Error . captureStackTrace ( this , UnsupportedPropertyError ) ;
10
11
}
12
+ get property ( ) {
13
+ return this . _property ;
14
+ }
11
15
} ;
Original file line number Diff line number Diff line change @@ -3,11 +3,19 @@ const getShorthandComputedProperties = require('./getShorthandComputedProperties
3
3
const isShorthandProperty = require ( './isShorthandProperty' ) ;
4
4
const getShorthandsForProperty = require ( './getShorthandsForProperty' ) ;
5
5
const isValidDeclaration = require ( './isValidDeclaration' ) ;
6
+ const {
7
+ ParseError,
8
+ UnsupportedPropertyError,
9
+ UnknownPropertyError,
10
+ } = require ( './errors' ) ;
6
11
7
12
module . exports = {
8
13
expandShorthandProperty,
9
14
getShorthandComputedProperties,
10
15
isShorthandProperty,
11
16
isValidDeclaration,
12
17
getShorthandsForProperty,
18
+ ParseError,
19
+ UnsupportedPropertyError,
20
+ UnknownPropertyError,
13
21
} ;
You can’t perform that action at this time.
0 commit comments