Nature's Powerful Meme

    @vmojs/decorator
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.17 • Public • Published

    @vmojs/decorator

    Using TypeScript MIT License

    Usage example

    import { Vmo } from "@vmojs/decorator";
    
    @Vmo()
    export class PageParams {
      constructor(data: any) {}
    
      @Vmo()
      type?: string;
    
      // subType2 => subType
      @Vmo("subType2")
      subType?: string;
    
      @Vmo(({ type, subType }) => `${type}_${subType}`)
      finalType?: string;
    }
    
    new PageParams({ type: "Type1", subType2: "SubType" });
    
    /**
     * =>
     * 
     * {
     *    type: "Type1",
     *    subType: "SubType",
     *    finalType: "Type1_SubType"
     * }
     * 
     * */

    Keywords

    none

    Install

    npm i @vmojs/decorator

    DownloadsWeekly Downloads

    3

    Version

    1.0.17

    License

    ISC

    Unpacked Size

    19.9 kB

    Total Files

    10

    Last publish

    Collaborators

    • xiaobe