本文整理匯總了TypeScript中vs/workbench/parts/files/browser/fileActions.validateFileName函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript validateFileName函數的具體用法?TypeScript validateFileName怎麽用?TypeScript validateFileName使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了validateFileName函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('Validate File Name (For Rename)', function () {
const d = new Date().getTime();
const s = createStat('/path/to/stat', 'sName', true, true, 8096, d);
const sChild = createStat('/path/to/stat/alles.klar', 'alles.klar', true, true, 8096, d);
s.addChild(sChild);
assert(validateFileName(s, 'alles.klar') !== null);
if (isLinux) {
assert(validateFileName(s, 'Alles.klar') === null);
assert(validateFileName(s, 'Alles.Klar') === null);
} else {
assert(validateFileName(s, 'Alles.klar') !== null);
assert(validateFileName(s, 'Alles.Klar') !== null);
}
assert(validateFileName(s, '.foo') === null);
assert(validateFileName(s, 'foo.bar') === null);
assert(validateFileName(s, 'foo') === null);
});
示例2: test
test("Validate File Name (For Rename)", function() {
let d = new Date().getTime();
let s = createStat("/path/to/stat", "sName", true, true, 8096, d, "text/plain");
let sChild = createStat("/path/to/stat/alles.klar", "alles.klar", true, true, 8096, d, "text/plain");
s.addChild(sChild);
assert(validateFileName(s, "alles.klar") !== null);
if (isLinux) {
assert(validateFileName(s, "Alles.klar") === null);
assert(validateFileName(s, "Alles.Klar") === null);
} else {
assert(validateFileName(s, "Alles.klar") !== null);
assert(validateFileName(s, "Alles.Klar") !== null);
}
assert(validateFileName(s, ".foo") === null);
assert(validateFileName(s, "foo.bar") === null);
assert(validateFileName(s, "foo") === null);
});