(inputCSS, position)
| 33 | } |
| 34 | |
| 35 | function sourceOffset(inputCSS, position) { |
| 36 | // Not all custom syntaxes support `offset` in `source.start` and `source.end` |
| 37 | if (position && typeof position.offset !== 'undefined') { |
| 38 | return position.offset |
| 39 | } |
| 40 | |
| 41 | let column = 1 |
| 42 | let line = 1 |
| 43 | let offset = 0 |
| 44 | |
| 45 | for (let i = 0; i < inputCSS.length; i++) { |
| 46 | if (line === position.line && column === position.column) { |
| 47 | offset = i |
| 48 | break |
| 49 | } |
| 50 | |
| 51 | if (inputCSS[i] === '\n') { |
| 52 | column = 1 |
| 53 | line += 1 |
| 54 | } else { |
| 55 | column += 1 |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | return offset |
| 60 | } |
| 61 | |
| 62 | class Node { |
| 63 | get proxyOf() { |
no outgoing calls
no test coverage detected
searching dependent graphs…