本文整理汇总了TypeScript中lodash/isString.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: NormalSource
it('returns string handles', () => {
const source = new NormalSource()
const sourceId = registry.addSource(Types.FOO, source)
const targetA = new NormalTarget()
const targetAId = registry.addTarget(Types.FOO, targetA)
const targetB = new NormalTarget()
const targetBId = registry.addTarget([Types.FOO, Types.BAR], targetB)
expect(isString(sourceId)).toEqual(true)
expect(isString(targetAId)).toEqual(true)
expect(isString(targetBId)).toEqual(true)
})
示例2: guessFieldTypeFromValue
export function guessFieldTypeFromValue(v: any): FieldType {
if (isNumber(v)) {
return FieldType.number;
}
if (isString(v)) {
if (NUMBER.test(v)) {
return FieldType.number;
}
if (v === 'true' || v === 'TRUE' || v === 'True' || v === 'false' || v === 'FALSE' || v === 'False') {
return FieldType.boolean;
}
return FieldType.string;
}
if (isBoolean(v)) {
return FieldType.boolean;
}
if (v instanceof Date || isDateTime(v)) {
return FieldType.time;
}
return FieldType.other;
}
示例3: isString
toFindQueryResult(x) {
return isString(x) ? { text: x, expandable: true } : { ...x, expandable: true };
}
示例4: isString
mode: (mode) => isString(mode) && allowedModes.includes(mode),
示例5: invariant
const checkKey = (key) => invariant(
isString(key) && !isEmpty(key),
'(app/utils...) injectSaga: Expected `key` to be a non empty string'
);