本文整理汇总了TypeScript中lodash.isString函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isString函数的具体用法?TypeScript isString怎么用?TypeScript isString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isString函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: isString
userSchema.path('location').validate((location: string) => {
return isString(location) && isLength(location, 0, 100);
}, 'Location must not be longer than 100 characters.');
示例2:
buildSchema.path('label').validate((label: any) => {
return validator.isLength(isString(label) ? label.trim() : '', 3);
}, 'Label must contain at least three characters.');
示例3: isDate
buildSchema.path('built_at').validate((dateString: any) => {
return isDate(dateString) || (isString(dateString) && validator.isISO8601(dateString));
}, 'Date must be a string parsable by Javascript.');
示例4: isString
tagSchema.path('name').validate((name: any) => {
return isString(name) && validator.isLength(name ? name.trim() : '', 2);
}, 'Name must contain at least two characters.');
示例5: getPrometheusTime
getPrometheusTime(date, roundUp) {
if (_.isString(date)) {
date = dateMath.parse(date, roundUp);
}
return Math.ceil(date.valueOf() / 1000);
}
示例6: convertToCloudWatchTime
convertToCloudWatchTime(date, roundUp) {
if (_.isString(date)) {
date = dateMath.parse(date, roundUp);
}
return Math.round(date.valueOf() / 1000);
}
示例7: getTime
getTime(date, roundUp) {
if (_.isString(date)) {
date = dateMath.parse(date, roundUp);
}
return Math.ceil(date.valueOf() * 1e6);
}
示例8: setTimeout
setTimeout(() => {
elem.toggleClass('dashboard-page--settings-open', _.isString(newValue));
}, 10);
示例9:
const isCorrectType = bound =>
_.isString(bound) || _.isNull(bound) || _.isInteger(bound)