A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/npm/commit/a489585985540deed4edc03418636c9e97aa9e40 below:

Save requires information to shrinkwrap/lock · npm/npm@a489585 · GitHub

@@ -101,30 +101,24 @@ function shrinkwrapDeps (deps, top, tree, seen) {

101 101

if (seen[tree.path]) return

102 102

seen[tree.path] = true

103 103

tree.children.sort(function (aa, bb) { return moduleName(aa).localeCompare(moduleName(bb)) }).forEach(function (child) {

104 -

var childIsOnlyDev = isOnlyDev(child)

105 104

if (child.fakeChild) {

106 105

deps[moduleName(child)] = child.fakeChild

107 106

return

108 107

}

108 +

var childIsOnlyDev = isOnlyDev(child)

109 109

var pkginfo = deps[moduleName(child)] = {}

110 -

var req = child.package._requested || getRequested(child) || {}

111 -

if (req.type === 'directory' || req.type === 'file') {

112 -

pkginfo.version = 'file:' + path.relative(top.path, child.package._resolved || req.fetchSpec)

113 -

} else if (!req.registry && !child.fromBundle) {

114 -

pkginfo.version = child.package._resolved || req.saveSpec || req.rawSpec

115 -

} else {

116 -

pkginfo.version = child.package.version

117 -

}

110 +

var requested = child.package._requested || getRequested(child) || {}

111 +

pkginfo.version = childVersion(top, child, requested)

118 112

if (child.fromBundle || child.isInLink) {

119 113

pkginfo.bundled = true

120 114

} else {

121 -

if (req.registry) {

115 +

if (requested.registry) {

122 116

pkginfo.resolved = child.package._resolved

123 117

}

124 118

// no integrity for git deps as integirty hashes are based on the

125 119

// tarball and we can't (yet) create consistent tarballs from a stable

126 120

// source.

127 -

if (req.type !== 'git') {

121 +

if (requested.type !== 'git') {

128 122

pkginfo.integrity = child.package._integrity

129 123

if (!pkginfo.integrity && child.package._shasum) {

130 124

pkginfo.integrity = ssri.fromHex(child.package._shasum, 'sha1')

@@ -133,13 +127,28 @@ function shrinkwrapDeps (deps, top, tree, seen) {

133 127

}

134 128

if (childIsOnlyDev) pkginfo.dev = true

135 129

if (isOptional(child)) pkginfo.optional = true

130 +

pkginfo.requires = {}

131 +

child.requires.sort((a, b) => moduleName(a).localeCompare(moduleName(b))).forEach((required) => {

132 +

var requested = required.package._requested || getRequested(required) || {}

133 +

pkginfo.requires[moduleName(required)] = childVersion(top, required, requested)

134 +

})

136 135

if (child.children.length) {

137 136

pkginfo.dependencies = {}

138 137

shrinkwrapDeps(pkginfo.dependencies, top, child, seen)

139 138

}

140 139

})

141 140

}

142 141 142 +

function childVersion (top, child, req) {

143 +

if (req.type === 'directory' || req.type === 'file') {

144 +

return 'file:' + path.relative(top.path, child.package._resolved || req.fetchSpec)

145 +

} else if (!req.registry && !child.fromBundle) {

146 +

return child.package._resolved || req.saveSpec || req.rawSpec

147 +

} else {

148 +

return child.package.version

149 +

}

150 +

}

151 + 143 152

function shrinkwrap_ (dir, pkginfo, opts, cb) {

144 153

save(dir, pkginfo, opts, cb)

145 154

}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4