Skip to content

Commit 74c4bf6

Browse files
committed
Update docstring and test for npm_api_url #3393
Signed-off-by: Jono Yang <[email protected]>
1 parent 795ee77 commit 74c4bf6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/packagedcode/npm.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -794,16 +794,17 @@ def npm_api_url(namespace, name, version=None, registry='https://registry.npmjs.
794794
Return a package API data URL given a namespace, name, version and a base
795795
registry URL.
796796
797-
Note that for scoped packages (with a namespace), the URL is not version
798-
specific but contains the data for all versions as the default behvior of
799-
the registries is to return nothing in this case. Special quoting rules are
800-
applied for scoped npms.
797+
Special quoting rules are applied for scoped npms.
801798
802799
For example:
803800
>>> result = npm_api_url('@invisionag', 'eslint-config-ivx', '0.1.4', 'https://registry.yarnpkg.com')
804801
>>> assert result == 'https://registry.yarnpkg.com/@invisionag%2feslint-config-ivx/0.1.4'
805802
803+
>>> result = npm_api_url('@invisionag', 'eslint-config-ivx', 'https://registry.yarnpkg.com')
804+
>>> assert result == 'https://registry.yarnpkg.com/@invisionag%2feslint-config-ivx'
805+
806806
>>> assert npm_api_url(None, 'angular', '1.6.6') == 'https://registry.npmjs.org/angular/1.6.6'
807+
>>> assert npm_api_url(None, 'angular') == 'https://registry.npmjs.org/angular'
807808
808809
>>> assert not npm_api_url(None, None, None)
809810
"""

0 commit comments

Comments
 (0)