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
import { dasherize, camelize, capitalize, classify, decamelize, loc, underscore, w } from '@ember/string';
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
loc(); // $ExpectError
loc("_Hello World"); // $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
loc(); // $ExpectError
loc("_Hello World"); // $ExpectType string
loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string
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
loc(); // $ExpectError
loc("_Hello World"); // $ExpectType string
loc("_Hello %@ %@", ["John", "Smith"]); // $ExpectType string
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
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
if(display) {
var valueParts = [];
var parts = display.split(' ');
var endIndex = 0;
var startIndex = 0;
for(var i=0;i
_getLines() {
const lines = [];
const numLines = this.get('lines');
const text = this.get('text') || '';
const textToTruncate = isHTMLSafe(text) ? this._unescapeText(text) : text;
const formattedText = this.stripText ? this._stripBrTags(textToTruncate) : this._convertBrTags(textToTruncate);
const textLines = formattedText.split('\n').map(line => line.trim().split(' '));
let didTruncate = true;
const ellipsisWidth = this._getEllipsisWidth();
for (let line = 1; line <= numLines; line += 1) {
const textWords = textLines[0];
// handle new line -- ???
if (textWords.length === 0) {
lines.push({
newLine: true,
});
textLines.shift();
line -= 1;
return !emojiDefs[`${id}_tone${anotherTone}`];
});
return A(emoji);
});
}
export default Service.extend({
emojiDefs,
categories: A([
O({id: "people", name: "Smileys & People", icon: htmlSafe(":grinning:")}),
O({id: "nature", name: "Animals & Nature", icon: htmlSafe(":deciduous_tree:")}),
O({id: "food", name: "Food & Drink", icon: htmlSafe(":pizza:")}),
O({id: "activity", name: "Activity", icon: htmlSafe(":cartwheel:")}),
O({id: "travel", name: "Travel & Places", icon: htmlSafe(":ship:")}),
O({id: "objects", name: "Objects", icon: htmlSafe(":hammer:")}),
O({id: "symbols", name: "Symbols", icon: htmlSafe(":heart:")}),
O({id: "flags", name: "Flags", icon: htmlSafe(":flag_aq:")}),
// "regional",
// "modifier",
]),
emojiCategoryIds: EMOJI_CATEGORIES_ARRAY,
emojiToneIds: EMOJI_TONES_ARRAY,
_currentSkinTone: 'default',
currentSkinTone: computed('_currentSkinTone', {
get() {
return this.get('_currentSkinTone');
},
export default function(name, opts) {
opts = opts || {};
const container = Discourse.__container__;
// We use the container here because modals are like singletons
// in Discourse. Only one can be shown with a particular state.
const route = container.lookup("route:application");
const modalController = route.controllerFor("modal");
modalController.set("modalClass", opts.modalClass);
const controllerName = opts.admin ? `modals/${name}` : name;
modalController.set("name", controllerName);
let controller = container.lookup("controller:" + controllerName);
const templateName = opts.templateName || dasherize(name);
const renderArgs = { into: "modal", outlet: "modalBody" };
if (controller) {
renderArgs.controller = controllerName;
} else {
// use a basic controller
renderArgs.controller = "basic-modal-body";
controller = container.lookup(`controller:${renderArgs.controller}`);
}
if (opts.addModalBodyView) {
renderArgs.view = "modal-body";
}
const modalName = `modal/${templateName}`;
const fullName = opts.admin ? `admin/templates/${modalName}` : modalName;