Skip to content

Commit 4d03274

Browse files
committed
support scoped modules containing hyphens
1 parent 98e7048 commit 4d03274

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1515
### Fixed
1616
- attempt to fix crash in [`no-mutable-exports`]. ([#660])
1717
- "default is a reserved keyword" in no-maned-default tests by locking down babylon to 6.15.0 (#756, thanks @gmathieu)
18+
- support scoped modules containing non word characters
1819

1920

2021
## [2.2.0] - 2016-11-07

src/core/importType.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function isExternalModule(name, settings, path) {
2727
return externalModuleRegExp.test(name) && isExternalPath(path, name, settings)
2828
}
2929

30-
const scopedRegExp = /^@\w+\/\w+/
30+
const scopedRegExp = /^@[^\/]+\/[^\/]+/
3131
function isScoped(name) {
3232
return scopedRegExp.test(name)
3333
}

tests/src/core/importType.js

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ describe('importType(name)', function () {
3131
it("should return 'external' for scopes packages", function() {
3232
expect(importType('@cycle/core', context)).to.equal('external')
3333
expect(importType('@cycle/dom', context)).to.equal('external')
34+
expect(importType('@some-thing/something', context)).to.equal('external')
35+
expect(importType('@some-thing/something/some-module', context)).to.equal('external')
36+
expect(importType('@some-thing/something/some-directory/someModule.js', context)).to.equal('external')
3437
})
3538

3639
it("should return 'internal' for non-builtins resolved outside of node_modules", function () {

0 commit comments

Comments
 (0)