* Clone and insert new declaration
(decl, prefix, prefixes)
| 43 | * Clone and insert new declaration |
| 44 | */ |
| 45 | insert(decl, prefix, prefixes) { |
| 46 | let cloned = this.set(this.clone(decl), prefix) |
| 47 | if (!cloned) return undefined |
| 48 | |
| 49 | let already = decl.parent.some( |
| 50 | i => i.prop === cloned.prop && i.value === cloned.value |
| 51 | ) |
| 52 | if (already) { |
| 53 | return undefined |
| 54 | } |
| 55 | |
| 56 | if (this.needCascade(decl)) { |
| 57 | cloned.raws.before = this.calcBefore(prefixes, decl, prefix) |
| 58 | } |
| 59 | return decl.parent.insertBefore(decl, cloned) |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Did this declaration has this prefix above |
no test coverage detected