本文整理匯總了TypeScript中@ember/string.camelize函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript camelize函數的具體用法?TypeScript camelize怎麽用?TypeScript camelize使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了camelize函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: isSafeTest
function isSafeTest(a: string | SafeString) {
if (isHTMLSafe(a)) {
a = a.toString();
}
camelize(a);
}
示例2: dasherize
import { dasherize, camelize, capitalize, classify, decamelize, htmlSafe, loc, underscore, w, isHTMLSafe } from '@ember/string';
import { SafeString } from '@ember/string/-private/handlebars';
dasherize(); // $ExpectError
dasherize('blue man group'); // $ExpectType string
dasherize('', ''); // $ExpectError
camelize(); // $ExpectError
camelize('blue man group'); // $ExpectType string
camelize('', ''); // $ExpectError
decamelize(); // $ExpectError
decamelize('blue man group'); // $ExpectType string
decamelize('', ''); // $ExpectError
underscore(); // $ExpectError
underscore('blue man group'); // $ExpectType string
underscore('', ''); // $ExpectError
w(); // $ExpectError
w('blue man group'); // $ExpectType string[]
w('', ''); // $ExpectError
classify(); // $ExpectError
classify('blue man group'); // $ExpectType string
classify('', ''); // $ExpectError
capitalize(); // $ExpectError
capitalize('blue man group'); // $ExpectType string
capitalize('', ''); // $ExpectError
示例3: pluralize
const collectionNameForType = (type: any) => pluralize(camelize(typeof(type) === 'string' ? type : type.modelName));