mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added datatables library to safelist
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
"References": {
|
||||
"match": "^(.*\\/_references\\.js)$",
|
||||
"exclude": [["^", 1, "$"]]
|
||||
},
|
||||
"Datatables.net": {
|
||||
"match": "(jquery\\.)*dataTables(\\.all)*(\\.min)*\\.js$",
|
||||
"types": ["datatables.net"]
|
||||
}
|
||||
},
|
||||
"simpleMap": {
|
||||
|
||||
Reference in New Issue
Block a user