asset-resolver
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -29,5 +29,3 @@ /** | ||
return resolver.getResource(base, file, opts); | ||
})).then(function (resource) { | ||
return resource; | ||
}).catch(Promise.AggregateError, function (errs) { | ||
})).catch(Promise.AggregateError, function (errs) { | ||
var msg = ['The file "' + file + '" could not be resolved because of:'].concat(pluck(errs, 'message')); | ||
@@ -34,0 +32,0 @@ debug(msg); |
@@ -30,2 +30,3 @@ /** | ||
} | ||
debug('Passed filter:', resource.path); | ||
return resource; | ||
@@ -44,3 +45,3 @@ }); | ||
followRedirect: true, | ||
encoding: 'binary' | ||
encoding: null | ||
}; | ||
@@ -81,6 +82,7 @@ return new Promise(function (resolve, reject) { | ||
var mimeType = mime.lookup(resource); | ||
debug('Fetched:', resource); | ||
return Promise.resolve({ | ||
contents: body.toString(), | ||
contents: body, | ||
path: resource, | ||
@@ -87,0 +89,0 @@ mime: mimeType |
{ | ||
"name": "asset-resolver", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Find an asset in a set of locations", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -53,3 +53,4 @@ # asset-resolver [![Build Status](https://travis-ci.org/bezoerb/asset-resolver.svg?branch=master)](https://travis-ci.org/bezoerb/asset-resolver) | ||
Required: `false` | ||
Example: ```javascript | ||
Example: | ||
```javascript | ||
resolver.getResource('my.svg',{ | ||
@@ -56,0 +57,0 @@ base: ['some/directory','http://some.domain/assets'], |
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
95
8229
160