How to use the fxjs.last function in fxjs

To help you get started, we’ve selected a few fxjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marpple / FxSQL / src / ljoin.js View on Github external
each(me => {
            while (!(last(cur).depth < me.depth)) cur.pop();
            const left = last(cur);
            if (me.rel_type == '-') {
              me.left_key = me.left_key || (me.is_poly ? 'id' : singular(me.table) + '_id');
              me.key = me.key || (me.is_poly ? 'attached_id' : 'id');
              left.left_joins.push(me);
            } else {
              me.left_key = me.left_key || 'id';
              me.key = me.key || (me.is_poly ? 'attached_id' : singular(left.table) + '_id');
            }
            left.rels.push(me);

            me.poly_type = me.is_poly ?
              SQL `AND ${EQ(
                is_string(me.poly_type) ? { attached_type: me.poly_type || left.table } : me.poly_type
              )}` : tag();

            cur.push(me);
github marpple / FxSQL / src / ljoin.js View on Github external
each(me => {
            while (!(last(cur).depth < me.depth)) cur.pop();
            const left = last(cur);
            if (me.rel_type == '-') {
              me.left_key = me.left_key || (me.is_poly ? 'id' : singular(me.table) + '_id');
              me.key = me.key || (me.is_poly ? 'attached_id' : 'id');
              left.left_joins.push(me);
            } else {
              me.left_key = me.left_key || 'id';
              me.key = me.key || (me.is_poly ? 'attached_id' : singular(left.table) + '_id');
            }
            left.rels.push(me);

            me.poly_type = me.is_poly ?
              SQL `AND ${EQ(
                is_string(me.poly_type) ? { attached_type: me.poly_type || left.table } : me.poly_type
              )}` : tag();