UNPKG

eslint-plugin-perfectionist

Version:

ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.

15 lines (14 loc) 358 B
'use strict' Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }) let pairwise = (nodes, callback) => { if (nodes.length === 0) { return } callback(null, nodes.at(0)) for (let i = 1; i < nodes.length; i++) { let left = nodes.at(i - 1) let right = nodes.at(i) callback(left, right) } } exports.pairwise = pairwise