1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = getWidths;
|
7 | function getWidths(optionalWidthString) {
|
8 | if (!optionalWidthString || optionalWidthString === '') {
|
9 | return [];
|
10 | }
|
11 |
|
12 | if (!/^[0-9,]*$/.test(optionalWidthString)) {
|
13 | throw new Error('Widths must be comma seperated integers. Received: ' + optionalWidthString);
|
14 | }
|
15 |
|
16 | return optionalWidthString.split(',').map(function (s) {
|
17 | return parseInt(s, 10);
|
18 | });
|
19 | } |
\ | No newline at end of file |