Skip to content

Commit

Permalink
chore: add url parse guard (#2600)
Browse files Browse the repository at this point in the history
* chore: add url parse guard

* feat: add performance ci
  • Loading branch information
iChenLei committed Nov 27, 2021
1 parent 3329f5b commit fc2e630
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ jobs:
run: node --version && npm --version
- name: Run Test
run: npm run test

benchmark:
name: 'Run stylus benchmark with node16'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Install npm dependencies
run: npm install
- name: Print put node & npm version
run: node --version && npm --version
- name: Run Benchmark
run: node ./bm.js
2 changes: 1 addition & 1 deletion lib/functions/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = function(options) {

// Parse literal
url = parse(url);
var ext = extname(url.pathname)
var ext = extname(url.pathname || '')
, mime = mimes[ext]
, hash = url.hash || ''
, literal = new nodes.Literal('url("' + url.href + '")')
Expand Down

0 comments on commit fc2e630

Please sign in to comment.