@dolthub/web-utils 0.1.2 → 0.1.4

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.
package/dist/index.d.ts CHANGED
@@ -50,6 +50,125 @@ declare function fakeEscapePress(): void;
50
50
 
51
51
  declare function initialUppercase(s: string): string;
52
52
 
53
+ declare enum KeyCodes {
54
+ BACKSPACE = 8,
55
+ TAB = 9,
56
+ ENTER = 13,
57
+ SHIFT = 16,
58
+ CTRL = 17,
59
+ ALT = 18,
60
+ PAUSE = 19,
61
+ CAPS_LOCK = 20,
62
+ ESCAPE = 27,
63
+ SPACE = 32,
64
+ PAGE_UP = 33,
65
+ PAGE_DOWN = 34,
66
+ END = 35,
67
+ HOME = 36,
68
+ LEFT_ARROW = 37,
69
+ UP_ARROW = 38,
70
+ RIGHT_ARROW = 39,
71
+ DOWN_ARROW = 40,
72
+ INSERT = 45,
73
+ DELETE = 46,
74
+ KEY_0 = 48,
75
+ KEY_1 = 49,
76
+ KEY_2 = 50,
77
+ KEY_3 = 51,
78
+ KEY_4 = 52,
79
+ KEY_5 = 53,
80
+ KEY_6 = 54,
81
+ KEY_7 = 55,
82
+ KEY_8 = 56,
83
+ KEY_9 = 57,
84
+ KEY_A = 65,
85
+ KEY_B = 66,
86
+ KEY_C = 67,
87
+ KEY_D = 68,
88
+ KEY_E = 69,
89
+ KEY_F = 70,
90
+ KEY_G = 71,
91
+ KEY_H = 72,
92
+ KEY_I = 73,
93
+ KEY_J = 74,
94
+ KEY_K = 75,
95
+ KEY_L = 76,
96
+ KEY_M = 77,
97
+ KEY_N = 78,
98
+ KEY_O = 79,
99
+ KEY_P = 80,
100
+ KEY_Q = 81,
101
+ KEY_R = 82,
102
+ KEY_S = 83,
103
+ KEY_T = 84,
104
+ KEY_U = 85,
105
+ KEY_V = 86,
106
+ KEY_W = 87,
107
+ KEY_X = 88,
108
+ KEY_Y = 89,
109
+ KEY_Z = 90,
110
+ LEFT_META = 91,
111
+ RIGHT_META = 92,
112
+ SELECT = 93,
113
+ NUMPAD_0 = 96,
114
+ NUMPAD_1 = 97,
115
+ NUMPAD_2 = 98,
116
+ NUMPAD_3 = 99,
117
+ NUMPAD_4 = 100,
118
+ NUMPAD_5 = 101,
119
+ NUMPAD_6 = 102,
120
+ NUMPAD_7 = 103,
121
+ NUMPAD_8 = 104,
122
+ NUMPAD_9 = 105,
123
+ MULTIPLY = 106,
124
+ ADD = 107,
125
+ SUBTRACT = 109,
126
+ DECIMAL = 110,
127
+ DIVIDE = 111,
128
+ F1 = 112,
129
+ F2 = 113,
130
+ F3 = 114,
131
+ F4 = 115,
132
+ F5 = 116,
133
+ F6 = 117,
134
+ F7 = 118,
135
+ F8 = 119,
136
+ F9 = 120,
137
+ F10 = 121,
138
+ F11 = 122,
139
+ F12 = 123,
140
+ NUM_LOCK = 144,
141
+ SCROLL_LOCK = 145,
142
+ SEMICOLON = 186,
143
+ EQUALS = 187,
144
+ COMMA = 188,
145
+ DASH = 189,
146
+ PERIOD = 190,
147
+ FORWARD_SLASH = 191,
148
+ GRAVE_ACCENT = 192,
149
+ OPEN_BRACKET = 219,
150
+ BACK_SLASH = 220,
151
+ CLOSE_BRACKET = 221,
152
+ SINGLE_QUOTE = 222
153
+ }
154
+
155
+ declare const loremer: {
156
+ word: ({ trueSingleWord, minLength, maxLength, matchRegex, }?: {
157
+ trueSingleWord?: boolean | undefined;
158
+ matchRegex?: RegExp | undefined;
159
+ minLength?: number | undefined;
160
+ maxLength?: number | undefined;
161
+ }) => string;
162
+ words: (n: number) => string[];
163
+ resourceNameSegment: () => string;
164
+ sentence: (options?: {
165
+ max?: number | undefined;
166
+ min?: number | undefined;
167
+ }) => string;
168
+ sentences: (n: number) => string[];
169
+ paragraph: () => string;
170
+ };
171
+
53
172
  declare function nTimes<T>(n: number, operation: (...args: any[]) => T, args?: Parameters<typeof operation>): T[];
54
173
  declare function nTimesWithIndex<T>(n: number, operation: (n: number) => T): T[];
55
174
 
@@ -304,4 +423,4 @@ declare function usernameValidator(s: string): {
304
423
  detailedErrorMsg: string;
305
424
  };
306
425
 
307
- export { type Maybe, NULL_VALUE, Route, areTimeAgosEqual, compareArray, convertToSqlWithNewColNames, convertToSqlWithNewCols, convertToSqlWithNewCondition, convertToSqlWithOrderBy, convertToUTCDate, dedupe, emailValidator, enumKeys, excerpt, fakeEscapePress, formatNumber, formatToRoundedUsd, formatToUsd, getColumns, getDateMinusHours, getDateString, getDisplayValue, getDisplayValueForApi, getLongDateTimeString, getNow, getTableName, getTimeAgoString, getTimeWithSeconds, getUTCDateAndTimeString, getUTCDateString, getUTCNowDateString, getUTCTimeString, initialUppercase, isMultipleQueries, isMutation, isNullValue, makeQueryExecutable, nTimes, nTimesWithIndex, oneHour, parseSelectQuery, pluralize, prettyJSON, prettyJSONText, queryHasOrderBy, randomArrayItem, randomNum, removeColumnFromQuery, requireTableNameForSelect, safeJSONParse, tuplify, usernameValidator };
426
+ export { KeyCodes, type Maybe, NULL_VALUE, Route, areTimeAgosEqual, compareArray, convertToSqlWithNewColNames, convertToSqlWithNewCols, convertToSqlWithNewCondition, convertToSqlWithOrderBy, convertToUTCDate, dedupe, emailValidator, enumKeys, excerpt, fakeEscapePress, formatNumber, formatToRoundedUsd, formatToUsd, getColumns, getDateMinusHours, getDateString, getDisplayValue, getDisplayValueForApi, getLongDateTimeString, getNow, getTableName, getTimeAgoString, getTimeWithSeconds, getUTCDateAndTimeString, getUTCDateString, getUTCNowDateString, getUTCTimeString, initialUppercase, isMultipleQueries, isMutation, isNullValue, loremer, makeQueryExecutable, nTimes, nTimesWithIndex, oneHour, parseSelectQuery, pluralize, prettyJSON, prettyJSONText, queryHasOrderBy, randomArrayItem, randomNum, removeColumnFromQuery, requireTableNameForSelect, safeJSONParse, tuplify, usernameValidator };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dolthub/web-utils",
3
3
  "author": "DoltHub",
4
4
  "description": "A collection of utilities for building web applications",
5
- "version": "0.1.2",
5
+ "version": "0.1.4",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",
8
8
  "types": "dist/index.d.ts",
@@ -16,6 +16,7 @@
16
16
  ],
17
17
  "packageManager": "yarn@4.0.2",
18
18
  "scripts": {
19
+ "clean": "rm -rf dist && rm -rf .rollup.cache && rm -rf types && rm -rf tsconfig.tsbuildinfo && rm -rf .eslintcache",
19
20
  "compile": "tsc -b",
20
21
  "build": "rollup -c --bundleConfigAsCjs",
21
22
  "dbuild": "yarn compile && yarn build",
@@ -28,8 +29,8 @@
28
29
  "yalc:push": "yarn dbuild && yalc push"
29
30
  },
30
31
  "devDependencies": {
31
- "@babel/core": "^7.23.7",
32
- "@babel/preset-env": "^7.23.8",
32
+ "@babel/core": "^7.24.0",
33
+ "@babel/preset-env": "^7.24.0",
33
34
  "@babel/preset-typescript": "^7.23.3",
34
35
  "@rollup/plugin-commonjs": "^25.0.7",
35
36
  "@rollup/plugin-node-resolve": "^15.2.3",
@@ -37,13 +38,13 @@
37
38
  "@types/eslint": "^8",
38
39
  "@types/jest": "^29.5.11",
39
40
  "@types/rollup-plugin-peer-deps-external": "^2",
40
- "@typescript-eslint/eslint-plugin": "^6.18.1",
41
- "@typescript-eslint/parser": "^6.18.1",
41
+ "@typescript-eslint/eslint-plugin": "^7.1.0",
42
+ "@typescript-eslint/parser": "^6.20.0",
42
43
  "babel-jest": "^29.7.0",
43
- "eslint": "^8.56.0",
44
+ "eslint": "^8.57.0",
44
45
  "jest": "^29.7.0",
45
- "prettier": "^3.1.0",
46
- "rollup": "^4.9.4",
46
+ "prettier": "^3.2.4",
47
+ "rollup": "^4.12.0",
47
48
  "rollup-plugin-dts": "^6.1.0",
48
49
  "rollup-plugin-peer-deps-external": "^2.2.4",
49
50
  "rollup-plugin-terser": "^7.0.2",
@@ -58,7 +59,7 @@
58
59
  "url": "https://github.com/dolthub/react-library/issues"
59
60
  },
60
61
  "dependencies": {
61
- "node-sql-parser": "^4.17.0",
62
+ "node-sql-parser": "^4.18.0",
62
63
  "timeago.js": "^4.0.2"
63
64
  }
64
65
  }
@@ -1,20 +0,0 @@
1
- export { default as Maybe } from "./Maybe";
2
- export { default as compareArray } from "./compareArray";
3
- export { areTimeAgosEqual, getDateMinusHours, getDateString, getLongDateTimeString, getNow, getTimeAgoString, getTimeWithSeconds, getUTCDateAndTimeString, getUTCDateString, getUTCNowDateString, getUTCTimeString, oneHour, } from "./dateConversions";
4
- export { default as dedupe } from "./dedupe";
5
- export { default as enumKeys } from "./enumKeys";
6
- export { default as excerpt } from "./excerpt";
7
- export { default as fakeEscapePress } from "./fakeEscapePress";
8
- export { default as initialUppercase } from "./initialUppercase";
9
- export { default as nTimes, nTimesWithIndex } from "./nTimes";
10
- export { NULL_VALUE, getDisplayValue, getDisplayValueForApi, isNullValue, } from "./null";
11
- export { formatNumber, formatToRoundedUsd, formatToUsd } from "./numberFormat";
12
- export { convertToSqlWithNewColNames, convertToSqlWithNewCols, convertToSqlWithNewCondition, convertToSqlWithOrderBy, getColumns, getTableName, isMultipleQueries, isMutation, makeQueryExecutable, parseSelectQuery, queryHasOrderBy, removeColumnFromQuery, requireTableNameForSelect, } from "./parseSqlQuery";
13
- export { default as pluralize } from "./pluralize";
14
- export { default as prettyJSON, prettyJSONText } from "./prettyJSON";
15
- export { default as randomArrayItem } from "./randomArrayItem";
16
- export { default as randomNum } from "./randomNum";
17
- export { default as safeJSONParse } from "./safeJSONParse";
18
- export { default as tuplify } from "./tuplify";
19
- export { Route } from "./urlUtils";
20
- export { emailValidator, usernameValidator } from "./validators";
@@ -1,20 +0,0 @@
1
- export { default as Maybe } from "./Maybe";
2
- export { default as compareArray } from "./compareArray";
3
- export { areTimeAgosEqual, getDateMinusHours, getDateString, getLongDateTimeString, getNow, getTimeAgoString, getTimeWithSeconds, getUTCDateAndTimeString, getUTCDateString, getUTCNowDateString, getUTCTimeString, oneHour, } from "./dateConversions";
4
- export { default as dedupe } from "./dedupe";
5
- export { default as enumKeys } from "./enumKeys";
6
- export { default as excerpt } from "./excerpt";
7
- export { default as fakeEscapePress } from "./fakeEscapePress";
8
- export { default as initialUppercase } from "./initialUppercase";
9
- export { default as nTimes, nTimesWithIndex } from "./nTimes";
10
- export { NULL_VALUE, getDisplayValue, getDisplayValueForApi, isNullValue, } from "./null";
11
- export { formatNumber, formatToRoundedUsd, formatToUsd } from "./numberFormat";
12
- export { convertToSqlWithNewColNames, convertToSqlWithNewCols, convertToSqlWithNewCondition, convertToSqlWithOrderBy, getColumns, getTableName, isMultipleQueries, isMutation, makeQueryExecutable, parseSelectQuery, queryHasOrderBy, removeColumnFromQuery, requireTableNameForSelect, } from "./parseSqlQuery";
13
- export { default as pluralize } from "./pluralize";
14
- export { default as prettyJSON, prettyJSONText } from "./prettyJSON";
15
- export { default as randomArrayItem } from "./randomArrayItem";
16
- export { default as randomNum } from "./randomNum";
17
- export { default as safeJSONParse } from "./safeJSONParse";
18
- export { default as tuplify } from "./tuplify";
19
- export { Route } from "./urlUtils";
20
- export { emailValidator, usernameValidator } from "./validators";