MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / bundle_deps_mapper

Function bundle_deps_mapper

src/packagedcode/npm.py:1787–1806  ·  view source on GitHub ↗

https://docs.npmjs.com/files/package.json#bundleddependencies "This defines an array of package names that will be bundled when publishing the package."

(bundle_deps, package)

Source from the content-addressed store, hash-verified

1785
1786
1787def bundle_deps_mapper(bundle_deps, package):
1788 """
1789 https://docs.npmjs.com/files/package.json#bundleddependencies
1790 "This defines an array of package names that will be bundled
1791 when publishing the package."
1792 """
1793 for bdep in (bundle_deps or []):
1794 bdep = bdep and bdep.strip()
1795 if not bdep:
1796 continue
1797
1798 ns, name = split_scoped_package_name(bdep)
1799 purl = models.PackageURL(type='npm', namespace=ns, name=name)
1800
1801 dep = models.DependentPackage(purl=purl.to_string(),
1802 scope='bundledDependencies', is_runtime=True,
1803 )
1804 package.dependencies.append(dep)
1805
1806 return package
1807
1808
1809def deps_mapper(deps, package, field_name, is_direct=True):

Callers

nothing calls this directly

Calls 3

to_stringMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected