@8ms/helpers 1.3.22 → 1.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
type CreateTable = {
|
|
2
2
|
datasetId: string;
|
|
3
|
+
datasetOptions?: object;
|
|
3
4
|
projectId?: string;
|
|
4
5
|
options?: object;
|
|
5
6
|
tableId: string;
|
|
@@ -7,5 +8,5 @@ type CreateTable = {
|
|
|
7
8
|
/**
|
|
8
9
|
* Create a Table if it doesn't already exist.
|
|
9
10
|
*/
|
|
10
|
-
declare const createTable: ({ datasetId, options, projectId, tableId }: CreateTable) => Promise<void>;
|
|
11
|
+
declare const createTable: ({ datasetId, datasetOptions, options, projectId, tableId }: CreateTable) => Promise<void>;
|
|
11
12
|
export default createTable;
|
|
@@ -5,10 +5,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const IsTableExists_1 = __importDefault(require("./IsTableExists"));
|
|
7
7
|
const getClient_1 = __importDefault(require("./getClient"));
|
|
8
|
+
const createDataset_1 = __importDefault(require("./createDataset"));
|
|
8
9
|
/**
|
|
9
10
|
* Create a Table if it doesn't already exist.
|
|
10
11
|
*/
|
|
11
|
-
const createTable = async ({ datasetId, options, projectId, tableId }) => {
|
|
12
|
+
const createTable = async ({ datasetId, datasetOptions, options, projectId, tableId }) => {
|
|
13
|
+
// Create the BigQuery table if it doesn't exist
|
|
14
|
+
await (0, createDataset_1.default)({
|
|
15
|
+
datasetId,
|
|
16
|
+
options: datasetOptions,
|
|
17
|
+
projectId,
|
|
18
|
+
});
|
|
12
19
|
const tableExists = await (0, IsTableExists_1.default)({
|
|
13
20
|
datasetId,
|
|
14
21
|
projectId,
|
package/package.json
CHANGED
package/string/getCapitalised.js
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
* https://stackoverflow.com/a/196991/2664955
|
|
6
6
|
*/
|
|
7
7
|
const getCapitalised = ({ input, split }) => {
|
|
8
|
-
const
|
|
8
|
+
const regex = new RegExp(split || '_', 'g');
|
|
9
9
|
return input
|
|
10
|
-
.replace(
|
|
10
|
+
.replace(regex, ' ')
|
|
11
11
|
.replace(/\w\S*/g, function (txt) {
|
|
12
12
|
return txt.charAt(0)
|
|
13
13
|
.toUpperCase() + txt.substr(1)
|