Skip to content

Commit

Permalink
add global __pl__ (#3763)
Browse files Browse the repository at this point in the history
* add global __pl__

* code cleanup

* minor refactor to main export

* fix reexport
  • Loading branch information
universalmind303 committed Jun 21, 2022
1 parent 04a5163 commit 4f55ebc
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions nodejs-polars/polars/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as series from "./series/series";
import * as df from "./dataframe";
import { DataType } from "./datatypes";
import {DataType} from "./datatypes";
import * as func from "./functions";
import * as io from "./io";
import * as cfg from "./cfg";
import * as ldf from "./lazy/dataframe";
import pli from "./internals/polars_internal";
import {
import {
funcs as lazy,
Expr as lazyExpr,
GroupBy as lazyGroupBy,
Expand All @@ -26,26 +26,26 @@ namespace pl {
export import Config = cfg.Config;
export import Int8 = DataType.Int8
export import Int16 = DataType.Int16
export import Int32 = DataType.Int32;
export import Int64 = DataType.Int64;
export import UInt8 = DataType.UInt8;
export import UInt16 = DataType.UInt16;
export import UInt32 = DataType.UInt32;
export import UInt64 = DataType.UInt64;
export import Float32 = DataType.Float32;
export import Float64 = DataType.Float64;
export import Bool = DataType.Bool;
export import Utf8 = DataType.Utf8;
export import List = DataType.List;
export import Int32 = DataType.Int32;
export import Int64 = DataType.Int64;
export import UInt8 = DataType.UInt8;
export import UInt16 = DataType.UInt16;
export import UInt32 = DataType.UInt32;
export import UInt64 = DataType.UInt64;
export import Float32 = DataType.Float32;
export import Float64 = DataType.Float64;
export import Bool = DataType.Bool;
export import Utf8 = DataType.Utf8;
export import List = DataType.List;
export import Date = DataType.Date;
export import Datetime = DataType.Datetime;
export import Time = DataType.Time;
export import Object = DataType.Object;
export import Categorical = DataType.Categorical;
export import repeat = func.repeat;
export import concat = func.concat;
export import repeat = func.repeat;
export import concat = func.concat;

// // IO
// IO
export import scanCSV = io.scanCSV;
export import scanJson = io.scanJson;
export import scanIPC = io.scanIPC;
Expand All @@ -61,7 +61,7 @@ namespace pl {
export import readCSVStream = io.readCSVStream;
export import readJSONStream = io.readJSONStream;

// // lazy
// lazy
export import col = lazy.col
export import cols = lazy.cols
export import lit = lazy.lit
Expand Down Expand Up @@ -92,4 +92,8 @@ namespace pl {
export const version = pli.version();
}

// add this globally so packages can reuse it.
// eslint-disable-next-line no-undef
global[Symbol.for("__pl__")] = pl;
// eslint-disable-next-line no-undef
export = pl;

0 comments on commit 4f55ebc

Please sign in to comment.