arc-resolver
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
{ | ||
"name": "arc-resolver", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "", | ||
@@ -12,12 +12,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"arc-flag-parser": "^2.0.0-alpha.0", | ||
"arc-flag-parser": "^2.0.0-alpha.1", | ||
"cachedfs": "^0.3.3" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"memory-fs": "^0.4.1", | ||
"mocha": "^3.2.0", | ||
"nyc": "^11.3.0" | ||
}, | ||
"gitHead": "4772d05c45bc1bfbc988b7ac97a96295b452c650" | ||
"gitHead": "c56b19445f205dfab10ff786fba176b70f080f98" | ||
} |
@@ -1,3 +0,64 @@ | ||
## Setting flags | ||
# arc-resolver | ||
<a href="https://www.ebay.com"> | ||
<img src="https://img.shields.io/badge/ebay-open%20source-01d5c2.svg" alt="ebay open source"/> | ||
</a> | ||
<a href="https://img.shields.io/github/license/eBay/arc.svg"> | ||
<img src="https://img.shields.io/github/license/eBay/arc.svg" alt="MIT licensed"/> | ||
</a> | ||
<a href="https://travis-ci.org/eBay/arc"> | ||
<img src="https://travis-ci.org/eBay/arc.svg?branch=master" alt="travisci build"/> | ||
</a> | ||
<a href="https://codecov.io/gh/eBay/arc/list/master/packages/arc-resolver"> | ||
<img src="https://codecov.io/gh/eBay/arc/branch/master/graph/badge.svg" alt="Codecov" /> | ||
</a> | ||
<a href="https://www.npmjs.com/package/arc-resolver"> | ||
<img src="https://img.shields.io/npm/v/arc-resolver/next.svg" alt="npm version"/> | ||
</a> | ||
<a href="http://npm-stat.com/charts.html?package=arc-resolver"> | ||
<img src="https://img.shields.io/npm/dm/arc-resolver.svg" alt="downloads"/> | ||
</a> | ||
## API | ||
### `new Resolver(fs)` | ||
```js | ||
import Resolver from 'arc-resolver'; | ||
``` | ||
- **`fs`** (_optional_): a filesystem that conforms to the node.js `fs` api. Defaults to the built-in `fs` module | ||
#### Instance methods | ||
- **`clearCache()`** | ||
- **`getMatchesSync(path)`** | ||
- **`getDirMatchesSync(dir, request)`** | ||
- **`resolveSync(path, flags)`** | ||
- **`isAdaptiveSync(path)`** | ||
### <a name="matchset"></a> `new MatchSet(matches)` an [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) | ||
```js | ||
import { MatchSet} from 'arc-resolver'; | ||
``` | ||
- **`matches`** (_required_): an `Array` of `Object`s with the keys `flags` and `value`: | ||
- `flags`: an `Array` of strings representing the required flags for the `value` | ||
- `value`: any value to associate with the `flags` | ||
#### Properties | ||
- **`count`**: the number of possible matches | ||
- **`default`**: the default value (the least specific, the one with no flags) | ||
#### Methods | ||
- **`match(flags)`**: return the matching `value` for a flagset | ||
- `flags`: an `Object` where each key represents a flag and the value is a boolean indicating whether that flag is active | ||
- **`map(fn)`**: return a new `MatchSet` with the mapped values | ||
- `fn`: a `Function` that is passed `value`, `flags` and `index`, returns a new `value` | ||
## Defining flags | ||
`arc` adapts files based on a filenaming convension: | ||
@@ -4,0 +65,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
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
10315
0
4
169
0