本文整理汇总了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
}
示例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)
}
示例3: authors
export async function readPackageJson(file: string): Promise<any> {
const data = await readJson(file)
await authors(file, data)
normalizeData(data)
return data
}