Socket
Socket
Sign inDemoInstall

@pkgr/utils

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pkgr/utils - npm Package Compare versions

Comparing version 0.2.2 to 0.3.0

lib/monorepo.d.ts

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [0.3.0](https://github.com/rx-ts/pkgr/compare/@pkgr/utils@0.2.2...@pkgr/utils@0.3.0) (2019-11-03)
### Features
* **rollup:** support glob exclude and monorepo options, close [#36](https://github.com/rx-ts/pkgr/issues/36) ([5fc9d17](https://github.com/rx-ts/pkgr/commit/5fc9d1700d4771474baad515220e47f2e768d179))
## [0.2.2](https://github.com/rx-ts/pkgr/compare/@pkgr/utils@0.2.1...@pkgr/utils@0.2.2) (2019-11-02)

@@ -8,0 +19,0 @@

export declare const tryPkg: (pkg: string) => string | undefined;
export declare const tryRequirePkg: <T>(pkg: string) => T | undefined;
export declare const isPkgAvailable: (pkg: string) => boolean;

@@ -11,4 +12,8 @@ export declare const isTsAvailable: boolean;

export declare const tryExtensions: (filepath: string, extensions?: string[]) => string;
export declare const tryGlob: (paths: string[], options?: string | {
absolute?: boolean | undefined;
baseDir?: string | undefined;
}) => string[];
export declare const identify: <T>(_: T) => _ is Exclude<T, "" | (T extends boolean ? false : boolean) | null | undefined>;
export declare const findUp: (searchEntry: string, searchFile?: string) => string;
//# sourceMappingURL=helpers.d.ts.map

25

lib/helpers.js

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

var fs_1 = tslib_1.__importDefault(require("fs"));
var path_1 = tslib_1.__importDefault(require("path"));
var path_1 = tslib_1.__importStar(require("path"));
var is_glob_1 = tslib_1.__importDefault(require("is-glob"));
var sync_1 = tslib_1.__importDefault(require("tiny-glob/sync"));
var constants_1 = require("./constants");

@@ -14,2 +16,9 @@ exports.tryPkg = function (pkg) {

};
exports.tryRequirePkg = function (pkg) {
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
return require(pkg);
}
catch (_a) { }
};
exports.isPkgAvailable = function (pkg) { return !!exports.tryPkg(pkg); };

@@ -43,2 +52,16 @@ exports.isTsAvailable = exports.isPkgAvailable('typescript');

};
exports.tryGlob = function (paths, options) {
if (options === void 0) { options = {}; }
var _a = typeof options === 'string' ? { baseDir: options } : options, _b = _a.absolute, absolute = _b === void 0 ? true : _b, _c = _a.baseDir, baseDir = _c === void 0 ? constants_1.CWD : _c;
return paths.reduce(function (acc, pkg) {
return acc
.concat(is_glob_1.default(pkg)
? sync_1.default(pkg, {
absolute: absolute,
cwd: baseDir,
})
: exports.tryFile(path_1.resolve(baseDir, pkg), true))
.filter(Boolean);
}, []);
};
exports.identify = function (_) { return !!_; };

@@ -45,0 +68,0 @@ exports.findUp = function (searchEntry, searchFile) {

export * from './browser';
export * from './constants';
export * from './helpers';
export * from './monorepo';
//# sourceMappingURL=index.d.ts.map

@@ -7,2 +7,3 @@ "use strict";

tslib_1.__exportStar(require("./helpers"), exports);
tslib_1.__exportStar(require("./monorepo"), exports);
//# sourceMappingURL=index.js.map

6

package.json
{
"name": "@pkgr/utils",
"version": "0.2.2",
"version": "0.3.0",
"description": "Shared utils for `@pkgr` packages or any package else",

@@ -18,3 +18,5 @@ "repository": "git+https://github.com/rx-ts/pkgr.git",

"cross-spawn": "^7.0.1",
"is-glob": "^4.0.1",
"open": "^7.0.0",
"tiny-glob": "^0.2.6",
"tslib": "^1.10.0"

@@ -26,3 +28,3 @@ },

"sideEffects": false,
"gitHead": "bc9c9df1e540668a6f511728d1e838c34471c34d"
"gitHead": "360013e6c48c9078f1e2bcca521c45058242a453"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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