Functions ---------------------------------------------------------
965642
function Hydrate(text) {
						let rgx = /<<([A-Z]+)>>/g;
						return text.replace(rgx, ($0, $1)=>{
							let prop = $1.toLowerCase();
							return THS.hasOwnProperty(prop) ?
								THS[prop] : $0
						});
					}
772390
function setHead()
	{
		$this->head = array();
		$items = func_get_args();
		if (count($items)) foreach($items as $item) {
			if (is_string($item)) $this->head[] = array('text' => $item);
			elseif (is_array($item)) $this->head[] = $item;
		}
	}
196813
function(fn) {
            	var n = this.elements.length;
            	for (var i = 0; i < n; i++) {
            	    fn(this.elements[i], i + 1);
            	}
                }
1224648
private function SaveFunctionsToPHP()
    {
        $output_file = fopen(
            $this->definitions_path . "functions.php", 
            "w"
        );
        
        fwrite($output_file, "<?php\n\n");
        
        fwrite($output_file, "use Peg\Lib\Definitions\Element\FunctionElement;\n");
        fwrite($output_file, "use Peg\Lib\Definitions\Element\Overload;\n");
        fwrite($output_file, "use Peg\Lib\Definitions\Element\ReturnType;\n");
        fwrite($output_file, "use Peg\Lib\Definitions\Element\Parameter;\n");
        
        foreach($this->symbols->headers as $header)
        {
            if(!$header->HasFunctions())
                continue;
            
            foreach($header->namespaces as $namespace)
            {
                if(!$namespace->HasFunctions())
                    continue;
                
                foreach($namespace->functions as $function)
                {
                    $description = addslashes($function->description);
                    $namespace_name = addslashes($namespace->name);
                    
                    $output = "\n";
                    
                    $output .= '// Function ' . $function->name . "\n";
                    $output .= '$function = new FunctionElement(' . "\n";
                    $output .= '    "'.$function->name.'",' . "\n";
                    $output .= '    "'.$description.'"' . "\n";
                    $output .= ');' . "\n\n";
                    
                    foreach($function->overloads as $overload_index=>$overload)
                    {
                        $overload_description = addslashes($overload->description);
                        
                        $output .= '// Overload ' . $overload_index . "\n";
                        $output .= '$overload = new Overload(' . "\n";
                        $output .= '    "'.$overload_description.'"' . "\n";
                        $output .= ');' . "\n";
                        
                        $output .= '$overload->SetReturnType(' . "\n";
                        $output .= '    new ReturnType(' . "\n";
                        $output .= '        "'.$overload->return_type->original_type.'"' . "\n";
                        $output .= '    )' . "\n";
                        $output .= ');' . "\n";
                        
                        if($overload->HasParameters())
                        {
                            foreach($overload->parameters as $parameter)
                            {
                                $parameter_value = addslashes($parameter->default_value);
                                $parameter_description = addslashes($parameter->description);

                                $output .= '$parameter = new Parameter(' . "\n";
                                $output .= '    "'.$parameter->name.'",' . "\n";
                                $output .= '    "'.$parameter->original_type.'",' . "\n";
                                $output .= '    "'.$parameter_value.'",' . "\n";
                                $output .= '    "'.$parameter_description.'"' . "\n";
                                $output .= ');' . "\n";
                                
                                if($parameter->is_array)
                                {
                                    $output .= '$parameter->is_array = true;' . "\n";
                                }
                                
                                $output .= '$overload->AddParameter(' . "\n";
                                $output .= '    $parameter' . "\n";
                                $output .= ');' . "\n";
                            }
                        }
                        
                        $output .= '$function->AddOverload($overload);' . "\n\n";
                    }
                    
                    $output .= '$symbols->AddFunction(' . "\n";
                    $output .= '    $function,' . "\n";
                    $output .= '    "'.$header->name.'",' . "\n";
                    $output .= '    "'.$namespace_name.'"' . "\n";
                    $output .= ');' . "\n\n";
                    
                    fwrite($output_file, $output);
                }
            }
        }
        
        fclose($output_file);
    }
735465
public void addFunction(IFunction function) {
        if ((function != null) && (!functions.contains(function))) {
            functions.add(function);
            colors.add(Color.black);
        }
    }
905480
function doOnce(fn) {
    var called = false;
    return function() {
      if (called) throw new Error("Callback already called.");
      called = true;
      fn.apply(root, arguments);
    };
  }
582793
public function execute()
    {
        $min = func_get_arg(0);
        
        $result = $this->value >= $min;
        
        if (!$result) {
            $this->msg = [
                'validator.rule.numbermin',
                $min
            ];
        }
    }
1000684
public function run(): void
    {
        // dynamicly parse input params
        $args = func_get_args();
        
        if (count($args) < 1) {
            return;
        }
        
        // get event name
        $eventName = array_shift($args);
        // get event args as array if passed
        $eventArgs = @array_shift($args);

        // if event is registered
        if (isset($this->events[$eventName]) && Any::isArray($this->events[$eventName])) {
            foreach ($this->events[$eventName] as $callback) {
                // call anonymous function with args if passed
                call_user_func_array($callback, $eventArgs);
            }
        }
        
        // set to post runned actions
        $this->runned[$eventName] = $eventArgs;
    }
840186
function(obj, func, items, func2){
					each(items, function(i, item){
						when(obj, func, item, func2)
					})
				}
1088591
private static void collectFunctions_r(DebuggableScript function,
                                             ObjArray array) {
        array.add(function);
        for (int i = 0; i != function.getFunctionCount(); ++i) {
            collectFunctions_r(function.getFunction(i), array);
        }
    }
205303
function (fn) {
        return function () {
            var tokens = arguments;
            var i;

            for (i = 0; i < tokens.length; i += 1) {
                fn.call(this, tokens[i]);
            }
        };
    }
988551
function bindFunctions(functions) {
	var _this = this;

	functions.forEach(function (f) {
		return _this[f] = _this[f].bind(_this);
	});
}
427834
public static function compose(/* $function1, $function2, ... */)
    {
        $functions = func_get_args();

        if (count($functions) === 1) {
            static::validate($functions[0]);
            return $functions[0];
        }

        $firstFunction = array_shift($functions);

        static::validate($firstFunction);

        return function() use($firstFunction, $functions) {

            $partial = call_user_func_array(array('\Functionals\Functionals', 'compose'), $functions);

            return call_user_func($firstFunction, call_user_func_array($partial, func_get_args()));
        };
    }
67954
function it_can_execute_functions_for_each_item_in_a_collection()
    {
        $collection = [1, 2, 3];

        $this
            ->each($collection, function($item) {
                $this->raw($item);
            })
            ->getSource()
            ->shouldMatch('/123/')
        ;
    }
717112
function(function_name) {

		for (var i = 0; i < this._count; i++) {

			if (this._content[i].isView) {

				this._content[i][function_name]();

			}

		}

	}
1180493
function(parent) {
    if (!parent) return this;
    if (typeof parent.append === 'function') {
      parent.append(this);
    } else if (typeof parent.appendChild === 'function') {
      parent.appendChild(this._element);
      this.onAppend();
    }
    return this;
  }
195406
function functions(node) {
  if (!Node.Type.isFunction(node)) {
    return Node.Status.noChange(node);
  }

  for (let i = 0; i < FUNCTIONS.length; i++) {
    const nodeStatus = FUNCTIONS[i](node);
    if (nodeStatus.hasChanged()) {
      return nodeStatus;
    }
  }
  return Node.Status.noChange(node);
}