• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript json.verifyObject函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中neuroglancer/util/json.verifyObject函数的典型用法代码示例。如果您正苦于以下问题:TypeScript verifyObject函数的具体用法?TypeScript verifyObject怎么用?TypeScript verifyObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了verifyObject函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: parseVertexAttributeInfo

function parseVertexAttributeInfo(x: any): VertexAttributeInfo {
  verifyObject(x);
  return {
    dataType: verifyObjectProperty(x, 'dataType', y => verifyEnumString(y, DataType)),
    numComponents: verifyObjectProperty(x, 'numComponents', verifyPositiveInt),
  };
}
开发者ID:janelia-flyem,项目名称:neuroglancer,代码行数:7,代码来源:frontend.ts


示例2: parseChannelNames

function parseChannelNames(stackStatsObj: any): string[] {
  verifyObject(stackStatsObj);

  return verifyObjectProperty(stackStatsObj, 'channelNames', channelNamesObj => {
    return parseArray(channelNamesObj, verifyString);
  });
}
开发者ID:google,项目名称:neuroglancer,代码行数:7,代码来源:frontend.ts


示例3: parseTokenInfo

function parseTokenInfo(obj: any): TokenInfo {
  verifyObject(obj);
  return {
    channels: verifyObjectProperty(obj, 'channels', x => verifyObjectAsMap(x, parseChannelInfo)),
    scales: verifyObjectProperty(obj, 'dataset', parseScales),
  };
}
开发者ID:funkey,项目名称:neuroglancer,代码行数:7,代码来源:frontend.ts


示例4: parseStackInfo

function parseStackInfo(obj: any): StackInfo|undefined {
  verifyObject(obj);

  let state = verifyObjectProperty(obj, 'state', verifyString);

  let channels: string[] = [];
  let lowerVoxelBound: vec3 = vec3.create();
  let upperVoxelBound: vec3 = vec3.create();

  if (VALID_STACK_STATES.has(state)) {
    let stackStatsObj = verifyObjectProperty(obj, 'stats', verifyObject);

    lowerVoxelBound = parseLowerVoxelBounds(stackStatsObj);
    upperVoxelBound = parseUpperVoxelBounds(stackStatsObj);

    if (stackStatsObj.hasOwnProperty('channelNames')) {
      channels = parseChannelNames(stackStatsObj);
    }
  } else if (PARTIAL_STACK_STATES.has(state)) {
    // Stacks in LOADING state will not have a 'stats' object.
    // Values will be populated from command arguments in MultiscaleVolumeChunkSource()
  } else {
    return undefined;
  }

  let voxelResolution: vec3 = verifyObjectProperty(obj, 'currentVersion', parseStackVersionInfo);

  let project: string = verifyObjectProperty(obj, 'stackId', parseStackProject);

  return {lowerVoxelBound, upperVoxelBound, voxelResolution, project, channels};
}
开发者ID:google,项目名称:neuroglancer,代码行数:31,代码来源:frontend.ts


示例5: constructor

 constructor(public baseUrls: string[], public path: string, private obj: any) {
   verifyObject(obj);
   this.dataType = verifyObjectProperty(obj, 'data_type', x => verifyEnumString(x, DataType));
   this.numChannels = verifyObjectProperty(obj, 'num_channels', verifyPositiveInt);
   this.volumeType = verifyObjectProperty(obj, 'type', x => verifyEnumString(x, VolumeType));
   this.mesh = verifyObjectProperty(obj, 'mesh', verifyOptionalString);
   this.scales = verifyObjectProperty(obj, 'scales', x => parseArray(x, y => new ScaleInfo(y)));
 }
开发者ID:funkey,项目名称:neuroglancer,代码行数:8,代码来源:frontend.ts


示例6: parseChannelInfo

function parseChannelInfo(obj: any): ChannelInfo {
  verifyObject(obj);
  let channelType = verifyObjectProperty(obj, 'channel_type', verifyString);
  return {
    channelType,
    description: verifyObjectProperty(obj, 'description', verifyString),
    volumeType: getVolumeTypeFromChannelType(channelType),
    dataType: verifyObjectProperty(obj, 'datatype', x => verifyEnumString(x, DataType)),
  };
}
开发者ID:funkey,项目名称:neuroglancer,代码行数:10,代码来源:frontend.ts


示例7: constructor

 constructor(obj: any) {
   verifyObject(obj);
   this.dataType = verifyObjectProperty(obj, 'dataType', x => verifyEnumString(x, DataType));
   this.size = verifyObjectProperty(
       obj, 'dimensions', x => parseFixedLengthArray(vec3.create(), x, verifyPositiveInt));
   this.chunkSize = verifyObjectProperty(
       obj, 'blockSize', x => parseFixedLengthArray(vec3.create(), x, verifyPositiveInt));
   this.encoding =
       verifyObjectProperty(obj, 'compressionType', x => verifyEnumString(x, VolumeChunkEncoding));
 }
开发者ID:google,项目名称:neuroglancer,代码行数:10,代码来源:frontend.ts


示例8: parseScaleInfo

function parseScaleInfo(obj: any): ScaleInfo {
  verifyObject(obj);
  return {
    key: verifyObjectProperty(obj, 'key', verifyString),
    offset: verifyObjectProperty(obj, 'offset', verify3dVec),
    sizeInVoxels: verifyObjectProperty(obj, 'sizeInVoxels', verify3dDimensions),
    voxelSize: verifyObjectProperty(obj, 'voxelSize', verify3dScale),
    chunkDataSize: verifyObjectProperty(
        obj, 'chunkDataSize', x => x === undefined ? undefined : verify3dDimensions(x)),
  };
}
开发者ID:funkey,项目名称:neuroglancer,代码行数:11,代码来源:frontend.ts


示例9: parseLowerVoxelBounds

function parseLowerVoxelBounds(stackStatsObj: any): vec3 {
  verifyObject(stackStatsObj);
  let stackBounds = verifyObjectProperty(stackStatsObj, 'stackBounds', verifyObject);

  let lowerVoxelBound: vec3 = vec3.create();

  lowerVoxelBound[0] = verifyObjectProperty(stackBounds, 'minX', verifyInt);
  lowerVoxelBound[1] = verifyObjectProperty(stackBounds, 'minY', verifyInt);
  lowerVoxelBound[2] = verifyObjectProperty(stackBounds, 'minZ', verifyInt);

  return lowerVoxelBound;
}
开发者ID:janelia-flyem,项目名称:neuroglancer,代码行数:12,代码来源:frontend.ts


示例10: parseUpperVoxelBounds

function parseUpperVoxelBounds(stackStatsObj: any): vec3 {
  verifyObject(stackStatsObj);
  let stackBounds = verifyObjectProperty(stackStatsObj, 'stackBounds', verifyObject);

  let upperVoxelBound: vec3 = vec3.create();

  upperVoxelBound[0] = verifyObjectProperty(stackBounds, 'maxX', verifyFloat)+1;
  upperVoxelBound[1] = verifyObjectProperty(stackBounds, 'maxY', verifyFloat)+1;
  upperVoxelBound[2] = verifyObjectProperty(stackBounds, 'maxZ', verifyFloat)+1;

  return upperVoxelBound;
}
开发者ID:google,项目名称:neuroglancer,代码行数:12,代码来源:frontend.ts



注:本文中的neuroglancer/util/json.verifyObject函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript json.verifyObjectAsMap函数代码示例发布时间:2022-05-25
下一篇:
TypeScript json.verifyEnumString函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap