MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/buildpacks / HasScript

Function HasScript

pkg/nodejs/nodejs.go:286–292  ·  view source on GitHub ↗

HasScript returns true if the given package.json file defines a script with the given name.

(p *PackageJSON, name string)

Source from the content-addressed store, hash-verified

284
285// HasScript returns true if the given package.json file defines a script with the given name.
286func HasScript(p *PackageJSON, name string) bool {
287 if p == nil {
288 return false
289 }
290 _, ok := p.Scripts[name]
291 return ok
292}
293
294// HasDevDependencies returns true if the given directory contains a package.json file that lists
295// more one or more devDependencies.

Callers 4

DetermineBuildCommandsFunction · 0.85
TestHasScriptFunction · 0.85
HasGCPBuildFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestHasScriptFunction · 0.68