Skip to content

Commit 2885bb4

Browse files
committed
Remove unnecessary dependency url-join
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
1 parent 8f5ec3b commit 2885bb4

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

package-lock.json

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
"ttf2eot": "^3.0.0",
3535
"ttf2woff": "^3.0.0",
3636
"ttf2woff2": "^6.0.1",
37-
"underscore": "^1.9.1",
38-
"url-join": "^5.0.0"
37+
"underscore": "^1.9.1"
3938
},
4039
"devDependencies": {
4140
"file-type": "^19.6.0",

src/renderCss.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as fs from 'fs'
22
import * as crypto from 'crypto'
3+
import * as url from 'url'
34
import _ from 'underscore'
45
import handlebars from 'handlebars'
5-
import urlJoin from 'url-join'
66

77
/** Caclulates hash based on options and source SVG files */
88
var calcHash = function(options) {
@@ -24,7 +24,7 @@ var makeUrls = function(options) {
2424
var baseUrl = options.cssFontsUrl && options.cssFontsUrl.replace(/\\/g, '/')
2525
var urls = _.map(options.types, function(type) {
2626
var fontName = options.fontName + '.' + type + '?' + hash
27-
return baseUrl ? urlJoin(baseUrl, fontName) : fontName
27+
return baseUrl ? url.resolve(baseUrl.replace(/\/*$/, '/'), fontName) : fontName
2828
})
2929
return _.object(options.types, urls)
3030
}

yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,11 +1397,6 @@ unique-slug@^4.0.0:
13971397
dependencies:
13981398
imurmurhash "^0.1.4"
13991399

1400-
url-join@^5.0.0:
1401-
version "5.0.0"
1402-
resolved "https://registry.yarnpkg.com/url-join/-/url-join-5.0.0.tgz#c2f1e5cbd95fa91082a93b58a1f42fecb4bdbcf1"
1403-
integrity sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==
1404-
14051400
util-deprecate@^1.0.1:
14061401
version "1.0.2"
14071402
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"

0 commit comments

Comments
 (0)