Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arc-resolver

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arc-resolver - npm Package Compare versions

Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1

LICENSE

12

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc