You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
however recently, this internal functionality has changed and is now done with the helpers/type-parser, so i could do:
import { parseTypeSyntax } from "prisma-json-types-generator/dist/helpers/type-parser.js";
// later...
isI18nField(field: { documentation?: string }) {
const match = parseTypeSyntax(field.documentation);
if (match) {
return match[1] === "I18n";
}
return false;
}
however:
- this is internal api and can therefore change
- since some version, prisma-json-types-generator no longer publishes the source code in the npm package, so this now yields a type error.
It would therefore be good to properly export this function so library user can consume it including correct type information
The text was updated successfully, but these errors were encountered:
macrozone
changed the title
export some utility
export parseTypeSyntax utility
Feb 17, 2025
I need to parse the field-documentation identically to how prisma-json-types-generator is parsing it.
I used to import the internal JSON_REGEX:
however recently, this internal functionality has changed and is now done with the
helpers/type-parser
, so i could do:// later...
isI18nField(field: { documentation?: string }) {
const match = parseTypeSyntax(field.documentation);
}
The text was updated successfully, but these errors were encountered: