nodejs-polars
Version:
Polars: Blazingly fast DataFrames in Rust, Python, Node.js, R and SQL
27 lines (26 loc) • 900 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExprStructFunctions = void 0;
const utils_1 = require("../../utils");
const expr_1 = require("../expr");
const ExprStructFunctions = (_expr) => {
return {
field(name) {
return (0, expr_1._Expr)(_expr.structFieldByName(name));
},
nth(index) {
return (0, expr_1._Expr)(_expr.structFieldByIndex(index));
},
renameFields(names) {
return (0, expr_1._Expr)(_expr.structRenameFields(names));
},
withFields(fields) {
fields = (0, utils_1.selectionToExprList)(fields, false);
return (0, expr_1._Expr)(_expr.structWithFields(fields));
},
jsonEncode() {
return (0, expr_1._Expr)(_expr.structJsonEncode());
},
};
};
exports.ExprStructFunctions = ExprStructFunctions;