@@ -5,8 +5,8 @@ import { provides as cache_provides, available as cache_available, runtime_env a
55import type SemVer from "../utils/semver.ts"
66import * as semver from "../utils/semver.ts"
77import useMoustaches from "./useMoustaches.ts"
8- import { PkgxError } from "../utils/error.ts"
9- import { validate } from "../utils/misc.ts"
8+ import { PkgxError , swallow } from "../utils/error.ts"
9+ import { compact , insert , validate } from "../utils/misc.ts"
1010import * as pkgutils from "../utils/pkg.ts"
1111import useConfig from "./useConfig.ts"
1212import host from "../utils/host.ts"
@@ -79,7 +79,7 @@ export default function usePantry(): {
7979 for ( const prefix of pantry_paths ( ) ) {
8080 for await ( const path of _ls_pantry ( prefix ) ) {
8181 const project = path . parent ( ) . relative ( { to : prefix } )
82- if ( seen . insert ( project ) . inserted ) {
82+ if ( insert ( seen , project ) . inserted ) {
8383 yield { project, path }
8484 }
8585 }
@@ -149,7 +149,7 @@ export default function usePantry(): {
149149 }
150150 if ( ! isArray ( node ) ) throw new PantryParseError ( project )
151151
152- return node . compact ( x => {
152+ return compact ( node , x => {
153153 if ( isPlainObject ( x ) ) {
154154 x = x [ "executable" ]
155155 }
@@ -241,7 +241,7 @@ export default function usePantry(): {
241241 rv . push ( proj )
242242 continue
243243 }
244- const yaml = await proj . yaml ( ) . swallow ( )
244+ const yaml = await swallow ( proj . yaml ( ) )
245245 if ( ! yaml ) {
246246 console . warn ( "warn: parse failure:" , pkg . project )
247247 } else if ( yaml [ "display-name" ] ?. toLowerCase ( ) == name ) {
@@ -315,8 +315,7 @@ export function parse_pkgs_node(node: any): PackageRequirement[] {
315315 node = validate . obj ( node )
316316 platform_reduce ( node )
317317
318- return Object . entries ( node )
319- . compact ( ( [ project , constraint ] ) =>
318+ return compact ( Object . entries ( node ) , ( [ project , constraint ] ) =>
320319 validatePackageRequirement ( project , constraint ) )
321320}
322321
0 commit comments