Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1# minimatch2 3A minimal matching utility.4 5[](http://travis-ci.org/isaacs/minimatch)6 7 8This is the matching library used internally by npm.9 10It works by converting glob expressions into JavaScript `RegExp`11objects.12 13## Important Security Consideration!14 15> [!WARNING] 16> This library uses JavaScript regular expressions. Please read17> the following warning carefully, and be thoughtful about what18> you provide to this library in production systems.19 20_Any_ library in JavaScript that deals with matching string21patterns using regular expressions will be subject to22[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)23if the pattern is generated using untrusted input.24 25Efforts have been made to mitigate risk as much as is feasible in26such a library, providing maximum recursion depths and so forth,27but these measures can only ultimately protect against accidents,28not malice. A dedicated attacker can _always_ find patterns that29cannot be defended against by a bash-compatible glob pattern30matching system that uses JavaScript regular expressions.31 32To be extremely clear:33 34> [!WARNING] 35> **If you create a system where you take user input, and use36> that input as the source of a Regular Expression pattern, in37> this or any extant glob matcher in JavaScript, you will be38> pwned.**39 40A future version of this library _may_ use a different matching41algorithm which does not exhibit backtracking problems. If and42when that happens, it will likely be a sweeping change, and those43improvements will **not** be backported to legacy versions.44 45In the near term, it is not reasonable to continue to play46whack-a-mole with security advisories, and so any future ReDoS47reports will be considered "working as intended", and resolved48entirely by this warning.49 50## Usage51 52```javascript53var minimatch = require("minimatch")54 55minimatch("bar.foo", "*.foo") // true!56minimatch("bar.foo", "*.bar") // false!57minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy!58```59 60## Features61 62Supports these glob features:63 64* Brace Expansion65* Extended glob matching66* "Globstar" `**` matching67 68See:69 70* `man sh`71* `man bash`72* `man 3 fnmatch`73* `man 5 gitignore`74 75## Windows76 77**Please only use forward-slashes in glob expressions.**78 79Though windows uses either `/` or `\` as its path separator, only `/`80characters are used by this glob implementation. You must use81forward-slashes **only** in glob expressions. Back-slashes in patterns82will always be interpreted as escape characters, not path separators.83 84Note that `\` or `/` _will_ be interpreted as path separators in paths on85Windows, and will match against `/` in glob expressions.86 87So just always use `/` in patterns.88 89## Minimatch Class90 91Create a minimatch object by instantiating the `minimatch.Minimatch` class.92 93```javascript94var Minimatch = require("minimatch").Minimatch95var mm = new Minimatch(pattern, options)96```97 98### Properties99 100* `pattern` The original pattern the minimatch object represents.101* `options` The options supplied to the constructor.102* `set` A 2-dimensional array of regexp or string expressions.103 Each row in the104 array corresponds to a brace-expanded pattern. Each item in the row105 corresponds to a single path-part. For example, the pattern106 `{a,b/c}/d` would expand to a set of patterns like:107 108 [ [ a, d ]109 , [ b, c, d ] ]110 111 If a portion of the pattern doesn't have any "magic" in it112 (that is, it's something like `"foo"` rather than `fo*o?`), then it113 will be left as a string rather than converted to a regular114 expression.115 116* `regexp` Created by the `makeRe` method. A single regular expression117 expressing the entire pattern. This is useful in cases where you wish118 to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.119* `negate` True if the pattern is negated.120* `comment` True if the pattern is a comment.121* `empty` True if the pattern is `""`.122 123### Methods124 125* `makeRe` Generate the `regexp` member if necessary, and return it.126 Will return `false` if the pattern is invalid.127* `match(fname)` Return true if the filename matches the pattern, or128 false otherwise.129* `matchOne(fileArray, patternArray, partial)` Take a `/`-split130 filename, and match it against a single row in the `regExpSet`. This131 method is mainly for internal use, but is exposed so that it can be132 used by a glob-walker that needs to avoid excessive filesystem calls.133 134All other methods are internal, and will be called as necessary.135 136### minimatch(path, pattern, options)137 138Main export. Tests a path against the pattern using the options.139 140```javascript141var isJS = minimatch(file, "*.js", { matchBase: true })142```143 144### minimatch.filter(pattern, options)145 146Returns a function that tests its147supplied argument, suitable for use with `Array.filter`. Example:148 149```javascript150var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true}))151```152 153### minimatch.match(list, pattern, options)154 155Match against the list of156files, in the style of fnmatch or glob. If nothing is matched, and157options.nonull is set, then return a list containing the pattern itself.158 159```javascript160var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})161```162 163### minimatch.makeRe(pattern, options)164 165Make a regular expression object from the pattern.166 167## Options168 169All options are `false` by default.170 171### debug172 173Dump a ton of stuff to stderr.174 175### nobrace176 177Do not expand `{a,b}` and `{1..3}` brace sets.178 179### noglobstar180 181Disable `**` matching against multiple folder names.182 183### dot184 185Allow patterns to match filenames starting with a period, even if186the pattern does not explicitly have a period in that spot.187 188Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`189is set.190 191### noext192 193Disable "extglob" style patterns like `+(a|b)`.194 195### nocase196 197Perform a case-insensitive match.198 199### nonull200 201When a match is not found by `minimatch.match`, return a list containing202the pattern itself if this option is set. When not set, an empty list203is returned if there are no matches.204 205### matchBase206 207If set, then patterns without slashes will be matched208against the basename of the path if it contains slashes. For example,209`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.210 211### nocomment212 213Suppress the behavior of treating `#` at the start of a pattern as a214comment.215 216### nonegate217 218Suppress the behavior of treating a leading `!` character as negation.219 220### flipNegate221 222Returns from negate expressions the same as if they were not negated.223(Ie, true on a hit, false on a miss.)224 225### partial226 227Compare a partial path to a pattern. As long as the parts of the path that228are present are not contradicted by the pattern, it will be treated as a229match. This is useful in applications where you're walking through a230folder structure, and don't yet have the full path, but want to ensure that231you do not walk down paths that can never be a match.232 233For example,234 235```js236minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d237minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d238minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a239```240 241### windowsPathsNoEscape242 243Use `\\` as a path separator _only_, and _never_ as an escape244character. If set, all `\\` characters are replaced with `/` in245the pattern. Note that this makes it **impossible** to match246against paths containing literal glob pattern characters, but247allows matching with patterns constructed using `path.join()` and248`path.resolve()` on Windows platforms, mimicking the (buggy!)249behavior of earlier versions on Windows. Please use with250caution, and be mindful of [the caveat about Windows251paths](#windows).252 253For legacy reasons, this is also set if254`options.allowWindowsEscape` is set to the exact value `false`.255 256## Comparisons to other fnmatch/glob implementations257 258While strict compliance with the existing standards is a worthwhile259goal, some discrepancies exist between minimatch and other260implementations, and are intentional.261 262If the pattern starts with a `!` character, then it is negated. Set the263`nonegate` flag to suppress this behavior, and treat leading `!`264characters normally. This is perhaps relevant if you wish to start the265pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`266characters at the start of a pattern will negate the pattern multiple267times.268 269If a pattern starts with `#`, then it is treated as a comment, and270will not match anything. Use `\#` to match a literal `#` at the271start of a line, or set the `nocomment` flag to suppress this behavior.272 273The double-star character `**` is supported by default, unless the274`noglobstar` flag is set. This is supported in the manner of bsdglob275and bash 4.1, where `**` only has special significance if it is the only276thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but277`a/**b` will not.278 279If an escaped pattern has no matches, and the `nonull` flag is set,280then minimatch.match returns the pattern as-provided, rather than281interpreting the character escapes. For example,282`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than283`"*a?"`. This is akin to setting the `nullglob` option in bash, except284that it does not resolve escaped pattern characters.285 286If brace expansion is not disabled, then it is performed before any287other interpretation of the glob pattern. Thus, a pattern like288`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded289**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are290checked for validity. Since those two are valid, matching proceeds.291 292Note that `fnmatch(3)` in libc is an extremely naive string comparison293matcher, which does not do anything special for slashes. This library is294designed to be used in glob searching and file walkers, and so it does do295special things with `/`. Thus, `foo*` will not match `foo/bar` in this296library, even though it would in `fnmatch(3)`.297 