code: function npm2poetry(input) {
    // Note: this doesn't remove the ^
    const res = input
      .split(' ')
      .map(str => str.trim())
      .filter(notEmpty);
    const operators = ['^', '~', '=', '>', '<', '<=', '>='];
    for (let i = 0; i < res.length - 1; i += 1) {
      if (operators.includes(res[i])) {
        const newValue = res[i] + ' ' + res[i + 1];
        res.splice(i, 2, newValue);
      }
    }
    return res.join(', ');
  }
docs: NOTE: This function is copied from cargo versionsing code. Poetry uses commas (like in cargo) instead of spaces (like in npm) for AND operation.