/* cleans/recreates the file input
438928
function(){
        if (this._input.parentNode){
            qq.remove(this._input);    
        }                
        
        qq.removeClass(this._element, this._options.focusClass);
        this._input = this._createInput();
    }
481191
function checkOutput(input, output) {
  let reg = new RegExp('\\$1');
  if (reg.test(output)) {
    if (Array.isArray(input)) {
      const outputMin = input.map(file => {
        return utils.setFileNameMin(file, output);
      });
      return { output: outputMin };
    } else {
      return { output: utils.setFileNameMin(input, output) };
    }
  }
}
1117221
function() {

        // TODO: should really use link to GeneratedFileNode.prototype.clean() here
        var _this = this;
        return QFS.remove(this.getPath())
            .then(function() {
                LOGGER.fverbose('[-] Removed %j', _this.getId());
            })
            .fail(function() {});

    }
1133508
function cleanupUpdates() {
        Object.keys(_idsToUpdate).forEach(function (id) {
            var installResult = _idsToUpdate[id],
                keepFile = installResult.keepFile,
                filename = installResult.localPath;

            if (filename && !keepFile) {
                FileSystem.getFileForPath(filename).unlink();
            }
        });
        _idsToUpdate = {};
    }
1209005
function splitCleanup(input, text) {
                var li = input.closest('li'),
                    subTags = text ? text.replace(/ +/, ' ').split(o.dregex) : input.val().replace(/ +/, ' ').split(o.dregex),
                    oldTag = input.data('old_tag'),
                    oldTags = tagList.slice(0),
                    exceeded = false,
                    cbVal; // copy tagList

                for (var i = 0 ; i < subTags.length ; i++) {
                    var tag = $.trim(subTags[i]).slice(0, o.maxLength);
                    if (o.forceLowercase) {
                        tag = tag.toLowerCase();
                    }

                    cbVal = o.beforeTagSave(el, ed, oldTags, oldTag, tag);
                    tag = cbVal || tag;

                    if (cbVal === false || !tag) {
                        continue;
                    }

                    var tagObject = validate(tag);
                    
                    if (tagObject) {
                        var $tagEditorTag =
                            $('<div class="json-tag-editor-tag"' +
                                  (tag.length > o.maxTagLength ? ' title="' + escape(tagObject.value) + '"' : '') + '>' + escape(ellipsify(tagObject.value, o.maxTagLength)) +
                              '</div>');

                        var tagProperties = Object.keys(tagObject);
                        for (var j = 0 ; j < tagProperties.length ; j++) {
                            $tagEditorTag.get(0).dataset[tagProperties[j]] = tagObject[tagProperties[j]];
                        }

                        oldTags.push(tagObject);
                        li.before(
                            $('<li></li>')
                                .append('<div class="json-tag-editor-spacer">&nbsp;' + o.delimiter[0] + '</div>')
                                .append($tagEditorTag)
                                .append('<div class="json-tag-editor-delete"><i></i></div>')
                        );

                        if (o.maxTags && oldTags.length >= o.maxTags) {
                            exceeded = true;
                            break;
                        }
                    }
                }

                input.closest('li').remove();
                updateGlobals();
            }
1353162
function resolveAll(fileContent) {
			var matches      = [].concat(fileContent.match(regexFile)).filter(Boolean).map(extractFile);
			var pathsMatches = [].concat(fileContent.match(regexPath)).filter(Boolean).map(extractFile);

			if (matches.length === 0 && pathsMatches.length === 0) {
				return new RSVP.Promise(function(resolve) {
					resolve(fileContent)
				});
			}

			var promises      = [].concat(matches.map(resolveFile)).filter(Boolean);
			var promisesPaths = [].concat(pathsMatches.map(resolvePath)).filter(Boolean);

			return RSVP.all(promises.concat(promisesPaths)).then(function() {
				for (var i = 0, len = matches.length; i < len; i++) {
					fileContent = fileContent.replace(matches[i], replacements[i]);
				}
				return fileContent;
			});

		}
1105895
def _clean_file(self, filename):
        """"""
        if not os.path.exists(filename):
            return
        self.announce("removing '{}'".format(filename))
        if not self.dry_run:
            os.remove(filename)
587192
function cleanPath( txt ) {
		var ch;
		var j;
		if ( txt.charCodeAt( 0 ) === 34 ) {
			j = 1;
			for ( j = 1; j < txt.length; j++ ) {
				ch = txt.charCodeAt( j );
				if ( ch === 34 ) {
					txt = txt.slice( 1, j );
					break;
				}
			}
		}
		j = txt.indexOf( '/docs/types/' );
		if ( j >= 0 ) {
			txt = txt.slice( 0, j );
		} else {
			j = txt.indexOf( '/index.d' );
			if ( j >= 0 ) {
				txt = txt.slice( 0, j );
			}
		}
		return txt;
	}
1210071
function() {
        var items = _utils.getArgArray(arguments);
        if (items.length === 0) {
            throw new Error('no files specified to clean up');
        }
        items.forEach(function(item) {
            try {
                var path = (typeof item === 'string') ? item : item.path;
                _fs.unlinkSync(path);
            } catch (e) {
                // Eat the exception.
            }
        });
    }
1219907
function thorinSanitize(input, done) {
    let sanitizeRes = thorin.sanitize(this.type, input, this[options]);
    if(typeof sanitizeRes === 'object' && sanitizeRes != null && typeof sanitizeRes.then === 'function') {
      let isDone = false;
      sanitizeRes.then((result) => {
        if(isDone) return; isDone = true;
        done(null, result);
      }, (e) => {
        if(isDone) return; isDone = true;
        done(e);
      }).catch((e) => {
        if(isDone) return; isDone = true;
        done(e);
      });
      return;
    }
    // otherwise, we have a synchronous value.
    done(null, sanitizeRes);
  }
941200
public static function clean_input()
	{
		$_GET		= static::clean($_GET);
		$_POST		= static::clean($_POST);
		$_COOKIE	= static::clean($_COOKIE);
	}
1250926
function(str) {
            var root, error = null;

            i = j = current = 0;
            chunks = [];
            input = str.replace(/\r\n/g, '\n');
            if (env.filename) {
                that.env.inputs[env.filename] = input;
            }

            // Split the input into chunks.
            chunks = (function (chunks) {
                var j = 0,
                    skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g,
                    comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
                    string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g,
                    level = 0,
                    match,
                    chunk = chunks[0],
                    inParam;

                for (var i = 0, c, cc; i < input.length;) {
                    skip.lastIndex = i;
                    match = skip.exec(input);
                    if (match) {
                        if (match.index === i) {
                            i += match[0].length;
                            chunk.push(match[0]);
                        }
                    }
                    c = input.charAt(i);
                    comment.lastIndex = string.lastIndex = i;

                    match = string.exec(input)
                    if (match) {
                        if (match.index === i) {
                            i += match[0].length;
                            chunk.push(match[0]);
                            continue;
                        }
                    }

                    if (!inParam && c === '/') {
                        cc = input.charAt(i + 1);
                        if (cc === '/' || cc === '*') {
                            match = comment.exec(input);
                            if (match) {
                                if (match.index === i) {
                                    i += match[0].length;
                                    chunk.push(match[0]);
                                    continue;
                                }
                            }
                        }
                    }

                    switch (c) {
                        case '{':
                            if (!inParam) {
                                level ++;
                            }
                            else {
                                inParam = false;
                            }
                            chunk.push(c);
                            break;
                        case '}':
                            if (!inParam) {
                                level --;
                                chunk.push(c);
                                chunks[++j] = chunk = [];
                            }
                            else {
                                inParam = false;
                                chunk.push(c);
                            }
                            break;
                        case '(':
                            if (!inParam) {
                                inParam = true;
                            }
                            else {
                                inParam = false;
                            }
                            chunk.push(c);
                            break;
                        case ')':
                            if (inParam) {
                                inParam = false;
                            }
                            chunk.push(c);
                            break;
                        default:
                            chunk.push(c);
                    }

                    i++;
                }
                if (level !== 0) {
                    error = {
                        index: i - 1,
                        message: (level > 0) ? "missing closing `}`" : "missing opening `{`",
                        filename: env.filename
                    };
                }

                return chunks.map(function (c) { return c.join(''); });
            })([[]]);

            if (error) {
                util.error(env, error);
                throw new Error('N/A');
            }

            // Start with the primary rule.
            // The whole syntax tree is held under a Ruleset node,
            // with the `root` property set to true, so no `{}` are
            // output.
            root = new tree.Ruleset([], $(this.parsers.primary));
            root.root = true;

            // Get an array of Ruleset objects, flattened
            // and sorted according to specificitySort
            root.toList = (function() {
                return function(env) {
                    env.frames = env.frames || [];


                    // call populates Invalid-caused errors
                    var definitions = this.flatten([], [], env);
                    definitions.sort(specificitySort);
                    return definitions;
                };
            })();

            // Sort rules by specificity: this function expects selectors to be
            // split already.
            //
            // Written to be used as a .sort(Function);
            // argument.
            //
            // [1, 0, 0, 467] > [0, 0, 1, 520]
            var specificitySort = function(a, b) {
                var as = a.specificity;
                var bs = b.specificity;

                if (as[0] != bs[0]) return bs[0] - as[0];
                if (as[1] != bs[1]) return bs[1] - as[1];
                if (as[2] != bs[2]) return bs[2] - as[2];
                return bs[3] - as[3];
            };

            return root;
        }
111442
function clean_path(string) {
    var arr = string.split('/');
    var _arr = [];
    for (var elm of arr) {
      if (elm) {
        _arr.push(elm);
      }
    }
    return _arr.join('/');
  }
1097737
function condenseify(file, options) {
  if (/\.json$/.test(file)) return through();

  var appendNewLine = true
    , regex = /^[ \t]+$/
    , isBlank = false
    , eol ='\n';

  options = options || {};

  function transform(line, encoding, next) {
    if (!line.length) {
      isBlank = true;
      return next();
    }

    line = line.toString();
    if (!options['keep-non-empty'] && regex.test(line)) return next();

    if (isBlank) {
      isBlank = false;
      this.push(eol);
    }
    appendNewLine = false;
    this.push(line + eol);
    next();
  }

  function flush(done) {
    if (appendNewLine) this.push(eol);
    done();
  }

  return pumpify(split(), through(transform, flush));
}
996790
def regenerateToOutputFile(outFile, checkNoChanges = false)
      executeRubyComponents
      @pageObject.process
      writeRegeneratedFile(outFile, checkNoChanges, checkNoChanges)
    end
1067607
function strip(file) {
      file.fingerprint = file.fingerprint.slice(0, -3);
      delete file.source;
      delete file.sourcemap;
      delete file.shrinkwrap;
      return file;
    }
602210
function clean(values) {
  var index = -1;
  var length = values.length;
  var result = [];
  var prev = null;
  var value;

  while (++index < length) {
    value = values[index];

    if (prev && 'value' in value && value.type === prev.type) {
      prev.value += value.value;
    } else {
      result.push(value);
      prev = value;
    }
  }

  return result;
}