UNPKG
@wbce-d9/schema
Version:
latest (10.0.0)
10.0.0
9.26.4
9.26.3
Utility for extracting information about existing DB schema
directus.io
LaWebcapsule/directus9
@wbce-d9/schema
/
dist
/
utils
/
extract-type.js
8 lines
(7 loc)
•
197 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
/** * Extracts the type out of a given datatype * For example: `varchar(32)` => varchar */
export
default
function
extractType
(
type
) {
return
type
.
replace
(
/[^a-zA-Z]/g
,
''
).
toLowerCase
(); }