Optional Minification
963910
function(css) {
  css = css
    // remove comments
    .replace(/\/\*[^\0]*?\*\//g, '')
    // trim space before characters
    .replace(/\s+({|})/g, '$1')
    // trim space after characters
    .replace(/(;|,|:|{|}|^)\s+/g, '$1')
    // trim combinators
    .replace(/\s+(>|\+|~)\s+/g, '$1')
    // remove escaped newlines and spaces
    .replace(/\\\r?\n\s+/g, '')
    // remove trailing semicolons in rules
    .replace(/;(})/g, '$1');

  return css;
}
813617
function interleave(additional) {
  return function reduce(reduced, value, i) {
    if (i === 0) {
      reduced.push(value);
    } else {
      reduced.push(additional, value);
    }
    return reduced;
  }
}
849713
public function minify()
    {
        $cleaned_stack = $this->cleanStack($this->get(), 'path');
        if (!empty($cleaned_stack)) {
            foreach ($cleaned_stack as $i=>$item) {
                if (isset($item['minified']) && true===$item['minified']) {
                    unset($cleaned_stack[$i]);
                }
            }
        }
        if (!empty($cleaned_stack)) {
            $this->addMinified(
                $this->minifyStack($this->extractFromStack($cleaned_stack, 'path'))
            );
        }
        return $this;
    }
806248
function lessThan(xs, ys) {
    for (let i = 0; i < Math.min(xs.length, ys.length); i++) {
        if (xs[i] < ys[i])
            return true;
        if (xs[i] > ys[i])
            return false;
    }
    return xs.length < ys.length;
}
1107686
private static Optional<ICondition> asLessThan( JsonObject json)
    {
    return
      Optional.of( json)
      .filter( j -> j.containsKey( LESS_THAN_KEY))
      .map( j -> j.getJsonObject( LESS_THAN_KEY))
      .map( a -> new AssertLess( a.getString( PROPERTY_KEY), a.getInt( MAX_KEY)));
    }
427986
private Node tryMinimizeCondition(Node n) {
    n = performConditionSubstitutions(n);
    MinimizedCondition minCond = MinimizedCondition.fromConditionNode(n);
    return replaceNode(
        n,
        minCond.getMinimized(MinimizationStyle.PREFER_UNNEGATED));
  }
527787
function decreaseItemDepth(opts: Options, change: Change): Change {
    const { value } = change;
    const { document } = value;

    // Cannot decrease item depth of root items
    const depth = getItemDepth(opts, value);
    if (depth == 1) {
        return change;
    }

    const currentItem = getCurrentItem(opts, value);
    if (!currentItem) {
        return change;
    }

    const currentList = document.getParent(currentItem.key);
    const parentItem = document.getParent(currentList.key);
    const parentList = document.getParent(parentItem.key);
    // The items following the item will be moved to a sublist of currentItem
    const followingItems = currentList.nodes
        .skipUntil(i => i === currentItem)
        .rest();

    // True if the currentItem and the followingItems make the whole
    // currentList, and hence the currentList will be emptied
    const willEmptyCurrentList =
        currentList.nodes.size === followingItems.size + 1;

    if (!followingItems.isEmpty()) {
        // Add them as sublist of currentItem
        const sublist = Block.create({
            object: 'block',
            type: currentList.type,
            data: currentList.data
        });
        // Add the sublist
        change.insertNodeByKey(
            currentItem.key,
            currentItem.nodes.size,
            sublist,
            { normalize: false }
        );

        change.moveNodeByKey(
            currentItem.key,
            parentList.key,
            parentList.nodes.indexOf(parentItem) + 1,
            { normalize: false }
        );

        // Move the followingItems to the sublist
        followingItems.forEach((item, index) =>
            change.moveNodeByKey(
                item.key,
                sublist.key,
                sublist.nodes.size + index,
                { normalize: false }
            )
        );
    } else {
        change.moveNodeByKey(
            currentItem.key,
            parentList.key,
            parentList.nodes.indexOf(parentItem) + 1
        );
    }

    // Remove the currentList completely if needed
    if (willEmptyCurrentList) {
        change.removeNodeByKey(currentList.key);
    }

    return change;
}
962830
def minify(asset, format)
      asset = asset.to_s
      # Minify JS
      return Uglifier.compile(asset) if format.eql?("js")
      # Minify CSS
      return YUI::CssCompressor.new.compress(asset) if format.eql?("css")
      # Return string representation if not minimizing
      return asset
    end
803732
def _optional_list(value):
    ''''''
    if isinstance(value, str):
        return (value, )
    elif isinstance(value, list):
        return tuple(value)

    return None
258918
public function minimize()
    {
        foreach (get_object_vars($this) as $property => $value) {
            if ($value instanceof self) {
                $value->minimize();

            } elseif (is_array($value)) {
                $this->minimizeArray($value);
            }
        }

        return $this;
    }
1029721
function minimizeCst(cstElement) {
            // tokenType idx is auto generated, can't assert over it
            if (cstElement.tokenType) {
                delete cstElement.tokenType
            }

            // CstNode
            if (cstElement.children !== undefined) {
                cstElement.children = _.omitBy(cstElement.children, _.isEmpty)
                _.forEach(cstElement.children, childArr => {
                    _.forEach(childArr, minimizeCst)
                })
            }

            return cstElement
        }
923881
function MinifyWriter() {
        var self = this;
        MinifyWriter.superclass.constructor.apply(self, arguments);
        self.inPre = 0;
    }
812640
protected function combineMinify()
    {
        $type = $this->options['contentType']; // ease readability

        // when combining scripts, make sure all statements separated and
        // trailing single line comment is terminated
        $implodeSeparator = ($type === self::TYPE_JS) ? "\n;" : '';

        // allow the user to pass a particular array of options to each
        // minifier (designated by type). source objects may still override
        // these
        if (isset($this->options['minifierOptions'][$type])) {
            $defaultOptions = $this->options['minifierOptions'][$type];
        } else {
            $defaultOptions = array();
        }

        // if minifier not set, default is no minification. source objects
        // may still override this
        if (isset($this->options['minifiers'][$type])) {
            $defaultMinifier = $this->options['minifiers'][$type];
        } else {
            $defaultMinifier = false;
        }

        // process groups of sources with identical minifiers/options
        $content = array();
        $i = 0;
        $l = count($this->sources);
        $groupToProcessTogether = array();
        $lastMinifier = null;
        $lastOptions = null;
        do {
            // get next source
            $source = null;
            if ($i < $l) {
                $source = $this->sources[$i];
                $sourceContent = $source->getContent();

                // allow the source to override our minifier and options
                $minifier = $source->getMinifier();
                if (!$minifier) {
                    $minifier = $defaultMinifier;
                }
                $options = array_merge($defaultOptions, $source->getMinifierOptions());
            }
            // do we need to process our group right now?
            if ($i > 0                               // yes, we have at least the first group populated
                && (
                    ! $source                        // yes, we ran out of sources
                    || $type === self::TYPE_CSS      // yes, to process CSS individually (avoiding PCRE bugs/limits)
                    || $minifier !== $lastMinifier   // yes, minifier changed
                    || $options !== $lastOptions)) { // yes, options changed
                // minify previous sources with last settings
                $imploded = implode($implodeSeparator, $groupToProcessTogether);
                $groupToProcessTogether = array();
                if ($lastMinifier) {
                    try {
                        $content[] = call_user_func($lastMinifier, $imploded, $lastOptions);
                    } catch (Exception $e) {
                        throw new Exception("Exception in minifier: " . $e->getMessage());
                    }
                } else {
                    $content[] = $imploded;
                }
            }
            // add content to the group
            if ($source) {
                $groupToProcessTogether[] = $sourceContent;
                $lastMinifier = $minifier;
                $lastOptions = $options;
            }
            $i++;
        } while ($source);

        $content = implode($implodeSeparator, $content);

        if ($type === self::TYPE_CSS && false !== strpos($content, '@import')) {
            $content = $this->handleCssImports($content);
        }

        // do any post-processing (esp. for editing build URIs)
        if ($this->options['postprocessorRequire']) {
            require_once $this->options['postprocessorRequire'];
        }
        if ($this->options['postprocessor']) {
            $content = call_user_func($this->options['postprocessor'], $content, $type);
        }

        return $content;
    }
1214339
private Node tryMinimizeHook(Node n) {
    Node originalCond = n.getFirstChild();
    MinimizedCondition minCond = MinimizedCondition.fromConditionNode(originalCond);
    MeasuredNode mNode =
        minCond.getMinimized(MinimizationStyle.ALLOW_LEADING_NOT);
    if (mNode.isNot()) {
      // Swap the HOOK
      Node thenBranch = n.getSecondChild();
      replaceNode(originalCond, mNode.withoutNot());
      n.removeChild(thenBranch);
      n.addChildToBack(thenBranch);
      reportChangeToEnclosingScope(n);
    } else {
      replaceNode(originalCond, mNode);
    }
    return n;
  }
325550
def include_none?(*items)
      items = items.first if items.length == 1 && items.first.kind_of?(Array)
      (self & items).empty?
    end
1101143
function (next) {

									minify(
										outputCommonsJsFile,
										_.extend({optimize: true},uglifyOptions),
										function(err){
											if ( err ){
												return next(err);
											}
											return next();
										}
									);

								}
323350
public static <T> Optional<T> narrow(final Optional<? extends T> optional) {
        return (Optional<T>) optional;
    }