Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Apr 9, 2024
2 parents ba5b5fa + 29fec2c commit 1682e5a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ jobs:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
config-file: ./.github/codeql/codeql-config.yml
languages: "javascript"
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:javascript"
34 changes: 33 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const defaultLookups = {
'.scss': sassLookup,
'.styl': stylusLookup,
'.ts': tsLookup,
'.tsx': tsLookup
'.tsx': tsLookup,
'.vue': vueLookup
};

/**
Expand Down Expand Up @@ -390,6 +391,37 @@ function commonJSLookup(options) {
return result;
}

function vueLookup(options) {
const { dependency } = options;

if (!dependency) {
debug('blank dependency given. Returning early.');
return '';
}

if (dependency.endsWith('.js') || dependency.endsWith('.jsx')) {
return jsLookup(options);
}

if (dependency.endsWith('.ts') || dependency.endsWith('.tsx')) {
return tsLookup(options);
}

if (dependency.endsWith('.scss') || dependency.endsWith('.sass') || dependency.endsWith('.less')) {
return sassLookup(options);
}

if (dependency.endsWith('.styl')) {
return stylusLookup(options);
}

if (options.tsConfig || options.tsConfigPath) {
return tsLookup(options);
}

return jsLookup(options);
}

function resolveWebpackPath({ dependency, filename, directory, webpackConfig }) {
if (!webpackResolve) {
webpackResolve = require('enhanced-resolve');
Expand Down
3 changes: 2 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ describe('filing-cabinet', () => {
'.scss',
'.styl',
'.ts',
'.tsx'
'.tsx',
'.vue'
].sort();
assert.deepEqual(actual, expected);
});
Expand Down

0 comments on commit 1682e5a

Please sign in to comment.