{"version":3,"file":"validation_error.mjs","names":[],"sources":["../../src/error/validation_error.ts"],"sourcesContent":["// Note: Do not inherit from Error. It breaks when transpiling to ES5.\n\n/**\n * How badly a style is broken.\n *\n * - `error`: the style is invalid and cannot be rendered as written.\n * - `warning`: the style renders, but almost certainly not as its author intended -- for\n *   example a filter that mixes deprecated syntax into an expression tree. Consumers should\n *   surface these (a style editor lists them; a map logs them) but must keep rendering.\n */\nexport type ValidationSeverity = 'error' | 'warning';\n\nexport class ValidationError {\n    message: string;\n    identifier: string;\n    line: number;\n    severity: ValidationSeverity;\n\n    constructor(\n        key: string,\n        value: any & {\n            __line__: number;\n        },\n        message: string,\n        identifier?: string | null,\n        severity: ValidationSeverity = 'error'\n    ) {\n        this.message = (key ? `${key}: ` : '') + message;\n        if (identifier) this.identifier = identifier;\n        this.severity = severity;\n\n        if (value !== null && value !== undefined && value.__line__) {\n            this.line = value.__line__;\n        }\n    }\n}\n"],"mappings":";AAYA,IAAa,kBAAb,MAA6B;CAMzB,YACI,KACA,OAGA,SACA,YACA,WAA+B,SACjC;EACE,KAAK,WAAW,MAAM,GAAG,IAAI,MAAM,MAAM;EACzC,IAAI,YAAY,KAAK,aAAa;EAClC,KAAK,WAAW;EAEhB,IAAI,UAAU,QAAQ,UAAU,KAAA,KAAa,MAAM,UAC/C,KAAK,OAAO,MAAM;CAE1B;AACJ"}