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

@travetto/base

Package Overview
Dependencies
Maintainers
1
Versions
357
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@travetto/base - npm Package Compare versions

Comparing version 0.0.63 to 0.0.64

2

package.json

@@ -19,3 +19,3 @@ {

"scripts": {},
"version": "0.0.63"
"version": "0.0.64"
}

@@ -41,5 +41,9 @@ import * as path from 'path';

for (const file of (await fsReaddir(base))) {
if (file.startsWith('.')) {
continue;
}
const full = `${curBase}${path.sep}${file}`;
const stats = await fsStat(full);
const entry: Entry = { stats, file };
const entry: Entry = { stats, file: full };

@@ -52,3 +56,3 @@ if (stats.isDirectory()) {

}
} else if (handler.test(entry.file.replace(base, ''), entry)) {
} else if (handler.test(entry.file.replace(base + path.sep, ''), entry)) {
out.push(entry);

@@ -85,5 +89,9 @@ }

for (const file of fs.readdirSync(relBase)) {
if (file.startsWith('.')) {
continue;
}
const full = `${relBase}${path.sep}${file}`;
const stats = fs.lstatSync(full);
const entry: Entry = { stats, file };
const entry: Entry = { stats, file: full };

@@ -96,3 +104,3 @@ if (stats.isDirectory()) {

}
} else if (handler.test(entry.file.replace(base, ''))) {
} else if (handler.test(entry.file.replace(base + path.sep, ''))) {
out.push(entry);

@@ -113,3 +121,5 @@ }

const files = await bulkFind(handlers);
const promises = files.map(x => fsReadFileAsync(x.file).then(d => ({ name: x.file, data: d.toString() })));
const promises = files
.filter(x => !x.stats.isDirectory())
.map(x => fsReadFileAsync(x.file).then(d => ({ name: x.file, data: d.toString() })));
return await Promise.all(promises);

@@ -119,4 +129,5 @@ }

export function bulkReadSync(handlers: Handler[]) {
const files = bulkFindSync(handlers);
return files.map(x => ({ name: x.file, data: fs.readFileSync(x.file).toString() }));
return bulkFindSync(handlers)
.filter(x => !x.stats.isDirectory())
.map(x => ({ name: x.file, data: fs.readFileSync(x.file).toString() }));
}

@@ -8,4 +8,4 @@ import { AppEnv } from './env';

bulkRequire<{ init: { action: Function, priority?: number } }>([
/^node_modules\/@travetto\/.*\/bootstrap.ts$/,
/^bootstrap.ts$/
/^node_modules\/@travetto\/.*\/bootstrap[.]ts$/,
/^bootstrap[.]ts$/
])

@@ -12,0 +12,0 @@ .map(x => x.init)

@@ -6,3 +6,3 @@ export function isPrimitive(el: any): el is (string | boolean | number | RegExp) {

export function isPlainObject(obj: any): obj is object {
export function isPlainObject(obj: any): obj is { [key: string]: any } {
return typeof obj === 'object' // separate from primitives

@@ -9,0 +9,0 @@ && obj !== undefined

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