Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
loc(); // $ExpectError
loc("_Hello World"); // $ExpectType string
loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string
// posting on another user's profile
if (get(this, 'user') !== undefined && get(this, 'user.id') !== get(this, 'session.account.id')) {
set(data, 'targetUser', get(this, 'user'));
}
// posting on an interest feed
if (get(this, 'streamInterest') !== undefined) {
set(data, 'targetInterest', classify(get(this, 'streamInterest')));
}
// posting on a group
if (get(this, 'kitsuGroup') !== undefined) {
set(data, 'targetGroup', get(this, 'kitsuGroup'));
}
// spoiler + media set
if (get(data, 'media') !== undefined && isEmpty(get(options, 'unitNumber')) === false) {
const media = get(data, 'media');
const mediaType = capitalize(get(media, 'modelType'));
const unitType = mediaType === 'Anime' ? 'episode' : 'chapter';
const number = get(options, 'unitNumber');
let filter;
if (mediaType === 'Anime') {
filter = {
mediaType,
number,
media_id: get(media, 'id')
};
} else {
filter = { manga_id: get(media, 'id'), number };
}
const units = yield get(this, 'queryCache').query(unitType, { filter });
const unit = get(units, 'firstObject');
if (unit) {
set(data, 'spoiledUnit', unit);
_getFilters({ language }) {
const controller = this.controllerFor(get(this, 'routeName'));
const availableLanguages = get(controller, 'availableLanguages');
// If it's empty then don't filter by language at all. Shouldn't happen tho.
if (isEmpty(availableLanguages)) { return {}; }
return { language: capitalize(language || get(controller, 'language')) };
},
summaryForCard(cardName, payload) {
// TODO probably we should show a thumbnail for cardstack-image cards
if (cardName === 'cs-mobiledoc-card') {
return { text: capitalize(payload.type.replace(/^cardstack-/, '')) };
}
return { text: capitalize(cardName.replace(/-card$/, '')) };
}
state: computed('taskInstance.state', function() {
return capitalize(this.get('taskInstance.state'));
}),
hasStarted: false,
routes = routes.map(r => {
let name = r.replace(`${thisName}.`, '');
name = capitalize(dasherize(name).replace(/-/g, ' '));
return {name: name, route: r};
});
controller.set('routes', routes);
getDescriptionFor(key = '') {
return capitalize(dasherize(key).split(/[_-]/g).join(' '));
}
});
function() {
let klass = this.get(classKey);
let showInternal = this.get('showInternal');
let showInherited = this.get('showInherited');
let showProtected = this.get('showProtected');
let showPrivate = this.get('showPrivate');
let showDeprecated = this.get('showDeprecated');
let members = [];
if (showInternal === false && memberType !== 'arguments') {
return members;
}
let capitalKey = capitalize(memberType);
let publicMembers = showInherited ? klass.get(`allPublic${capitalKey}`) : klass.get(`public${capitalKey}`);
let privateMembers = showInherited ? klass.get(`allPrivate${capitalKey}`) : klass.get(`private${capitalKey}`);
let protectedMembers = showInherited ? klass.get(`allProtected${capitalKey}`) : klass.get(`protected${capitalKey}`);
members.push(...publicMembers);
if (showPrivate) {
members.push(...privateMembers);
}
if (showProtected) {
members.push(...protectedMembers);
}
toggleUsage(usageType) {
let usageProperty = `emberFreestyle.show${capitalize(usageType)}`;
this.toggleProperty(usageProperty);
},
setFocus() {
stringToFacetOption(facetValue: string): ISearchFacetOption {
return {
value: facetValue,
label: capitalize(facetValue),
count: 0
};
}