class-validator#isObject TypeScript Examples

The following examples show how to use class-validator#isObject. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: data_source.ts    From Deep-Lynx with MIT License 6 votes vote down vote up
@IsObject()
    ifc_settings: {
        format: string;
        data_level: string;
        component_level: boolean;
        log_detail: number;
        arc_tolerance: string;
        tube: boolean;
        cl: boolean;
        insu_translucency: number;
        obst_translucency: number;
        root: number;
        pipe: number;
        nozzle: number;
        structure: number;
        cable: number;
    } = {
        format: 'IFC2x3',
        data_level: 'GA',
        component_level: true,
        log_detail: 2,
        arc_tolerance: '10mm',
        tube: true,
        cl: false,
        insu_translucency: 25,
        obst_translucency: 50,
        root: 6,
        pipe: 6,
        nozzle: 6,
        structure: 6,
        cable: 6,
    };
Example #2
Source File: metatype_relationship_key.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    @IsOptional()
    validation?: {
        regex: string;
        min: number;
        max: number;
    };
Example #3
Source File: classes.ts    From epicgames-freegames-node with MIT License 5 votes vote down vote up
/**
   * Node HTTPS.createServer options: https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
   */
  @IsOptional()
  @IsObject()
  serverOpts?: ServerOptions;
Example #4
Source File: call-current-project.dto.ts    From etherspot-sdk with MIT License 5 votes vote down vote up
@IsOptional()
  @IsObject()
  payload?: any = null;
Example #5
Source File: rsa.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    challengeMethods: {
        challenges: Challenge[];
    } = {
        challenges: [new Challenge()],
    };
Example #6
Source File: edge.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    properties: object = {};
Example #7
Source File: file.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    @IsOptional()
    metadata: object = {};
Example #8
Source File: node.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    properties: object = {};
Example #9
Source File: metatype_key.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    @IsOptional()
    validation?: {
        regex: string;
        min?: number;
        max?: number;
    };
Example #10
Source File: classes.ts    From epicgames-freegames-node with MIT License 5 votes vote down vote up
/**
   * Node Net.listen options: https://nodejs.org/api/net.html#net_server_listen_options_callback
   * @default { port: 3000 }
   * @env SERVER_PORT (for `{port: SERVER_PORT}` only)
   */
  @IsOptional()
  @IsObject()
  listenOpts?: ListenOptions;
Example #11
Source File: event_action.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    action_config?: object = {};
Example #12
Source File: gremlin_export_impl.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    properties: object = {};
Example #13
Source File: gremlin_export_impl.ts    From Deep-Lynx with MIT License 5 votes vote down vote up
@IsObject()
    properties: object = {};
Example #14
Source File: auth-token.model.ts    From relate with GNU General Public License v3.0 5 votes vote down vote up
@IsOptional()
    @IsObject()
    parameters?: {[key: string]: any};
Example #15
Source File: manifest.model.ts    From relate with GNU General Public License v3.0 5 votes vote down vote up
@IsOptional()
    @IsObject()
    public metadata: Record<string, any> = {};
Example #16
Source File: relate-backup.model.ts    From relate with GNU General Public License v3.0 5 votes vote down vote up
@IsObject()
    public entityMeta!: any;
Example #17
Source File: index.ts    From office-hours with GNU General Public License v3.0 5 votes vote down vote up
@IsObject()
  payload!: AlertPayload;
Example #18
Source File: ParametersValidator.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
static validatePrimitive(schema: string, value: any) {
    let message: string
    let isValid: boolean = true

    switch (schema) {
      case did:
        isValid = matches(value, DID)
        message = `Parameter "${value}" is not a valid. Valid format: (${DID}).`
        break

      case didMethod:
        isValid = matches(value, DID_METHOD)
        message = `Parameter "${value}" is not a valid. Valid format: (${DID_METHOD}).`
        break

      case jwt:
        isValid = matches(value, JWT)
        message = `Parameter "${value}" is not a valid JWT. Valid format: (${JWT}).`
        break

      case array:
        isValid = isArray(value)
        message = `Parameter "${value}" should be an array.`
        break

      case number:
        isValid = isNumber(value)
        message = `Parameter "${value}" should be a number.`
        break

      case object:
        isValid = isObject(value)
        message = `Parameter "${value}" should be an object.`
        break

      case string:
        isValid = isString(value)
        message = `Parameter "${value}" should be a string.`
        break

      case boolean:
        isValid = isBoolean(value)
        message = `Parameter "${value}" should be a boolean.`
        break

      case isoString:
        isValid = isISO8601(value)
        message = `Parameter "${value}" is not a valid ISO 8601 date string.`
        break

      case confirmationCode:
        isValid = matches(value, COGNITO_CONFIRMATION_CODE)
        message = `Parameter "${value}" is not a valid confirmation code. Valid format: (${COGNITO_CONFIRMATION_CODE}).`
        break

      case password:
        isValid = matches(value, PASSWORD)
        message = `Parameter "${value}" is not a password. Valid format: (${PASSWORD}).`
        break
    }

    return { isValid, message }
  }
Example #19
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsOptional()
  @IsObject()
  credentialSchema?: unknown
Example #20
Source File: whisp-attachment.input.ts    From whispr with MIT License 5 votes vote down vote up
@Field()
  @Type(() => WhispFileUpload)
  @IsObject()
  file: WhispFileUpload;
Example #21
Source File: whisp.input.ts    From whispr with MIT License 5 votes vote down vote up
@Field(() => GraphQLJSONObject, { nullable: true })
  @IsObject()
  @IsOptional()
  data?: any;
Example #22
Source File: whisp.input.ts    From whispr with MIT License 5 votes vote down vote up
@Field(() => [WhispAttachmentInput], { nullable: true })
  @IsObject({ each: true })
  @IsOptional({ each: true })
  @ValidateNested({ each: true })
  @Type(() => WhispAttachmentInput)
  attachments?: WhispAttachmentInput[];
Example #23
Source File: whisp.input.ts    From whispr with MIT License 5 votes vote down vote up
@Field(() => [TagInputType], { nullable: true })
  @IsObject()
  @IsOptional()
  tags?: TagInputType[];
Example #24
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsDefined()
  @IsObject()
  credentialSubject: unknown
Example #25
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
// legacy attributes - to be deleted after support is dropped
  @IsOptional()
  @IsObject()
  claim?: unknown
Example #26
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsDefined()
  @IsObject()
  proof: Proof
Example #27
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsOptional()
  @IsObject()
  credentialStatus?: unknown
Example #28
Source File: webhook.input.ts    From whispr with MIT License 5 votes vote down vote up
@Field(() => GraphQLJSONObject, { nullable: true })
  @IsOptional()
  @IsObject()
  filter: Record<string, unknown>;
Example #29
Source File: shared.dto.ts    From affinidi-core-sdk with Apache License 2.0 5 votes vote down vote up
@IsOptional()
  @IsObject()
  refreshService?: unknown