matchheight 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ declare const MatchHeight: {
2
+ init(): void;
3
+ update(): void;
4
+ };
5
+ export default MatchHeight;
@@ -7,116 +7,91 @@
7
7
  (function (global, factory) {
8
8
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
9
9
  typeof define === 'function' && define.amd ? define(factory) :
10
- (global.MatchHeight = factory());
11
- }(this, (function () { 'use strict';
12
-
13
- function throttle(fn, threshhold) {
14
-
15
- var last = void 0,
16
- deferTimer = void 0;
17
-
18
- return function () {
19
-
20
- var now = Date.now();
21
-
22
- if (last && now < last + threshhold) {
23
-
24
- clearTimeout(deferTimer);
25
- deferTimer = setTimeout(function () {
26
-
27
- last = now;
28
- fn();
29
- }, threshhold);
30
- } else {
31
-
32
- last = now;
33
- fn();
34
- }
35
- };
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MatchHeight = factory());
11
+ })(this, (function () { 'use strict';
12
+
13
+ function throttle(fn, threshold) {
14
+ var last, deferTimer;
15
+ return function () {
16
+ var now = Date.now();
17
+ if (last && now < last + threshold) {
18
+ clearTimeout(deferTimer);
19
+ deferTimer = setTimeout(function () {
20
+ last = now;
21
+ fn();
22
+ }, threshold);
23
+ }
24
+ else {
25
+ last = now;
26
+ fn();
27
+ }
28
+ };
36
29
  }
37
30
 
31
+ var errorThreshold = 1;
38
32
  var initialized = false;
39
- var elements = void 0;
40
- var remains = void 0;
41
-
42
- var MatchHeight$1 = {
43
- init: function init() {
44
-
45
- initialized = true;
46
- elements = document.querySelectorAll('[data-mh]');
47
- this.update();
48
- },
49
- update: function update() {
50
-
51
- if (!initialized) {
52
-
53
- this.init();
54
- return;
55
- }
56
-
57
- if (elements.length === 0) return;
58
-
59
- remains = Array.prototype.map.call(elements, function (el) {
60
-
61
- return { el: el };
62
- });
63
- // remove all height before
64
- remains.forEach(function (item) {
65
-
66
- item.el.style.minHeight = '';
67
- });
68
- process();
69
- }
33
+ var elements;
34
+ var remains;
35
+ var MatchHeight = {
36
+ init: function () {
37
+ initialized = true;
38
+ elements = document.querySelectorAll('[data-mh]');
39
+ MatchHeight.update();
40
+ },
41
+ update: function () {
42
+ if (!initialized) {
43
+ MatchHeight.init();
44
+ return;
45
+ }
46
+ if (elements.length === 0)
47
+ return;
48
+ remains = Array.prototype.map.call(elements, function (el) {
49
+ return {
50
+ el: el,
51
+ top: 0,
52
+ height: 0,
53
+ };
54
+ });
55
+ remains.forEach(function (item) {
56
+ item.el.style.minHeight = '';
57
+ });
58
+ process();
59
+ }
70
60
  };
71
-
72
61
  function process() {
73
-
74
- remains.forEach(function (item) {
75
-
76
- var bb = item.el.getBoundingClientRect();
77
-
78
- item.top = bb.top;
79
- item.height = bb.height;
80
- });
81
-
82
- remains.sort(function (a, b) {
83
- return a.top - b.top;
84
- });
85
-
86
- var processingTop = remains[0].top;
87
- var processingTargets = remains.filter(function (item) {
88
- return item.top === processingTop;
89
- });
90
- var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) {
91
- return item.height;
92
- }));
93
-
94
- processingTargets.forEach(function (item) {
95
-
96
- var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'), 10);
97
- item.el.style.minHeight = maxHeightInRow - paddingAndBorder + 'px';
98
- });
99
-
100
- remains.splice(0, processingTargets.length);
101
-
102
- if (0 < remains.length) process();
62
+ remains.forEach(function (item) {
63
+ var bb = item.el.getBoundingClientRect();
64
+ item.top = bb.top;
65
+ item.height = bb.height;
66
+ });
67
+ remains.sort(function (a, b) { return a.top - b.top; });
68
+ var processingTop = remains[0].top;
69
+ var processingTargets = remains.filter(function (item) { return Math.abs(item.top - processingTop) <= errorThreshold; });
70
+ var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) { return item.height; }));
71
+ processingTargets.forEach(function (item) {
72
+ var error = processingTop - item.top + errorThreshold;
73
+ var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top')) +
74
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom')) +
75
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width')) +
76
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'));
77
+ item.el.style.minHeight = "".concat(maxHeightInRow - paddingAndBorder + error, "px");
78
+ });
79
+ remains.splice(0, processingTargets.length);
80
+ if (0 < remains.length)
81
+ process();
103
82
  }
104
83
 
105
- var throttledUpdate = throttle(MatchHeight$1.update, 200);
106
-
84
+ var throttledUpdate = throttle(MatchHeight.update, 200);
107
85
  window.addEventListener('DOMContentLoaded', function onDomReady() {
108
-
109
- MatchHeight$1.init();
110
- window.removeEventListener('DOMContentLoaded', onDomReady);
86
+ MatchHeight.init();
87
+ window.removeEventListener('DOMContentLoaded', onDomReady);
111
88
  });
112
89
  window.addEventListener('load', function onLoad() {
113
-
114
- MatchHeight$1.update();
115
- window.removeEventListener('load', onLoad);
90
+ MatchHeight.update();
91
+ window.removeEventListener('load', onLoad);
116
92
  });
117
-
118
93
  window.addEventListener('resize', throttledUpdate);
119
94
 
120
- return MatchHeight$1;
95
+ return MatchHeight;
121
96
 
122
- })));
97
+ }));
@@ -4,4 +4,4 @@
4
4
  * https://github.com/yomotsu/MatchHeight
5
5
  * Released under the MIT License.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.MatchHeight=e()}(this,function(){"use strict";function t(){o.forEach(function(t){var e=t.el.getBoundingClientRect();t.top=e.top,t.height=e.height}),o.sort(function(t,e){return t.top-e.top});var e=o[0].top,n=o.filter(function(t){return t.top===e}),i=Math.max.apply(Math,n.map(function(t){return t.height}));n.forEach(function(t){var e=parseFloat(window.getComputedStyle(t.el).getPropertyValue("padding-top"),10)+parseFloat(window.getComputedStyle(t.el).getPropertyValue("padding-bottom"),10)+parseFloat(window.getComputedStyle(t.el).getPropertyValue("border-top-width"),10)+parseFloat(window.getComputedStyle(t.el).getPropertyValue("border-bottom-width"),10);t.el.style.minHeight=i-e+"px"}),o.splice(0,n.length),0<o.length&&t()}var e=!1,n=void 0,o=void 0,i={init:function(){e=!0,n=document.querySelectorAll("[data-mh]"),this.update()},update:function(){if(!e)return void this.init();0!==n.length&&(o=Array.prototype.map.call(n,function(t){return{el:t}}),o.forEach(function(t){t.el.style.minHeight=""}),t())}},r=function(t,e){var n=void 0,o=void 0;return function(){var i=Date.now();n&&i<n+e?(clearTimeout(o),o=setTimeout(function(){n=i,t()},e)):(n=i,t())}}(i.update,200);return window.addEventListener("DOMContentLoaded",function t(){i.init(),window.removeEventListener("DOMContentLoaded",t)}),window.addEventListener("load",function t(){i.update(),window.removeEventListener("load",t)}),window.addEventListener("resize",r),i});
7
+ (function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.MatchHeight=factory())})(this,(function(){"use strict";function throttle(fn,threshold){var last,deferTimer;return function(){var now=Date.now();if(last&&now<last+threshold){clearTimeout(deferTimer);deferTimer=setTimeout((function(){last=now;fn()}),threshold)}else{last=now;fn()}}}var errorThreshold=1;var initialized=false;var elements;var remains;var MatchHeight={init:function(){initialized=true;elements=document.querySelectorAll("[data-mh]");MatchHeight.update()},update:function(){if(!initialized){MatchHeight.init();return}if(elements.length===0)return;remains=Array.prototype.map.call(elements,(function(el){return{el:el,top:0,height:0}}));remains.forEach((function(item){item.el.style.minHeight=""}));process()}};function process(){remains.forEach((function(item){var bb=item.el.getBoundingClientRect();item.top=bb.top;item.height=bb.height}));remains.sort((function(a,b){return a.top-b.top}));var processingTop=remains[0].top;var processingTargets=remains.filter((function(item){return Math.abs(item.top-processingTop)<=errorThreshold}));var maxHeightInRow=Math.max.apply(Math,processingTargets.map((function(item){return item.height})));processingTargets.forEach((function(item){var error=processingTop-item.top+errorThreshold;var paddingAndBorder=parseFloat(window.getComputedStyle(item.el).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(item.el).getPropertyValue("padding-bottom"))+parseFloat(window.getComputedStyle(item.el).getPropertyValue("border-top-width"))+parseFloat(window.getComputedStyle(item.el).getPropertyValue("border-bottom-width"));item.el.style.minHeight="".concat(maxHeightInRow-paddingAndBorder+error,"px")}));remains.splice(0,processingTargets.length);if(0<remains.length)process()}var throttledUpdate=throttle(MatchHeight.update,200);window.addEventListener("DOMContentLoaded",(function onDomReady(){MatchHeight.init();window.removeEventListener("DOMContentLoaded",onDomReady)}));window.addEventListener("load",(function onLoad(){MatchHeight.update();window.removeEventListener("load",onLoad)}));window.addEventListener("resize",throttledUpdate);return MatchHeight}));
@@ -4,111 +4,86 @@
4
4
  * https://github.com/yomotsu/MatchHeight
5
5
  * Released under the MIT License.
6
6
  */
7
- function throttle(fn, threshhold) {
8
-
9
- var last = void 0,
10
- deferTimer = void 0;
11
-
12
- return function () {
13
-
14
- var now = Date.now();
15
-
16
- if (last && now < last + threshhold) {
17
-
18
- clearTimeout(deferTimer);
19
- deferTimer = setTimeout(function () {
20
-
21
- last = now;
22
- fn();
23
- }, threshhold);
24
- } else {
25
-
26
- last = now;
27
- fn();
28
- }
29
- };
7
+ function throttle(fn, threshold) {
8
+ var last, deferTimer;
9
+ return function () {
10
+ var now = Date.now();
11
+ if (last && now < last + threshold) {
12
+ clearTimeout(deferTimer);
13
+ deferTimer = setTimeout(function () {
14
+ last = now;
15
+ fn();
16
+ }, threshold);
17
+ }
18
+ else {
19
+ last = now;
20
+ fn();
21
+ }
22
+ };
30
23
  }
31
24
 
25
+ var errorThreshold = 1;
32
26
  var initialized = false;
33
- var elements = void 0;
34
- var remains = void 0;
35
-
36
- var MatchHeight$1 = {
37
- init: function init() {
38
-
39
- initialized = true;
40
- elements = document.querySelectorAll('[data-mh]');
41
- this.update();
42
- },
43
- update: function update() {
44
-
45
- if (!initialized) {
46
-
47
- this.init();
48
- return;
49
- }
50
-
51
- if (elements.length === 0) return;
52
-
53
- remains = Array.prototype.map.call(elements, function (el) {
54
-
55
- return { el: el };
56
- });
57
- // remove all height before
58
- remains.forEach(function (item) {
59
-
60
- item.el.style.minHeight = '';
61
- });
62
- process();
63
- }
27
+ var elements;
28
+ var remains;
29
+ var MatchHeight = {
30
+ init: function () {
31
+ initialized = true;
32
+ elements = document.querySelectorAll('[data-mh]');
33
+ MatchHeight.update();
34
+ },
35
+ update: function () {
36
+ if (!initialized) {
37
+ MatchHeight.init();
38
+ return;
39
+ }
40
+ if (elements.length === 0)
41
+ return;
42
+ remains = Array.prototype.map.call(elements, function (el) {
43
+ return {
44
+ el: el,
45
+ top: 0,
46
+ height: 0,
47
+ };
48
+ });
49
+ remains.forEach(function (item) {
50
+ item.el.style.minHeight = '';
51
+ });
52
+ process();
53
+ }
64
54
  };
65
-
66
55
  function process() {
67
-
68
- remains.forEach(function (item) {
69
-
70
- var bb = item.el.getBoundingClientRect();
71
-
72
- item.top = bb.top;
73
- item.height = bb.height;
74
- });
75
-
76
- remains.sort(function (a, b) {
77
- return a.top - b.top;
78
- });
79
-
80
- var processingTop = remains[0].top;
81
- var processingTargets = remains.filter(function (item) {
82
- return item.top === processingTop;
83
- });
84
- var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) {
85
- return item.height;
86
- }));
87
-
88
- processingTargets.forEach(function (item) {
89
-
90
- var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'), 10);
91
- item.el.style.minHeight = maxHeightInRow - paddingAndBorder + 'px';
92
- });
93
-
94
- remains.splice(0, processingTargets.length);
95
-
96
- if (0 < remains.length) process();
56
+ remains.forEach(function (item) {
57
+ var bb = item.el.getBoundingClientRect();
58
+ item.top = bb.top;
59
+ item.height = bb.height;
60
+ });
61
+ remains.sort(function (a, b) { return a.top - b.top; });
62
+ var processingTop = remains[0].top;
63
+ var processingTargets = remains.filter(function (item) { return Math.abs(item.top - processingTop) <= errorThreshold; });
64
+ var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) { return item.height; }));
65
+ processingTargets.forEach(function (item) {
66
+ var error = processingTop - item.top + errorThreshold;
67
+ var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top')) +
68
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom')) +
69
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width')) +
70
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'));
71
+ item.el.style.minHeight = "".concat(maxHeightInRow - paddingAndBorder + error, "px");
72
+ });
73
+ remains.splice(0, processingTargets.length);
74
+ if (0 < remains.length)
75
+ process();
97
76
  }
98
77
 
99
- var throttledUpdate = throttle(MatchHeight$1.update, 200);
100
-
78
+ var throttledUpdate = throttle(MatchHeight.update, 200);
101
79
  window.addEventListener('DOMContentLoaded', function onDomReady() {
102
-
103
- MatchHeight$1.init();
104
- window.removeEventListener('DOMContentLoaded', onDomReady);
80
+ MatchHeight.init();
81
+ window.removeEventListener('DOMContentLoaded', onDomReady);
105
82
  });
106
83
  window.addEventListener('load', function onLoad() {
107
-
108
- MatchHeight$1.update();
109
- window.removeEventListener('load', onLoad);
84
+ MatchHeight.update();
85
+ window.removeEventListener('load', onLoad);
110
86
  });
111
-
112
87
  window.addEventListener('resize', throttledUpdate);
113
88
 
114
- export default MatchHeight$1;
89
+ export { MatchHeight as default };
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import MatchHeight from './MatchHeight.js';
2
+ export default MatchHeight;
@@ -0,0 +1,2 @@
1
+ declare function throttle(fn: () => void, threshold: number): () => void;
2
+ export default throttle;
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "matchheight",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "author": "Yomotsu",
5
5
  "license": "MIT",
6
- "main": "dist/MatchHeight.js",
7
6
  "repository": "yomotsu/MatchHeight",
7
+ "main": "dist/MatchHeight.js",
8
8
  "jsnext:main": "dist/MatchHeight.module.js",
9
9
  "module": "dist/MatchHeight.module.js",
10
+ "types": "dist/MatchHeight.d.ts",
10
11
  "devDependencies": {
11
- "babel-preset-env": "1.2.2",
12
- "rollup": "^0.41.4",
13
- "rollup-plugin-babel": "2.7.1",
14
- "rollup-watch": "^3.2.2",
15
- "uglify-js": "^2.6.0"
12
+ "@rollup/plugin-typescript": "^11.0.0",
13
+ "rollup": "^3.16.0",
14
+ "terser": "^5.16.4",
15
+ "tslib": "^2.5.0",
16
+ "typescript": "^4.9.5"
16
17
  },
17
18
  "scripts": {
18
19
  "dev": "rollup --config --watch",
19
- "build": "rollup --config",
20
- "release": "rollup --config && uglifyjs dist/MatchHeight.js -cm --preamble \"/*!\n * @author yomotsu\n * MatchHeight\n * https://github.com/yomotsu/MatchHeight\n * Released under the MIT License.\n */\" > dist/MatchHeight.min.js"
20
+ "build": "rollup --config && terser dist/MatchHeight.js -o dist/MatchHeight.min.js --comments '/^!/'"
21
21
  },
22
22
  "keywords": [
23
23
  "matchHeight",
@@ -0,0 +1,32 @@
1
+ import pkg from './package.json' assert { type: "json" };
2
+ import typescript from 'typescript';
3
+ import rollupTypescript from '@rollup/plugin-typescript';
4
+
5
+ const license = `/*!
6
+ * @author yomotsu
7
+ * MatchHeight
8
+ * https://github.com/yomotsu/MatchHeight
9
+ * Released under the MIT License.
10
+ */`;
11
+
12
+ export default {
13
+ input: './src/main.ts',
14
+ output: [
15
+ {
16
+ format: 'umd',
17
+ name: 'MatchHeight',
18
+ file: pkg.main,
19
+ banner: license,
20
+ indent: '\t',
21
+ },
22
+ {
23
+ format: 'es',
24
+ file: pkg.module,
25
+ banner: license,
26
+ indent: '\t',
27
+ }
28
+ ],
29
+ plugins: [
30
+ rollupTypescript( { typescript } ),
31
+ ],
32
+ };
@@ -1,6 +1,13 @@
1
+ type Item = {
2
+ el: HTMLElement;
3
+ top: number;
4
+ height: number;
5
+ }
6
+
7
+ const errorThreshold = 1; // in px
1
8
  let initialized = false;
2
- let elements;
3
- let remains;
9
+ let elements: NodeListOf<HTMLElement>;
10
+ let remains: Item[];
4
11
 
5
12
  const MatchHeight = {
6
13
 
@@ -8,7 +15,7 @@ const MatchHeight = {
8
15
 
9
16
  initialized = true;
10
17
  elements = document.querySelectorAll( '[data-mh]' );
11
- this.update();
18
+ MatchHeight.update();
12
19
 
13
20
  },
14
21
 
@@ -16,18 +23,22 @@ const MatchHeight = {
16
23
 
17
24
  if ( ! initialized ) {
18
25
 
19
- this.init();
26
+ MatchHeight.init();
20
27
  return;
21
28
 
22
29
  }
23
30
 
24
31
  if ( elements.length === 0 ) return;
25
32
 
26
- remains = Array.prototype.map.call( elements, ( el ) => {
33
+ remains = Array.prototype.map.call( elements, ( el: HTMLElement ): Item => {
27
34
 
28
- return { el: el };
35
+ return {
36
+ el,
37
+ top: 0,
38
+ height: 0,
39
+ };
29
40
 
30
- } );
41
+ } ) as Item[];
31
42
  // remove all height before
32
43
  remains.forEach( ( item ) => {
33
44
 
@@ -54,17 +65,18 @@ function process() {
54
65
  remains.sort( ( a, b ) => a.top - b.top );
55
66
 
56
67
  const processingTop = remains[ 0 ].top;
57
- const processingTargets = remains.filter( item => item.top === processingTop );
68
+ const processingTargets = remains.filter( item => Math.abs( item.top - processingTop ) <= errorThreshold );
58
69
  const maxHeightInRow = Math.max( ...processingTargets.map( ( item ) => item.height ) );
59
70
 
60
71
  processingTargets.forEach( ( item ) => {
61
72
 
73
+ const error = processingTop - item.top + errorThreshold;
62
74
  const paddingAndBorder =
63
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-top' ), 10 ) +
64
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-bottom' ), 10 ) +
65
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-top-width' ), 10 ) +
66
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-bottom-width' ), 10 );
67
- item.el.style.minHeight = `${ maxHeightInRow - paddingAndBorder }px`;
75
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-top' ) ) +
76
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-bottom' ) ) +
77
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-top-width' ) ) +
78
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-bottom-width' ) );
79
+ item.el.style.minHeight = `${ maxHeightInRow - paddingAndBorder + error }px`;
68
80
 
69
81
  } );
70
82
 
File without changes
@@ -1,12 +1,12 @@
1
- function throttle( fn, threshhold ) {
1
+ function throttle( fn: () => void, threshold: number ) {
2
2
 
3
- let last, deferTimer;
3
+ let last: number, deferTimer: number;
4
4
 
5
5
  return function () {
6
6
 
7
7
  const now = Date.now();
8
8
 
9
- if ( last && now < last + threshhold ) {
9
+ if ( last && now < last + threshold ) {
10
10
 
11
11
  clearTimeout( deferTimer );
12
12
  deferTimer = setTimeout( function () {
@@ -14,7 +14,7 @@ function throttle( fn, threshhold ) {
14
14
  last = now;
15
15
  fn();
16
16
 
17
- }, threshhold );
17
+ }, threshold );
18
18
 
19
19
  } else {
20
20
 
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": "src",
4
+ "outDir": "./dist",
5
+ "declaration": true,
6
+ "target": "es5",
7
+ "strict": true,
8
+ "removeComments": true,
9
+ "experimentalDecorators": true,
10
+ "noImplicitAny": true,
11
+ "noImplicitThis": true,
12
+ "noImplicitReturns": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "strictNullChecks": true,
16
+ "strictFunctionTypes": true,
17
+ "noFallthroughCasesInSwitch": true
18
+ },
19
+ "include": ["src/**/*"],
20
+ "exclude": ["node_modules"]
21
+ }
package/rollup.config.js DELETED
@@ -1,44 +0,0 @@
1
- import babel from 'rollup-plugin-babel'
2
-
3
- const license = `/*!
4
- * @author yomotsu
5
- * MatchHeight
6
- * https://github.com/yomotsu/MatchHeight
7
- * Released under the MIT License.
8
- */`
9
-
10
- export default {
11
- entry: './src/main.js',
12
- indent: '\t',
13
- sourceMap: false,
14
- plugins: [
15
- babel( {
16
- exclude: 'node_modules/**',
17
- presets: [
18
- [ 'env', {
19
- targets: {
20
- browsers: [
21
- 'last 2 versions',
22
- 'ie >= 9'
23
- ]
24
- },
25
- loose: true,
26
- modules: false
27
- } ]
28
- ]
29
- } )
30
- ],
31
- targets: [
32
- {
33
- format: 'umd',
34
- moduleName: 'MatchHeight',
35
- dest: 'dist/MatchHeight.js',
36
- banner: license
37
- },
38
- {
39
- format: 'es',
40
- dest: 'dist/MatchHeight.module.js',
41
- banner: license
42
- }
43
- ]
44
- };