lib/plugins/aws/package/compile/events/apiGateway/lib/resources.js/cutBranch
    function cutBranch(node) {
      if (!node.parent) {
        return;
      }

      const n = node;
      if (node.parent.children.length <= 1) {
        n.parent.children = [];
      } else {
        n.parent.children = node.parent.children.filter(c => c.path !== n.path);
        n.parent.isCut = true;
      }
      n.parent = null;
    }