twada/espower

View on GitHub
lib/controller-utils.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

const getParentNode = (controller) => {
  const parents = controller.parents();
  return parents[parents.length - 1];
};

const getCurrentKey = (controller) => {
  const path = controller.path();
  return path ? path[path.length - 1] : null;
};

module.exports = {
  getParentNode,
  getCurrentKey
};