Skip to content

Commit 93e0b98

Browse files
author
David Chase
committed
add rollup config + uglify + buble
1 parent 3ddd3dd commit 93e0b98

File tree

4 files changed

+63
-63
lines changed

4 files changed

+63
-63
lines changed

dist/composable-normalize.js

Lines changed: 45 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,45 @@
1-
(function(global, factory) {
2-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3-
typeof define === 'function' && define.amd ? define('composableNormalize', factory) :
4-
(global.composableNormalize = factory());
5-
}(this, function() {
6-
'use strict';
7-
8-
// decode :: String -> String
9-
var decode = decodeURIComponent;
10-
11-
// _compose :: (b -> c) -> (a -> b) -> (a -> c)
12-
var _compose = function(f, g) {
13-
return function() {
14-
var args = [],
15-
len = arguments.length;
16-
while (len--) args[len] = arguments[len];
17-
18-
return f(g.apply(void 0, args));;
19-
}
20-
};
21-
22-
// compose :: [(d -> e) -> (c -> d) -> (b -> c) -> (a -> b)] -> (a -> e)
23-
var compose = function(fns) {
24-
return fns.reduce(_compose);
25-
};
26-
27-
// replace :: Regex -> String -> String -> String
28-
var replace = function(pattern, substr) {
29-
return function(str) {
30-
return str.replace(pattern, substr);
31-
};
32-
};
33-
34-
// toLower :: String -> String
35-
var toLower = function(str) {
36-
return str.toLowerCase();
37-
};
38-
39-
// append :: String -> String -> String
40-
var append = function(a) {
41-
return function(b) {
42-
return b.concat(a);
43-
};
44-
};
45-
46-
var dedupeSlashes = /([^:]\/)\/+/g;
47-
var dedupeDots = /\/\.+/g;
48-
var defaultPorts = /(\:80|\:443)/;
49-
50-
var main = compose([
51-
replace(dedupeSlashes, '$1'),
52-
replace(dedupeDots, '/'),
53-
replace(defaultPorts, ''),
54-
toLower,
55-
append('/'),
56-
decode
57-
]);
58-
59-
return main;
60-
61-
}));
1+
(function (global, factory) {
2+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3+
typeof define === 'function' && define.amd ? define(factory) :
4+
(global.pullDomEvents = factory());
5+
}(this, function () { 'use strict';
6+
7+
// decode :: String -> String
8+
var decode = decodeURIComponent;
9+
10+
// _compose :: (b -> c) -> (a -> b) -> (a -> c)
11+
var _compose = function (f, g) { return function () {
12+
var args = [], len = arguments.length;
13+
while ( len-- ) args[ len ] = arguments[ len ];
14+
15+
return f(g.apply(void 0, args));
16+
; } };
17+
18+
// compose :: (a -> c) -> [(a -> a)] -> (a -> c)
19+
var compose = function (fns) { return fns.reduce(_compose); };
20+
21+
// replace :: Regex -> String -> String -> String
22+
var replace = function (pattern, substr) { return function (str) { return str.replace(pattern, substr); }; };
23+
24+
// toLower :: String -> String
25+
var toLower = function (str) { return str.toLowerCase(); };
26+
27+
// append :: String -> String -> String
28+
var append = function (a) { return function (b) { return b.concat(a); }; };
29+
30+
var dedupeSlashes = /([^:]\/)\/+/g;
31+
var dedupeDots = /\/\.+/g;
32+
var defaultPorts = /(\:80|\:443)/;
33+
34+
var index = compose([
35+
replace(dedupeSlashes, '$1'),
36+
replace(dedupeDots, '/'),
37+
replace(defaultPorts, ''),
38+
toLower,
39+
append('/'),
40+
decode
41+
]);
42+
43+
return index;
44+
45+
}));

dist/composable-normalize.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
"url": "git+https://github.com/davidchase/composable-normalize.git"
2121
},
2222
"scripts": {
23-
"test": "n/a"
23+
"test": "n/a",
24+
"build": "rollup -c -f umd -o dist/composable-normalize.js && uglifyjs dist/composable-normalize.js -o dist/composable-normalize.min.js"
25+
},
26+
"devDependencies": {
27+
"rollup": "0.33.0",
28+
"rollup-plugin-buble": "0.12.1",
29+
"uglifyjs": "2.4.10"
2430
}
2531
}

rollup.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const buble = require('rollup-plugin-buble');
2+
3+
4+
module.exports = {
5+
entry: './index.js',
6+
moduleName: 'pullDomEvents',
7+
plugins: [
8+
buble()
9+
]
10+
};

0 commit comments

Comments
 (0)