Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dataform/core

Package Overview
Dependencies
Maintainers
2
Versions
250
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dataform/core - npm Package Compare versions

Comparing version 1.0.10 to 1.1.0

7

assertion.d.ts

@@ -5,2 +5,7 @@ /// <amd-module name="@dataform/core/assertion" />

export declare type AContextable<T> = T | ((ctx: AssertionContext) => T);
export interface AConfig {
dependencies?: string | string[];
tags?: string[];
description?: string;
}
export declare class Assertion {

@@ -10,5 +15,7 @@ proto: dataform.IAssertion;

private contextableQuery;
config(config: AConfig): this;
query(query: AContextable<string>): this;
dependencies(value: string | string[]): this;
tags(value: string | string[]): this;
description(description: string): this;
compile(): dataform.IAssertion;

@@ -15,0 +22,0 @@ }

18

assertion.js

@@ -17,2 +17,14 @@ (function (factory) {

}
config(config) {
if (config.dependencies) {
this.dependencies(config.dependencies);
}
if (config.tags) {
this.tags(config.tags);
}
if (config.description) {
this.description(config.description);
}
return this;
}
query(query) {

@@ -40,2 +52,6 @@ this.contextableQuery = query;

}
description(description) {
this.proto.actionDescriptor = { description };
return this;
}
compile() {

@@ -79,2 +95,2 @@ const context = new AssertionContext(this);

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vY29yZS9hc3NlcnRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFDQSw2Q0FBNEM7SUFJNUMsTUFBYSxTQUFTO1FBQXRCO1lBQ1MsVUFBSyxHQUF3QixpQkFBUSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQXlDbEUsQ0FBQztRQWpDUSxLQUFLLENBQUMsS0FBMkI7WUFDdEMsSUFBSSxDQUFD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VlO1xuICAgIH1cbiAgfVxufVxuIl19
/// <amd-module name="@dataform/core/operation" />
import { Session } from "@dataform/core/session";
import { IColumnsDescriptor, Session } from "@dataform/core/session";
import { dataform } from "@dataform/protos";
export declare type OContextable<T> = T | ((ctx: OperationContext) => T);
export interface OConfig {
dependencies?: string | string[];
tags?: string[];
description?: string;
columns?: IColumnsDescriptor;
hasOutput?: boolean;
}
export declare class Operation {

@@ -9,2 +16,3 @@ proto: dataform.IOperation;

private contextableQueries;
config(config: OConfig): this;
queries(queries: OContextable<string | string[]>): this;

@@ -14,2 +22,4 @@ dependencies(value: string | string[]): this;

hasOutput(hasOutput: boolean): this;
description(description: string): this;
columns(columns: IColumnsDescriptor): this;
compile(): dataform.IOperation;

@@ -16,0 +26,0 @@ }

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define("@dataform/core/operation", ["require", "exports", "@dataform/protos"], factory);
define("@dataform/core/operation", ["require", "exports", "@dataform/core/session", "@dataform/protos"], factory);
}

@@ -13,2 +13,3 @@ })(function (require, exports) {

Object.defineProperty(exports, "__esModule", { value: true });
const session_1 = require("@dataform/core/session");
const protos_1 = require("@dataform/protos");

@@ -19,2 +20,20 @@ class Operation {

}
config(config) {
if (config.dependencies) {
this.dependencies(config.dependencies);
}
if (config.tags) {
this.tags(config.tags);
}
if (config.hasOutput) {
this.hasOutput(config.hasOutput);
}
if (config.description) {
this.description(config.description);
}
if (config.columns) {
this.columns(config.columns);
}
return this;
}
queries(queries) {

@@ -46,6 +65,26 @@ this.contextableQueries = queries;

}
description(description) {
if (!this.proto.actionDescriptor) {
this.proto.actionDescriptor = {};
}
this.proto.actionDescriptor.description = description;
return this;
}
columns(columns) {
if (!this.proto.actionDescriptor) {
this.proto.actionDescriptor = {};
}
this.proto.actionDescriptor.columns = session_1.mapToColumnProtoArray(columns);
return this;
}
compile() {
if (this.proto.actionDescriptor &&
this.proto.actionDescriptor.columns &&
this.proto.actionDescriptor.columns.length > 0 &&
!this.proto.hasOutput) {
this.session.compileError(new Error("Actions of type 'operations' may only describe columns if they specify 'hasOutput: true'."));
}
const context = new OperationContext(this);
const appliedQueries = context.apply(this.contextableQueries);
this.proto.queries = typeof appliedQueries == "string" ? [appliedQueries] : appliedQueries;
this.proto.queries = typeof appliedQueries === "string" ? [appliedQueries] : appliedQueries;
return this.proto;

@@ -95,2 +134,2 @@ }

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3BlcmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vY29yZS9vcGVyYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7SUFDQSw2Q0FBNEM7SUFJNUMsTUFBYSxTQUFTO1FBQXRCO1lBQ1MsVUFBSyxHQUF3QixpQkFBUSxDQUFDLFNBQVMsQ0FBQyxNQUFNLEVBQUUsQ0FBQztRQThDbEUsQ0FBQztRQXRDUSxPQUFPLENBQUMsT0FBd0M7WUFDckQsSUFBSSxDQUFDLGtCQUFrQixHQUFHLE9BQU8sQ0FBQztZQUNsQyxPQUFPLElBQUksQ0FBQztRQUNkLENBQUM7UUFFTSxZQUFZLENBQUMsS0FBd0I7WUFDMUMsTUFBTSxlQUFlLEdBQUcsT0FBTyxLQUFLLEtBQUssUUFBUSxDQUFDLENBQUMsQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUM7WUFDcEUsZUFBZSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUMsRUFBRTtnQkFDMUIsSUFBSSxJQUFJLENBQUMsS0FBSyxDQUFDLFlBQVksQ0FBQyxPQUFPLENBQUMsQ0FBQyxDQUFDLEdBQUcsQ0FBQyxFQUFFO29CQUMxQyxJQUFJLENBQUMsS0FBSyxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM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{
"version": "1.0.10",
"version": "1.1.0",
"homepage": "https://github.com/dataform-co/dataform",

@@ -24,3 +24,3 @@ "license": "MIT",

"dependencies": {
"@dataform/protos": "1.0.10",
"@dataform/protos": "1.1.0",
"moo": "^0.5.0",

@@ -27,0 +27,0 @@ "protobufjs": "^6.8.8"

/// <amd-module name="@dataform/core/session" />
import * as adapters from "@dataform/core/adapters";
import { AContextable, Assertion } from "@dataform/core/assertion";
import { OContextable, Operation } from "@dataform/core/operation";
import { Table, TConfig, TContextable } from "@dataform/core/table";
import { Test } from "@dataform/core/test";
import { AConfig, AContextable, Assertion } from "@dataform/core/assertion";
import { OConfig, OContextable, Operation } from "@dataform/core/operation";
import * as table from "@dataform/core/table";
import * as test from "@dataform/core/test";
import { dataform } from "@dataform/protos";

@@ -13,10 +13,15 @@ interface IActionProto {

}
interface ISqlxConfig extends TConfig {
interface ISqlxConfig extends table.TConfig, AConfig, OConfig, test.TConfig {
type: "view" | "table" | "inline" | "incremental" | "assertion" | "operations" | "test";
schema?: string;
name: string;
hasOutput?: boolean;
dataset?: string;
tags?: string[];
}
export interface IColumnsDescriptor {
[name: string]: string | IRecordDescriptor;
}
interface IRecordDescriptor {
description?: string;
columns?: IColumnsDescriptor;
}
export declare function mapToColumnProtoArray(columns: IColumnsDescriptor): dataform.IColumnDescriptor[];
export declare class Session {

@@ -26,3 +31,3 @@ rootDir: string;

tables: {
[name: string]: Table;
[name: string]: table.Table;
};

@@ -36,3 +41,3 @@ operations: {

tests: {
[name: string]: Test;
[name: string]: test.Test;
};

@@ -50,9 +55,9 @@ graphErrors: dataform.IGraphErrors;

hasInputs: boolean;
}): Operation | Table | Test | Assertion;
}): Operation | table.Table | test.Test | Assertion;
target(target: string, defaultSchema?: string): dataform.ITarget;
resolve(name: string): string;
operate(name: string, queries?: OContextable<string | string[]>): Operation;
publish(name: string, queryOrConfig?: TContextable<string> | TConfig): Table;
publish(name: string, queryOrConfig?: table.TContextable<string> | table.TConfig): table.Table;
assert(name: string, query?: AContextable<string>): Assertion;
test(name: string): Test;
test(name: string): test.Test;
compileError(err: Error | string, path?: string): void;

@@ -59,0 +64,0 @@ compileGraphChunk<T>(part: {

@@ -15,6 +15,30 @@ (function (factory) {

const operation_1 = require("@dataform/core/operation");
const table_1 = require("@dataform/core/table");
const test_1 = require("@dataform/core/test");
const table = require("@dataform/core/table");
const test = require("@dataform/core/test");
const utils = require("@dataform/core/utils");
const protos_1 = require("@dataform/protos");
function mapToColumnProtoArray(columns) {
return utils.flatten(Object.keys(columns).map(column => mapColumnDescriptionToProto([column], columns[column])));
}
exports.mapToColumnProtoArray = mapToColumnProtoArray;
function mapColumnDescriptionToProto(currentPath, description) {
if (typeof description === "string") {
return [
protos_1.dataform.ColumnDescriptor.create({
description,
path: currentPath
})
];
}
const columnDescriptor = description.description
? [
protos_1.dataform.ColumnDescriptor.create({
description: description.description,
path: currentPath
})
]
: [];
const nestedColumns = description.columns ? Object.keys(description.columns) : [];
return columnDescriptor.concat(utils.flatten(nestedColumns.map(nestedColumn => mapColumnDescriptionToProto(currentPath.concat([nestedColumn]), description.columns[nestedColumn]))));
}
class Session {

@@ -48,2 +72,6 @@ constructor(rootDir, projectConfig) {

}
if (actionOptions.sqlxConfig.columns &&
!(this.isDatasetType(actionOptions.sqlxConfig.type) || actionOptions.sqlxConfig.hasOutput)) {
this.compileError("Actions may only specify 'columns' if they create a dataset.");
}
if (actionOptions.sqlxConfig.protected && actionOptions.sqlxConfig.type !== "incremental") {

@@ -79,5 +107,2 @@ this.compileError("Actions may only specify 'protected: true' if they are of type 'incremental'.");

}
if (actionOptions.sqlxConfig.type === "test") {
return this.test(actionOptions.sqlxConfig.name).dataset(actionOptions.sqlxConfig.dataset);
}
const action = (() => {

@@ -88,28 +113,18 @@ switch (actionOptions.sqlxConfig.type) {

case "inline":
case "incremental": {
const dataset = this.publish(actionOptions.sqlxConfig.name);
dataset.config(actionOptions.sqlxConfig);
return dataset;
}
case "assertion": {
const assertion = this.assert(actionOptions.sqlxConfig.name);
assertion.dependencies(actionOptions.sqlxConfig.dependencies);
assertion.tags(actionOptions.sqlxConfig.tags);
return assertion;
}
case "operations": {
const operations = this.operate(actionOptions.sqlxConfig.name);
if (!actionOptions.sqlxConfig.hasOutput) {
delete operations.proto.target;
}
operations.dependencies(actionOptions.sqlxConfig.dependencies);
operations.tags(actionOptions.sqlxConfig.tags);
return operations;
}
default: {
case "incremental":
return this.publish(actionOptions.sqlxConfig.name);
case "assertion":
return this.assert(actionOptions.sqlxConfig.name);
case "operations":
return this.operate(actionOptions.sqlxConfig.name);
case "test":
return this.test(actionOptions.sqlxConfig.name);
default:
throw new Error(`Unrecognized action type: ${actionOptions.sqlxConfig.type}`);
}
}
})();
if (action.proto.target) {
})().config(actionOptions.sqlxConfig);
if (action instanceof test.Test) {
return action;
}
if (!(action instanceof operation_1.Operation) || action.proto.hasOutput) {
const finalSchema = actionOptions.sqlxConfig.schema ||

@@ -121,2 +136,5 @@ (actionOptions.sqlxConfig.type === "assertion"

}
else {
delete action.proto.target;
}
return action;

@@ -160,17 +178,17 @@ }

this.checkActionNameIsUnused(name);
const table = new table_1.Table();
table.session = this;
table.proto.name = name;
table.proto.target = this.target(name);
const newTable = new table.Table();
newTable.session = this;
newTable.proto.name = name;
newTable.proto.target = this.target(name);
if (!!queryOrConfig) {
if (typeof queryOrConfig === "object") {
table.config(queryOrConfig);
newTable.config(queryOrConfig);
}
else {
table.query(queryOrConfig);
newTable.query(queryOrConfig);
}
}
table.proto.fileName = utils.getCallerFile(this.rootDir);
this.tables[name] = table;
return table;
newTable.proto.fileName = utils.getCallerFile(this.rootDir);
this.tables[name] = newTable;
return newTable;
}

@@ -192,8 +210,8 @@ assert(name, query) {

this.checkTestNameIsUnused(name);
const test = new test_1.Test();
test.session = this;
test.proto.name = name;
test.proto.fileName = utils.getCallerFile(this.rootDir);
this.tests[name] = test;
return test;
const newTest = new test.Test();
newTest.session = this;
newTest.proto.name = name;
newTest.proto.fileName = utils.getCallerFile(this.rootDir);
this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1xuICB9KTogVFtdIHtcbiAgICBjb25zdCBjb21waWxlZENodW5rczogVFtdID0gW107XG5cbiAgICBPYmplY3Qua2V5cyhwYXJ0KS5mb3JFYWNoKGtleSA9PiB7XG4gICAgICB0cnkge1xuICAgICAgICBjb25zdCBjb21waWxlZENodW5rID0gcGFydFtrZXldLmNvbXBpbGUoKTtcbiAgICAgICAgY29tcGlsZWRDaHVua3MucHVzaChjb21waWxlZENodW5rKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgdGhpcy5jb21waWxlRXJyb3IoZSwgcGFydFtrZXldLnByb3RvLmZpbGVOYW1lKTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHJldHVybiBjb21waWxlZENodW5rcztcbiAgfVxuXG4gIHB1YmxpYyBjb21waWxlKCk6IGRhdGFmb3JtLklDb21waWxlZEdyYXBoIHtcbiAgICBjb25zdCBjb21waWxlZEdyYXBoID0gZGF0YWZvcm0uQ29tcGlsZWRHcmFwaC5jcmVhdGUoe1xuICAgICAgcHJvamVjdENvbmZpZzogdGhpcy5jb25maWcsXG4gICAgICB0YWJsZXM6IHRoaXMuY29tcGlsZUdyYXBoQ2h1bmsodGhpcy50YWJsZXMpLFxuICAgICAgb3BlcmF0aW9uczogdGhpcy5jb21waWxlR3JhcGhDaHVuayh0aGlzLm9wZXJhdGlvbnMpLFxuICAgICAgYXNzZXJ0aW9uczogdGhpcy5jb21waWxlR3JhcGhDaHVuayh0aGlzLmFzc2VydGlvbnMpLFxuICAgICAgdGVzdHM6IHRoaXMuY29tcGlsZUdyYXBoQ2h1bmsodGhpcy50ZXN0cyksXG4gICAgICBncmFwaEVycm9yczogdGhpcy5ncmFwaEVycm9yc1xuICAgIH0pO1xuXG4gICAgLy8gRXhwYW5kIGFjdGlvbiBkZXBlbmRlbmN5IHdpbGRjYXJkcy5cblxuICAgIGNvbnN0IGFsbEFjdGlvbnM6IElBY3Rpb25Qcm90b1tdID0gW10uY29uY2F0KFxuICAgICAgY29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form/core/table" />
import { Session } from "@dataform/core/session";
import { IColumnsDescriptor, Session } from "@dataform/core/session";
import { dataform } from "@dataform/protos";

@@ -20,3 +20,3 @@ export declare enum TableTypes {

export declare const ignoredProps: {
[TableTypes.INLINE]: string[];
[tableType: string]: Array<keyof dataform.ITable>;
};

@@ -30,5 +30,4 @@ declare type ValueOf<T> = T[keyof T];

tags?: string[];
descriptor?: string[] | {
[key: string]: string;
};
description?: string;
columns?: IColumnsDescriptor;
disabled?: boolean;

@@ -57,7 +56,4 @@ protected?: boolean;

tags(value: string | string[]): this;
descriptor(key: string, description?: string): Table;
descriptor(map: {
[key: string]: string;
}): Table;
descriptor(keys: string[]): Table;
description(description: string): this;
columns(columns: IColumnsDescriptor): this;
compile(): dataform.Table;

@@ -80,6 +76,2 @@ private addDependency;

dependencies: (name: string) => string;
descriptor: (keyOrKeysOrMap: string | string[] | {
[key: string]: string;
}, description?: string) => string;
describe: (key: string, description?: string) => string;
apply: <T>(value: TContextable<T>) => T;

@@ -104,8 +96,2 @@ tags: (name: string | string[]) => string;

dependencies(name: string): string;
descriptor(key: string, description?: string): string;
descriptor(map: {
[key: string]: string;
}): string;
descriptor(keys: string[]): string;
describe(key: string, description?: string): string;
apply<T>(value: TContextable<T>): T;

@@ -112,0 +98,0 @@ tags(tags: string[]): string;

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define("@dataform/core/table", ["require", "exports", "@dataform/protos"], factory);
define("@dataform/core/table", ["require", "exports", "@dataform/core/session", "@dataform/protos"], factory);
}

@@ -13,2 +13,3 @@ })(function (require, exports) {

Object.defineProperty(exports, "__esModule", { value: true });
const session_1 = require("@dataform/core/session");
const protos_1 = require("@dataform/protos");

@@ -39,6 +40,5 @@ var TableTypes;

"postOps",
"descriptor",
"actionDescriptor",
"disabled",
"where",
"fieldDescriptor"
"where"
]

@@ -63,10 +63,2 @@ };

}
if (config.descriptor) {
if (config.descriptor instanceof Array) {
this.descriptor(config.descriptor);
}
else {
this.descriptor(config.descriptor);
}
}
if (config.disabled) {

@@ -84,2 +76,8 @@ this.disabled();

}
if (config.description) {
this.description(config.description);
}
if (config.columns) {
this.columns(config.columns);
}
return this;

@@ -140,19 +138,14 @@ }

}
descriptor(keyOrKeysOrMap, description) {
if (!this.proto.fieldDescriptor) {
this.proto.fieldDescriptor = {};
description(description) {
if (!this.proto.actionDescriptor) {
this.proto.actionDescriptor = {};
}
if (typeof keyOrKeysOrMap === "string") {
this.proto.fieldDescriptor[keyOrKeysOrMap] = description || "";
this.proto.actionDescriptor.description = description;
return this;
}
columns(columns) {
if (!this.proto.actionDescriptor) {
this.proto.actionDescriptor = {};
}
else if (keyOrKeysOrMap instanceof Array) {
keyOrKeysOrMap.forEach(key => {
this.proto.fieldDescriptor[key] = "";
});
}
else {
Object.keys(keyOrKeysOrMap).forEach(key => {
this.proto.fieldDescriptor[key] = keyOrKeysOrMap[key] || "";
});
}
this.proto.actionDescriptor.columns = session_1.mapToColumnProtoArray(columns);
return this;

@@ -243,10 +236,2 @@ }

}
descriptor(keyOrKeysOrMap, description) {
this.table.descriptor(keyOrKeysOrMap, description);
return "";
}
describe(key, description) {
this.table.descriptor(key, description);
return key;
}
apply(value) {

@@ -267,2 +252,2 @@ if (typeof value === "function") {

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFibGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL3RhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQ0EsNkNBQTRDO0lBRTVDLElBQVksVUFLWDtJQUxELFdBQVksVUFBVTtRQUNwQiw2QkFBZSxDQUFBO1FBQ2YsMkJBQWEsQ0FBQTtRQUNiLHlDQUEyQixDQUFBO1FBQzNCLCtCQUFpQixDQUFBO0lBQ25CLENBQUMsRUFMVyxVQUFVLEdBQVYsa0JBQVUsS0FBVixrQk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cnk6IGRhdGFmb3JtLklCaWdRdWVyeU9wdGlvbnMpIHtcbiAgICB0aGlzLnRhYmxlLmJpZ3F1ZXJ5KGJpZ3F1ZXJ5KTtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxuXG4gIHB1YmxpYyBkZXBlbmRlbmNpZXMobmFtZTogc3RyaW5nKSB7XG4gICAgdGhpcy50YWJsZS5kZXBlbmRlbmNpZXMobmFtZSk7XG4gICAgcmV0dXJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgYXBwbHk8VD4odmFsdWU6IFRDb250ZXh0YWJsZTxUPik6IFQge1xuICAgIGlmICh0eXBlb2YgdmFsdWUgPT09IFwiZnVuY3Rpb25cIikge1xuICAgICAgcmV0dXJuICh2YWx1ZSBhcyBhbnkpKHRoaXMpO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gdmFsdWU7XG4gICAgfVxuICB9XG4gIHB1YmxpYyB0YWdzKHRhZ3M6IHN0cmluZ1tdKSB7XG4gICAgdGhpcy50YWJsZS50YWdzKHRhZ3MpO1xuICAgIHJldHVybiBcIlwiO1xuICB9XG59XG4iXX0=

@@ -5,2 +5,5 @@ /// <amd-module name="@dataform/core/test" />

export declare type TContextable<T> = T | ((ctx: TestContext) => T);
export interface TConfig {
dataset?: string;
}
export declare class Test {

@@ -14,2 +17,3 @@ proto: dataform.ITest;

private contextableQuery;
config(config: TConfig): this;
dataset(datasetToTest: string): this;

@@ -16,0 +20,0 @@ input(refName: string, contextableQuery: TContextable<string>): this;

@@ -18,2 +18,8 @@ (function (factory) {

}
config(config) {
if (config.dataset) {
this.dataset(config.dataset);
}
return this;
}
dataset(datasetToTest) {

@@ -122,8 +128,2 @@ this.datasetToTest = datasetToTest;

}
descriptor(keyOrKeysOrMap, description) {
return "";
}
describe(key, description) {
return "";
}
tags(tags) {

@@ -134,2 +134,2 @@ return "";

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5qcyI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XJuIFwiXCI7XG4gIH1cblxuICBwdWJsaWMgZGVwZW5kZW5jaWVzKG5hbWU6IHN0cmluZykge1xuICAgIHJldHVybiBcIlwiO1xuICB9XG5cbiAgcHVibGljIHRhZ3ModGFnczogc3RyaW5nW10pIHtcbiAgICByZXR1cm4gXCJcIjtcbiAgfVxufVxuIl19

@@ -10,1 +10,2 @@ /// <amd-module name="@dataform/core/utils" />

export declare function validate(compiledGraph: dataform.ICompiledGraph): dataform.IGraphErrors;
export declare function flatten<T>(nestedArray: T[][]): T[];

@@ -163,3 +163,4 @@ (function (factory) {

}
if (action.redshift.sortStyle || (action.redshift.sortKeys && action.redshift.sortKeys.length)) {
if (action.redshift.sortStyle ||
(action.redshift.sortKeys && action.redshift.sortKeys.length)) {
const props = { sortStyle: action.redshift.sortStyle, sortKeys: action.redshift.sortKeys };

@@ -204,3 +205,9 @@ const types = { sortStyle: table_1.SortStyleTypes };

exports.validate = validate;
function flatten(nestedArray) {
return nestedArray.reduce((previousValue, currentValue) => {
return previousValue.concat(currentValue);
}, []);
}
exports.flatten = flatten;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O0lBQUEsNkNBQTRDO0lBQzVDLGdEQUFtRjtJQUVuRixTQUFnQixZQUFZLENBQUMsSUFBWSxFQUFFLElBQVk7UUFDckQsSUFBSSxJQUFJLENBQUMsTUFBTSxJQUFJLENBQUMsRUFBRTtZQUNwQixPQUFPLElBQUksQ0FBQztTQUNiO1FBQ0QsTUFBTSxRQUFRLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7UUFDMUMsSUFBSSxRQUFRLENBQUMsVUFBVSxDQUFDLE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U3R5bGUsIHNvcnRLZXlzOiBhY3Rpb24ucmVkc2hpZnQuc29ydEtleXMgfTtcbiAgICAgICAgY29uc3QgdHlwZXMgPSB7IHNvcnRTdHlsZTogU29ydFN0eWxlVHlwZXMgfTtcbiAgICAgICAgcmVkc2hpZnRDb25maWcucHVzaCh7IHByb3BzLCB0eXBlcyB9KTtcbiAgICAgIH1cblxuICAgICAgcmVkc2hpZnRDb25maWcuZm9yRWFjaChpdGVtID0+IHtcbiAgICAgICAgT2JqZWN0LmtleXMoaXRlbS5wcm9wcykuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICAgIGlmICghaXRlbS5wcm9wc1trZXldIHx8ICFpdGVtLnByb3BzW2tleV0ubGVuZ3RoKSB7XG4gICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gYFByb3BlcnR5IFwiJHtrZXl9XCIgaXMgbm90IGRlZmluZWRgO1xuICAgICAgICAgICAgdmFsaWRhdGlvbkVycm9ycy5wdXNoKGRhdGFmb3JtLlZhbGlkYXRpb25FcnJvci5jcmVhdGUoeyBtZXNzYWdlLCBhY3Rpb25OYW1lIH0pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIE9iamVjdC5rZXlzKGl0ZW0udHlwZXMpLmZvckVhY2godHlwZSA9PiB7XG4gICAgICAgICAgY29uc3QgY3VycmVudEVudW0gPSBpdGVtLnR5cGVzW3R5cGVdO1xuICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICEhaXRlbS5wcm9wc1t0eXBlXSAmJlxuICAgICAgICAgICAgT2JqZWN0LmtleXMoY3VycmVudEVudW0pXG4gICAgICAgICAgICAgIC5tYXAoa2V5ID0+IGN1cnJlbnRFbnVtW2tleV0pXG4gICAgICAgICAgICAgIC5pbmRleE9mKGl0ZW0ucHJvcHNbdHlwZV0pID09PSAtMVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgcHJlZGVmaW5lZFZhbHVlcyA9IGdldFByZWRlZmluZWRU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pZnQuc29ydEtleXMgfTtcbiAgICAgICAgY29uc3QgdHlwZXMgPSB7IHNvcnRTdHlsZTogU29ydFN0eWxlVHlwZXMgfTtcbiAgICAgICAgcmVkc2hpZnRDb25maWcucHVzaCh7IHByb3BzLCB0eXBlcyB9KTtcbiAgICAgIH1cblxuICAgICAgcmVkc2hpZnRDb25maWcuZm9yRWFjaChpdGVtID0+IHtcbiAgICAgICAgT2JqZWN0LmtleXMoaXRlbS5wcm9wcykuZm9yRWFjaChrZXkgPT4ge1xuICAgICAgICAgIGlmICghaXRlbS5wcm9wc1trZXldIHx8ICFpdGVtLnByb3BzW2tleV0ubGVuZ3RoKSB7XG4gICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gYFByb3BlcnR5IFwiJHtrZXl9XCIgaXMgbm90IGRlZmluZWRgO1xuICAgICAgICAgICAgdmFsaWRhdGlvbkVycm9ycy5wdXNoKGRhdGFmb3JtLlZhbGlkYXRpb25FcnJvci5jcmVhdGUoeyBtZXNzYWdlLCBhY3Rpb25OYW1lIH0pKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIE9iamVjdC5rZXlzKGl0ZW0udHlwZXMpLmZvckVhY2godHlwZSA9PiB7XG4gICAgICAgICAgY29uc3QgY3VycmVudEVudW0gPSBpdGVtLnR5cGVzW3R5cGVdO1xuICAgICAgICAgIGlmIChcbiAgICAgICAgICAgICEhaXRlbS5wcm9wc1t0eXBlXSAmJlxuICAgICAgICAgICAgT2JqZWN0LmtleXMoY3VycmVudEVudW0pXG4gICAgICAgICAgICAgIC5tYXAoa2V5ID0+IGN1cnJlbnRFbnVtW2tleV0pXG4gICAgICAgICAgICAgIC5pbmRleE9mKGl0ZW0ucHJvcHNbdHlwZV0pID09PSAtMVxuICAgICAgICAgICkge1xuICAgICAgICAgICAgY29uc3QgcHJlZGVmaW5lZFZhbHVlcyA9IGdldFByZWRlZmluZWRUeXBlcyhjdXJyZW50RW51bSk7XG4gICAgICAgICAgICBjb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sZWRHcmFwaC5ncmFwaEVycm9ycy5jb21waWxhdGlvbkVycm9yc1xuICAgICAgPyBjb21waWxlZEdyYXBoLmdyYXBoRXJyb3JzLmNvbXBpbGF0aW9uRXJyb3JzXG4gICAgICA6IFtdO1xuXG4gIHJldHVybiBkYXRhZm9ybS5HcmFwaEVycm9ycy5jcmVhdGUoeyB2YWxpZGF0aW9uRXJyb3JzLCBjb21waWxhdGlvbkVycm9ycyB9KTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGZsYXR0ZW48VD4obmVzdGVkQXJyYXk6IFRbXVtdKSB7XG4gIHJldHVybiBuZXN0ZWRBcnJheS5yZWR1Y2UoKHByZXZpb3VzVmFsdWU6IFRbXSwgY3VycmVudFZhbHVlOiBUW10pID0+IHtcbiAgICByZXR1cm4gcHJldmlvdXNWYWx1ZS5jb25jYXQoY3VycmVudFZhbHVlKTtcbiAgfSwgW10pO1xufVxuIl19
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc