本文整理匯總了TypeScript中@bokehjs/core/util/object.keys函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript keys函數的具體用法?TypeScript keys怎麽用?TypeScript keys使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了keys函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("match between Python and bokehjs", () => {
let fail_count = 0
const all_view_model_names = concat([keys(models_defaults), keys(widget_defaults)])
for (const name of all_view_model_names) {
const model = Models(name)
const instance = new model({__deferred__: true})
const attrs = instance.attributes_as_json(true, deep_value_to_json)
strip_ids(attrs)
const python_defaults = get_defaults(name)
const bokehjs_defaults = attrs
if (!check_matching_defaults(name, python_defaults, bokehjs_defaults)) {
console.log(name)
// console.log('python defaults:')
// console.log(python_defaults)
// console.log('bokehjs defaults:')
// console.log(bokehjs_defaults)
console.log(difference(keys(python_defaults), keys(bokehjs_defaults)))
fail_count += 1
}
}
console.error(`Python/bokehjs matching defaults problems: ${fail_count}`)
expect(fail_count).to.equal(0)
})
示例2: expect
it.skip("have all non-Widget view models from Python in the Models object", () => {
const missing = []
for (const name of keys(models_defaults)) {
if (!(name in Models.registered_names())) {
missing.push(name)
}
}
for (const m of missing) {
console.log(`'Models.${m}' not found but there's a Python model '${m}'`)
}
expect(missing.length).to.equal(0)
})
示例3: it
it("should update if columns update", () => {
const r = new ColumnDataSource({data: {foo: [10, 20], bar:[10, 20]}})
r.data.baz = [11, 21]
expect(r.columns()).to.be.deep.equal(keys(r.data))
})
示例4: it
it("should have only id property", () => {
const obj = new TestModel()
expect(keys(obj.properties)).to.be.deep.equal(['id'])
expect(keys(obj.attributes)).to.be.deep.equal(['id'])
})
示例5: it
it("should have 3 entries", () => {
expect(keys(tmpl.DEFAULT_FORMATTERS).length).to.be.equal(3)
})