Afanasev_Stepan_PIbd-21_IP/ИП 3 лаба/node_modules/postcss/lib/document.js
[USERNAME] 0dd26716dc Lab2-5
2024-01-10 16:11:49 +04:00

34 lines
654 B
JavaScript

'use strict'
let Container = require('./container')
let LazyResult, Processor
class Document extends Container {
constructor(defaults) {
// type needs to be passed to super, otherwise child roots won't be normalized correctly
super({ type: 'document', ...defaults })
if (!this.nodes) {
this.nodes = []
}
}
toResult(opts = {}) {
let lazy = new LazyResult(new Processor(), this, opts)
return lazy.stringify()
}
}
Document.registerLazyResult = dependant => {
LazyResult = dependant
}
Document.registerProcessor = dependant => {
Processor = dependant
}
module.exports = Document
Document.default = Document