<commit_before>'use strict'

let postcss      = require('postcss')
let autoprefixer = require('autoprefixer')
let cssnano      = require('cssnano')

/*
 * Add vendor prefixes and minify CSS.
 * @public
 * @param {string} folderPath - Path to the folder containing the SASS file.
 * @param {string} str - CSS.
 * @param {Object} opts - Options for the task.
 * @param {function} next - The callback that handles the response. Receives the following properties: err, css.
 */
module.exports = function(folderPath, str, opts, next) {

	// Dismiss sourceMap when output should be optimized
	let map = (opts.optimize===true ? false : true)

	postcss([

		autoprefixer,
		cssnano

	]).process(str, {

		from : folderPath,
		to   : folderPath,
		map  : map

	}).then((result) => {

		next(null, result.css)

	}).catch((err) => {

		next(err, null)

	})<commit_msg>Renamed var + Embed source map when no options passed to postcss module<commit_after>'use strict'

let postcss      = require('postcss')
let autoprefixer = require('autoprefixer')
let cssnano      = require('cssnano')

/*
 * Add vendor prefixes and minify CSS.
 * @public
 * @param {string} folderPath - Path to the folder containing the SASS file.
 * @param {string} str - CSS.
 * @param {Object} opts - Options for the task.
 * @param {function} next - The callback that handles the response. Receives the following properties: err, css.
 */
module.exports = function(folderPath, str, opts, next) {

	// Dismiss sourceMap when output should be optimized
	let sourceMap = (opts!=null && opts.optimize===true ? false : true)

	postcss([

		autoprefixer,
		cssnano

	]).process(str, {

		from : folderPath,
		to   : folderPath,
		map  : sourceMap

	}).then((result) => {

		next(null, result.css)

	}).catch((err) => {

		next(err, null)

	})
{'fraction_non_alphanumeric': 0.13070077864293658, 'fraction_numerical': 0.0, 'mean_word_length': 3.5544303797468353, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1821860', 'n_tokens_mistral': 605, 'n_tokens_neox': 571, 'n_words': 188}