main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
906 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | /*
|
---|
| 2 | MIT License http://www.opensource.org/licenses/mit-license.php
|
---|
| 3 | Author Tobias Koppers @sokra
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | "use strict";
|
---|
| 7 |
|
---|
| 8 | const streamChunksOfRawSource = require("./streamChunksOfRawSource");
|
---|
| 9 | const streamChunksOfSourceMap = require("./streamChunksOfSourceMap");
|
---|
| 10 |
|
---|
| 11 | module.exports = (source, options, onChunk, onSource, onName) => {
|
---|
| 12 | if (typeof source.streamChunks === "function") {
|
---|
| 13 | return source.streamChunks(options, onChunk, onSource, onName);
|
---|
| 14 | } else {
|
---|
| 15 | const sourceAndMap = source.sourceAndMap(options);
|
---|
| 16 | if (sourceAndMap.map) {
|
---|
| 17 | return streamChunksOfSourceMap(
|
---|
| 18 | sourceAndMap.source,
|
---|
| 19 | sourceAndMap.map,
|
---|
| 20 | onChunk,
|
---|
| 21 | onSource,
|
---|
| 22 | onName,
|
---|
| 23 | !!(options && options.finalSource),
|
---|
| 24 | !!(options && options.columns !== false)
|
---|
| 25 | );
|
---|
| 26 | } else {
|
---|
| 27 | return streamChunksOfRawSource(
|
---|
| 28 | sourceAndMap.source,
|
---|
| 29 | onChunk,
|
---|
| 30 | onSource,
|
---|
| 31 | onName,
|
---|
| 32 | !!(options && options.finalSource)
|
---|
| 33 | );
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
| 36 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.