Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@react-native-windows/package-utils

Package Overview
Dependencies
Maintainers
2
Versions
122
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native-windows/package-utils - npm Package Compare versions

Comparing version 0.0.0-canary.25 to 0.0.0-canary.26

11

lib-commonjs/packageUtils.d.ts

@@ -56,2 +56,9 @@ /**

/**
* Synchronously Finds monorepo-local packages matching a given predicate. The
* root package is not included.
*
* @param pred predicate describing whether to match a package
*/
export declare function enumerateRepoPackagesSync(pred?: (pkg: NpmPackage) => boolean): WritableNpmPackage[];
/**
* Finds a package with a given name (local or dependency)

@@ -66,1 +73,5 @@ */

export declare function findRepoPackage(name: string): Promise<WritableNpmPackage | null>;
/**
* Synchronously a monorepo-local package with a given name
*/
export declare function findRepoPackageSync(name: string): WritableNpmPackage | null;

27

lib-commonjs/packageUtils.js

@@ -12,3 +12,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.findRepoPackage = exports.findPackage = exports.enumerateRepoPackages = exports.WritableNpmPackage = exports.NpmPackage = void 0;
exports.findRepoPackageSync = exports.findRepoPackage = exports.findPackage = exports.enumerateRepoPackagesSync = exports.enumerateRepoPackages = exports.WritableNpmPackage = exports.NpmPackage = void 0;
const lodash_1 = __importDefault(require("lodash"));

@@ -106,2 +106,14 @@ const fs_1 = __importDefault(require("@react-native-windows/fs"));

/**
* Synchronously Finds monorepo-local packages matching a given predicate. The
* root package is not included.
*
* @param pred predicate describing whether to match a package
*/
function enumerateRepoPackagesSync(pred = () => true) {
const repoRoot = find_repo_root_1.default.sync();
const allPackges = getMonorepoPackages(repoRoot).map((pkg) => new WritableNpmPackage(pkg.location, pkg.package));
return allPackges.filter(pred);
}
exports.enumerateRepoPackagesSync = enumerateRepoPackagesSync;
/**
* Finds a package with a given name (local or dependency)

@@ -141,2 +153,15 @@ */

exports.findRepoPackage = findRepoPackage;
/**
* Synchronously a monorepo-local package with a given name
*/
function findRepoPackageSync(name) {
const packages = enumerateRepoPackagesSync((p) => p.json.name === name);
if (packages.length === 0) {
return null;
}
else {
return packages[0];
}
}
exports.findRepoPackageSync = findRepoPackageSync;
//# sourceMappingURL=packageUtils.js.map

4

package.json
{
"name": "@react-native-windows/package-utils",
"version": "0.0.0-canary.25",
"version": "0.0.0-canary.26",
"license": "MIT",

@@ -19,3 +19,3 @@ "scripts": {

"dependencies": {
"@react-native-windows/find-repo-root": "^0.0.0-canary.28",
"@react-native-windows/find-repo-root": "^0.0.0-canary.29",
"@react-native-windows/fs": "^1.0.2",

@@ -22,0 +22,0 @@ "get-monorepo-packages": "^1.2.0",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc