UNPKG

@graffy/common

Version:

Common libraries that used by various Graffy modules.

21 lines (17 loc) 459 B
"use strict"; exports.__esModule = true; exports["default"] = pageInfo; var _node = require("../node"); function pageInfo(graph) { if (!graph || !graph.length) return {}; var start = graph[0].key; var lastNode = graph[graph.length - 1]; var end = (0, _node.isRange)(lastNode) ? lastNode.end : lastNode.key; return { start: start, end: end, hasPrev: start !== '', hasNext: end !== "\uFFFF" }; } module.exports = exports.default;