INNER CODE UNIT · TypeScript

endWithSlash

baizunxian/zerorunner · frontend/src/components/monaco/nls/index.ts:203

function endWithSlash(path) {
    if (path.charAt(path.length - 1) === '/') {
        return path;
    }
    return path + '/';
}
function getMessagesFromTranslationsService(translationServiceUrl, language, name) {
    return __awaiter(this, void 0, void 0, function* () {
        const url = endWithSlash(translationServiceUrl) + endWithSlash(language) + 'vscode/' + endWithSlash(name);
        const res = yield fetch(url);
        if (res.ok) {
            const messages = yield res.json();
            return messages;
        }
        throw new Error(\`\${res.status} - \${res.statusText}\`);
    });
}
function createScopedLocalize(scope) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…