本文整理匯總了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)