Added datatables library to safelist

This commit is contained in:
Armando Aguirre
2018-01-30 10:22:29 -08:00
parent 6fadd4888d
commit cd12c8b63b
3 changed files with 24 additions and 2 deletions
+15 -2
View File
@@ -1541,14 +1541,27 @@ namespace ts.projectSystem {
path: "/scripts/Office/1/powerpoint.js",
content: "unspecified"
};
const files = [file1, minFile, kendoFile1, kendoFile2, kendoFile3, officeFile1, officeFile2];
const datatablesFile1 = {
path: "/js/jquery.datatables.js",
content: "unspecified"
};
const datatablesFile2 = {
path: "/js/datatables.js",
content: "unspecified"
};
const datatablesFile3 = {
path: "/js/datatables.all.min.js",
content: "unspecified"
};
const files = [file1, minFile, kendoFile1, kendoFile2, kendoFile3, officeFile1, officeFile2, datatablesFile1, datatablesFile2, datatablesFile3];
const host = createServerHost(files);
const projectService = createProjectService(host);
try {
projectService.openExternalProject({ projectFileName: "project", options: {}, rootFiles: toExternalFiles(files.map(f => f.path)) });
const proj = projectService.externalProjects[0];
assert.deepEqual(proj.getFileNames(/*excludeFilesFromExternalLibraries*/ true), [file1.path]);
assert.deepEqual(proj.getTypeAcquisition().include, ["kendo-ui", "office"]);
assert.deepEqual(proj.getTypeAcquisition().include, ["kendo-ui", "office", "datatables.net"]);
} finally {
projectService.resetSafeList();
}
+5
View File
@@ -158,6 +158,11 @@ namespace ts.server {
"References": {
match: /^(.*\/_references\.js)$/i,
exclude: [["^", 1, "$"]]
},
"Datatables.net": {
// e.g. /wwwroot/lib/datatables.all.min.js
match: /(jquery\.)*dataTables(\.all)*(\.min)*\.js$/i,
types: ["datatables.net"]
}
};
+4
View File
@@ -22,6 +22,10 @@
"References": {
"match": "^(.*\\/_references\\.js)$",
"exclude": [["^", 1, "$"]]
},
"Datatables.net": {
"match": "(jquery\\.)*dataTables(\\.all)*(\\.min)*\\.js$",
"types": ["datatables.net"]
}
},
"simpleMap": {