MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / quote

Method quote

packages/entity-generator/src/SourceFile.ts:376–380  ·  view source on GitHub ↗
(val: string)

Source from the content-addressed store, hash-verified

374 }
375
376 protected quote(val: string) {
377 const backtick = val.startsWith(`'`) || val.includes('\n');
378 /* v8 ignore next */
379 return backtick ? `\`${val.replaceAll('`', '\\``')}\`` : `'${val.replaceAll(`'`, `\\'`)}'`;
380 }
381
382 protected getPropertyDefinition(prop: EntityProperty, padLeft: number): string {
383 const padding = ' '.repeat(padLeft);

Callers 15

getColumnOptionsMethod · 0.95
getIndexOptionsMethod · 0.95
getUniqueOptionsMethod · 0.95
generateImportsMethod · 0.95
getPropertyDefinitionMethod · 0.95
formatValueMethod · 0.95
serializeObjectMethod · 0.95
getEntityDeclOptionsMethod · 0.95
getPartitionByDeclMethod · 0.95
getCollectionDeclMethod · 0.95
processIndexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected