Comparing version 0.0.3 to 0.1.0
{ | ||
"name": "globrex", | ||
"version": "0.0.3", | ||
"description": "Glob to regex", | ||
"version": "0.1.0", | ||
"description": "Glob to regular expression with support for extended globs", | ||
"main": "src/index.js", | ||
@@ -13,3 +13,3 @@ "author": "Terkel Gjervig", | ||
"files": [ | ||
"src" | ||
"index.js" | ||
], | ||
@@ -16,0 +16,0 @@ "keywords": [ |
@@ -14,2 +14,5 @@ <div align="center"> | ||
</a> | ||
<a href="https://ci.appveyor.com/project/terkelg/globrex"> | ||
<img src="https://ci.appveyor.com/api/projects/status/ecbnb3whibj5iqcj?svg=true" alt="appveyor" /> | ||
</a> | ||
<a href="https://npmjs.org/package/globrex"> | ||
@@ -34,5 +37,5 @@ <img src="https://img.shields.io/npm/dm/globrex.svg" alt="downloads" /> | ||
- **extended globbing:** transform advance `ExtGlob` features | ||
- **simple**: no dependencies | ||
- **paths**: split paths into multiple `RegExp` segments | ||
- 💪 **extended globbing:** transform advance `ExtGlob` features | ||
- 📦 **simple**: no dependencies | ||
- 🛣️ **paths**: split paths into multiple `RegExp` segments | ||
@@ -57,3 +60,3 @@ | ||
Type: `function`<br> | ||
Returns: `{ regex, string, segments }` | ||
Returns: `Object` | ||
@@ -63,2 +66,3 @@ Transform globs intp regular expressions. | ||
#### regex | ||
@@ -73,9 +77,9 @@ | ||
#### string | ||
#### path | ||
Type: `String` | ||
This property only exists if the option `filepath` is true. | ||
Regex string representation of the glob. | ||
> **Note:** `filepath` is `false` by default | ||
#### segments | ||
#### path.segments | ||
@@ -85,3 +89,3 @@ Type: `Array` | ||
Array of `RegExp` instances seperated by `/`. | ||
This can be usable when working with paths or urls. | ||
This can be usable when working with file paths or urls. | ||
@@ -93,5 +97,11 @@ Example array could be: | ||
> **Note**: This only makes sense for POSIX paths like /foo/bar/hello.js or URLs. Not globbing on regular strings. | ||
#### path.regex | ||
Type: `RegExp` | ||
JavaScript `RegExp` instance build for testign against paths. | ||
The regex have different path seperators depending on host OS. | ||
### glob | ||
@@ -113,3 +123,3 @@ | ||
> **Note**: Interprets `[a-d]` as `[abcd]`. To match a literal `-`, include it as first or last character. | ||
> **Note**: Interprets `[a-d]` as `[abcd]`. To match a literal `-`, include it as first or last character. | ||
@@ -147,10 +157,22 @@ | ||
### options.windows | ||
### options.filepath | ||
Type: `Boolean`<br> | ||
Default: `System OS` | ||
Default: `false` | ||
Split segment as a windows path, otherwise splut as unix. Defaults to the OS running the package. | ||
Parse input strings as it was a file path for special path related features. This feature only makes sense if the input is a POSIX path like `/foo/bar/hello.js` or URLs. | ||
When `true` the returned object will have an additional `path` object. | ||
- `segment`: Array containing a `RegExp` object for each path segment. | ||
- `regex`: OS specific file path `RegExp`. Path seperator used is based on the operating system. | ||
- `globstar`: Regex string used to test for globstars. | ||
> **Note: Please only use forward-slashes in file path glob expressions** | ||
> Though windows uses either `/` or `\` as its path separator, only `/` | ||
> characters are used by this glob implementation. You must use | ||
> forward-slashes **only** in glob expressions. Back-slashes will always | ||
> be interpreted as escape characters, not path separators. | ||
## References | ||
@@ -157,0 +179,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
244
179
14113
4
1