Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libraries.js: Alternative Code #4745

Open
erosman opened this issue Mar 8, 2023 · 0 comments
Open

libraries.js: Alternative Code #4745

erosman opened this issue Mar 8, 2023 · 0 comments

Comments

@erosman
Copy link
Contributor

erosman commented Mar 8, 2023

This is an alternative way to code the same (half the number of lines, and maybe easier to maintain).

If it is beneficial, I can create a PR. Otherwise you can close it.

const LIBRARIES = {
  "angularjs": {
    "id": "angular",
    "versions": [
      "1.0.2",
      "1.0.3",
      "1.0.4",
      "1.0.5",
      "1.0.6",
      "1.0.7",
      "1.0.8",
      "1.1.0",
      "1.1.1",
      "1.1.2",
      "1.1.3",
      "1.1.4",
      "1.1.5",
      "1.2.0",
      "1.2.1",
      "1.2.2",
      "1.2.3",
      "1.2.4",
      "1.2.5",
      "1.2.6",
      "1.2.7",
      "1.2.8",
      "1.2.9",
      "1.2.10",
      "1.2.11",
      "1.2.12",
      "1.2.13",
      "1.2.14",
      "1.2.15",
      "1.2.16",
      "1.2.17",
      "1.2.18",
      "1.2.19",
      "1.2.20",
      "1.2.21",
      "1.2.22",
      "1.2.23",
      "1.2.24",
      "1.2.25",
      "1.2.26",
      "1.2.27",
      "1.2.28",
      "1.2.29",
      "1.2.30",
      "1.3.0",
      "1.3.1",
      "1.3.2",
      "1.3.3",
      "1.3.4",
      "1.3.5",
      "1.3.6",
      "1.3.7",
      "1.3.8",
      "1.3.9",
      "1.3.10",
      "1.3.11",
      "1.3.12",
      "1.3.13",
      "1.3.14",
      "1.3.15",
      "1.3.16",
      "1.3.17",
      "1.3.18",
      "1.3.19",
      "1.3.20",
      "1.4.0",
      "1.4.1",
      "1.4.2",
      "1.4.3",
      "1.4.4",
      "1.4.5",
      "1.4.6",
      "1.4.7",
      "1.4.8",
      "1.4.9",
      "1.4.10",
      "1.4.11",
      "1.4.12",
      "1.5.0",
      "1.5.1",
      "1.5.2",
      "1.5.3",
      "1.5.4",
      "1.5.5",
      "1.5.6",
      "1.5.7",
      "1.5.8",
      "1.5.9",
      "1.6.0",
      "1.6.1",
      "1.6.2",
      "1.6.3",
      "1.6.4",
      "1.6.5",
      "1.6.6",
      "1.6.7",
      "1.6.8",
      "1.6.9",
      "1.6.10",
      "1.7.0",
      "1.7.1",
      "1.7.2",
      "1.7.3",
      "1.7.4",
      "1.7.5",
      "1.7.6",
      "1.7.7",
      "1.7.8",
      "1.7.9",
      "1.8.0",
      "1.8.1"
    ]
  },
  "dompurify": {
    "id": "purify",
    "versions": [
      "1.0.0",
      "1.0.1",
      "1.0.2",
      "1.0.3",
      "1.0.4",
      "1.0.5",
      "1.0.6",
      "1.0.7",
      "1.0.8",
      "1.0.9",
      "1.0.10",
      "1.0.11",
      "2.0.0",
      "2.0.1",
      "2.0.2",
      "2.0.3",
      "2.0.4",
      "2.0.5",
      "2.0.6",
      "2.0.7",
      "2.0.8",
      "2.0.9",
      "2.0.10",
      "2.0.11",
      "2.0.12",
      "2.0.14",
      "2.0.15",
      "2.0.16",
      "2.0.17",
      "2.1.0",
      "2.1.1",
      "2.2.0",
      "2.2.1",
      "2.2.2",
      "2.2.3",
      "2.2.4"
    ]
  },
  "jquery": {
    "id": "jquery",
    "versions": [
      "1.2.1",
      "1.2.2",
      "1.2.3",
      "1.2.4",
      "1.2.5",
      "1.2.6",
      "1.2",
      "1.3.1",
      "1.3.2",
      "1.3",
      "1.4.1",
      "1.4.2",
      "1.4.3",
      "1.4.4",
      "1.4",
      "1.5.1",
      "1.5.2",
      "1.5",
      "1.6.1",
      "1.6.2",
      "1.6.3",
      "1.6.4",
      "1.6",
      "1.7.0",
      "1.7.1",
      "1.7.2",
      "1.8.0",
      "1.8.1",
      "1.8.2",
      "1.8.3",
      "1.9.0",
      "1.9.1",
      "1.10.0",
      "1.10.1",
      "1.10.2",
      "1.11.0",
      "1.11.1",
      "1.11.2",
      "1.11.3",
      "1.12.0",
      "1.12.1",
      "1.12.2",
      "1.12.3",
      "1.12.4",
      "2.0.0",
      "2.0.1",
      "2.0.2",
      "2.0.3",
      "2.1.0",
      "2.1.1",
      "2.1.2",
      "2.1.3",
      "2.1.4",
      "2.2.0",
      "2.2.1",
      "2.2.2",
      "2.2.3",
      "2.2.4"
    ]
  }
};

export const UNADVISED_LIBRARIES = [];

export const BANNED_LIBRARIES = [];
Object.entries(LIBRARIES).forEach(([key, value]) => {
  value.versions.forEach(i => BANNED_LIBRARIES.push(`${key}.${i}.${value.id}.js`, `${key}.${i}.${value.id}.min.js`));
});

┆Issue is synchronized with this Jira Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant