build-elm-assets
Advanced tools
Comparing version 1.2.0 to 1.2.1
17
index.js
@@ -30,3 +30,13 @@ const dive = require("dive"); | ||
}, | ||
() => checkForDuplications(assets, callback) | ||
() => { | ||
var sortedAssets = | ||
assets.sort(function(a, b) { | ||
if (a.elmName < b.elmName) | ||
return -1; | ||
if (a.elmName > b.elmName) | ||
return 1; | ||
return 0; | ||
}); | ||
checkForDuplications(sortedAssets, callback) | ||
} | ||
); | ||
@@ -160,4 +170,5 @@ } catch (e) { | ||
validateConfig(config); | ||
collectAssets(config, (err, assets) => | ||
writeElmFile(config, assets, callback)); | ||
collectAssets(config, (err, assets) => { | ||
writeElmFile(config, assets, callback); | ||
}); | ||
}, | ||
@@ -164,0 +175,0 @@ collectAssets, |
{ | ||
"name": "build-elm-assets", | ||
"version": "1.2.0", | ||
"description": "builds a elm file containing all paths of a assets directory", | ||
"version": "1.2.1", | ||
"description": "Builds an Elm file containing all paths of assets in a directory", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
Build Elm Assets | ||
================ | ||
[![Build Status](https://travis-ci.org/NoRedInk/build-elm-assets.svg?branch=master)](https://travis-ci.org/NoRedInk/build-elm-assets) | ||
> Generates a file containing assets from a given folder and containing a hash in the urls. | ||
@@ -5,0 +7,0 @@ |
10
test.js
@@ -39,3 +39,3 @@ import test from "ava"; | ||
test("collectAssets", t => { | ||
test("collectAssets should invoke the callback with sorted assets", t => { | ||
const { collectAssets } = mockModule(["foo.png", "bar.png"]); | ||
@@ -49,8 +49,8 @@ const config = { | ||
{ | ||
elmName: "bar_png", | ||
urlWithHash: "bar-HASH.png" | ||
}, | ||
{ | ||
elmName: "foo_png", | ||
urlWithHash: "foo-HASH.png" | ||
}, | ||
{ | ||
elmName: "bar_png", | ||
urlWithHash: "bar-HASH.png" | ||
} | ||
@@ -57,0 +57,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
12514
7
303
37