• File: document.js
  • Full Path: /home/awtadalkhimacom/public_html/services/node_modules/postcss/lib/document.js
  • Date Modified: 10/30/2025 4:29 AM
  • File size: 654 bytes
  • MIME-type: text/plain
  • Charset: utf-8
'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