(specifier)
| 2 | var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; |
| 3 | |
| 4 | export default function formatSpecifier(specifier) { |
| 5 | if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); |
| 6 | var match; |
| 7 | return new FormatSpecifier({ |
| 8 | fill: match[1], |
| 9 | align: match[2], |
| 10 | sign: match[3], |
| 11 | symbol: match[4], |
| 12 | zero: match[5], |
| 13 | width: match[6], |
| 14 | comma: match[7], |
| 15 | precision: match[8] && match[8].slice(1), |
| 16 | trim: match[9], |
| 17 | type: match[10] |
| 18 | }); |
| 19 | } |
| 20 | |
| 21 | formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof |
| 22 |
no outgoing calls
no test coverage detected
searching dependent graphs…