MCPcopy
hub / github.com/postcss/postcss / constructor

Method constructor

lib/warning.js:4–17  ·  view source on GitHub ↗
(text, opts = {})

Source from the content-addressed store, hash-verified

2
3class Warning {
4 constructor(text, opts = {}) {
5 this.type = 'warning'
6 this.text = text
7
8 if (opts.node && opts.node.source) {
9 let range = opts.node.rangeBy(opts)
10 this.line = range.start.line
11 this.column = range.start.column
12 this.endLine = range.end.line
13 this.endColumn = range.end.column
14 }
15
16 for (let opt in opts) this[opt] = opts[opt]
17 }
18
19 toString() {
20 if (this.node) {

Callers

nothing calls this directly

Calls 1

rangeByMethod · 0.80

Tested by

no test coverage detected