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 11export = CssPropertyParser ;
22
33declare 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+ }
414 interface Declarations {
515 [ property : string ] : string ;
616 }
Original file line number Diff line number Diff line change 55module . exports = class UnknownPropertyError extends Error {
66 constructor ( property ) {
77 super ( `Unknown property error: ${ property } is not a known property` ) ;
8+ this . _property = property ;
89 Error . captureStackTrace ( this , UnknownPropertyError ) ;
910 }
11+ get property ( ) {
12+ return this . _property ;
13+ }
1014} ;
Original file line number Diff line number Diff line change 66module . exports = class UnsupportedPropertyError extends Error {
77 constructor ( property ) {
88 super ( `Unsupported property error: ${ property } is not a supported property` ) ;
9+ this . _property = property ;
910 Error . captureStackTrace ( this , UnsupportedPropertyError ) ;
1011 }
12+ get property ( ) {
13+ return this . _property ;
14+ }
1115} ;
Original file line number Diff line number Diff line change @@ -3,11 +3,19 @@ const getShorthandComputedProperties = require('./getShorthandComputedProperties
33const isShorthandProperty = require ( './isShorthandProperty' ) ;
44const getShorthandsForProperty = require ( './getShorthandsForProperty' ) ;
55const isValidDeclaration = require ( './isValidDeclaration' ) ;
6+ const {
7+ ParseError,
8+ UnsupportedPropertyError,
9+ UnknownPropertyError,
10+ } = require ( './errors' ) ;
611
712module . exports = {
813 expandShorthandProperty,
914 getShorthandComputedProperties,
1015 isShorthandProperty,
1116 isValidDeclaration,
1217 getShorthandsForProperty,
18+ ParseError,
19+ UnsupportedPropertyError,
20+ UnknownPropertyError,
1321} ;
You can’t perform that action at this time.
0 commit comments