Skip to content

Commit

Permalink
feat: typeorm big filename
Browse files Browse the repository at this point in the history
  • Loading branch information
radiorz committed Mar 2, 2024
1 parent 5385430 commit fdabd85
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 16 additions & 0 deletions snippets/file_name_big_camel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { TYPES } = require("../src/common/consts/types");
const body = "${TM_FILENAME_BASE/(\\w+)\\.(.*)/${1:/capitalize}/}";
const description = "";

module.exports = {
prefix: ["!File"],
type: [
TYPES.javascript,
TYPES.typescript,
TYPES.javascriptreact,
TYPES.typescriptreact,
],
description: description || body,
origin: body,
body: body.trim(),
};
5 changes: 3 additions & 2 deletions snippets/typeorm_entity.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const { origin: fileName } = require("./file_name_big_camel");
const { TYPES } = require("../src/common/consts/types");
const { origin: fileName } = require("./file_name");

const body = `
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
import { IsNotEmpty, IsOptional } from 'class-validator';
@Entity()
export class ${fileName} {
export class \${1:${fileName}} {
@PrimaryGeneratedColumn()
id: number;
Expand Down

0 comments on commit fdabd85

Please sign in to comment.