You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
357 B
14 lines
357 B
|
4 months ago
|
/**
|
||
|
|
* @example
|
||
|
|
* lt -> ['l', 't']
|
||
|
|
* left-top -> ['l', 't']
|
||
|
|
* inner -> i
|
||
|
|
*/
|
||
|
|
export function parsePosition(position) {
|
||
|
|
if (!/\S+-\S+/g.test(position))
|
||
|
|
return position.length > 2 ? [position[0]] : position.split('');
|
||
|
|
return position.split('-').map(function (str) {
|
||
|
|
return str[0];
|
||
|
|
});
|
||
|
|
}
|
||
|
|
//# sourceMappingURL=pase-position.js.map
|