当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript normalize-package-data.default函数代码示例

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


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

示例1: authors

export async function readPackageJson(file: string): Promise<any> {
  const data = await readJson(file)
  await authors(file, data)
  normalizeData(data)
  // remove not required fields because can be used for remote build
  delete data.scripts
  delete data.readme
  return data
}
开发者ID:electron-userland,项目名称:electron-builder,代码行数:9,代码来源:packageMetadata.ts

示例2: Error

  /**
   *
   *
   * Constructor
   *
   *
   */
  constructor(
    public options: PuppetOptions,
  ) {
    super()
    log.verbose('Puppet', 'constructor(%s)', JSON.stringify(options))

    this.counter = PUPPET_COUNTER++

    this.state    = new StateSwitch(this.constructor.name, log)

    this.options.timeout = this.options.timeout || DEFAULT_WATCHDOG_TIMEOUT

    log.verbose('Puppet', 'constructor() watchdog timeout set to %d seconds', this.options.timeout)
    this.watchdog = new Watchdog(1000 * this.options.timeout, 'Puppet')

    const lruOptions: LRU.Options = {
      max: 10000,
      // length: function (n) { return n * 2},
      dispose: function (key: string, val: Object) {
        log.silly('Puppet', 'constructor() lruOptions.dispose(%s, %s)', key, JSON.stringify(val))
      },
      maxAge: 1000 * 60 * 60,
    }

    this.cacheContactPayload       = new LRU<string, ContactPayload>(lruOptions)
    this.cacheFriendshipPayload = new LRU<string, FriendshipPayload>(lruOptions)
    this.cacheMessagePayload       = new LRU<string, MessagePayload>(lruOptions)
    this.cacheRoomPayload          = new LRU<string, RoomPayload>(lruOptions)
    this.cacheRoomMemberPayload    = new LRU<string, RoomMemberPayload>(lruOptions)

    /**
     * 2. Load the package.json for Puppet Plugin version range matching
     *
     * For: dist/src/puppet/puppet.ts
     *  We need to up 3 times: ../../../package.json
     */
    try {
      const childClassPath = callerResolve('.', __filename)
      log.verbose('Puppet', 'constructor() childClassPath=%s', childClassPath)

      this.childPkg = readPkgUp.sync({ cwd: childClassPath }).pkg
    } finally {
      if (!this.childPkg) {
        throw new Error('Cannot found package.json for Puppet Plugin Module')
      }
    }
    normalize(this.childPkg)
  }
开发者ID:miggame,项目名称:wechaty,代码行数:55,代码来源:puppet.ts

示例3: authors

export async function readPackageJson(file: string): Promise<any> {
  const data = await readJson(file)
  await authors(file, data)
  normalizeData(data)
  return data
}
开发者ID:Icenium,项目名称:electron-builder,代码行数:6,代码来源:readPackageJson.ts


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