當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。