@homeofthings/nestjs-utils
Advanced tools
Comparing version 1.0.6 to 2.0.0
# CHANGELOG for @homeofthings/nestjs-utils | ||
| Release | Notes | | ||
| ------- | ------------------------------------------------------------------------------------------------------------ | | ||
|---------|--------------------------------------------------------------------------------------------------------------| | ||
| 2.0.0 | nestjs 10x | | ||
| 1.0.4-6 | maintenance release | | ||
| 1.0.3 | feature: dynamic root module: multiple dynamic module support by using multiple register/registerAsync calls | | ||
| 1.0.2 | first version | |
{ | ||
"name": "@homeofthings/nestjs-utils", | ||
"description": "HomeOfThings - NestJs Utils: various utilities and common types", | ||
"version": "1.0.6", | ||
"version": "2.0.0", | ||
"keywords": [ | ||
@@ -23,10 +23,11 @@ "nestjs", | ||
"homepage": "https://github.com/gms1/HomeOfThings", | ||
"dependencies": { | ||
"@nestjs/common": "*", | ||
"rxjs": "*", | ||
"mkdirp": "*", | ||
"type-fest": "*", | ||
"tslib": "*" | ||
}, | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts", | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"@nestjs/common": "^8.4.7", | ||
"rxjs": "~7.5.5", | ||
"tslib": "^2.4.0" | ||
} | ||
} | ||
"type": "commonjs" | ||
} |
[![npm version](https://badge.fury.io/js/%40homeofthings%2Fnestjs-utils.svg)](https://badge.fury.io/js/%40homeofthings%2Fnestjs-utils) | ||
[![Build Workflow](https://github.com/gms1/HomeOfThings/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/gms1/HomeOfThings/actions/workflows/build.yml) | ||
[![Coverage Status](https://codecov.io/gh/gms1/HomeOfThings/branch/master/graph/badge.svg?flag=nestjs-utils)](https://codecov.io/gh/gms1/HomeOfThings) | ||
[![Coverage Status](https://codecov.io/gh/gms1/HomeOfThings/branch/master/graph/badge.svg?flag=nestjs-utils)](https://app.codecov.io/gh/gms1/HomeOfThings/tree/master/packages%2Fnode%2F%40homeofthings%2Fnestjs-utils) | ||
[![DeepScan grade](https://deepscan.io/api/teams/439/projects/987/branches/1954/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=439&pid=987&bid=1954) | ||
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) | ||
[![License](https://img.shields.io/npm/l/@homeofthings/nestjs-utils.svg?style=flat-square)](https://github.com/gms1/HomeOfThings/blob/master/LICENSE) | ||
[![License](https://img.shields.io/npm/l/@homeofthings/nestjs-utils.svg?style=flat-square)](https://github.com/gms1/HomeOfThings/blob/master/packages/node/@homeofthings/nestjs-utils/LICENSE) | ||
@@ -9,0 +9,0 @@ # HomeOfThings - common utilities for NestJs |
@@ -10,6 +10,4 @@ "use strict"; | ||
class AsyncContext { | ||
constructor(defaultValue) { | ||
this._storage = new async_hooks_1.AsyncLocalStorage(); | ||
this._default = defaultValue; | ||
} | ||
_storage = new async_hooks_1.AsyncLocalStorage(); | ||
_default; | ||
get defaultValue() { | ||
@@ -21,2 +19,5 @@ return this._default; | ||
} | ||
constructor(defaultValue) { | ||
this._default = defaultValue; | ||
} | ||
set(value) { | ||
@@ -23,0 +24,0 @@ this._storage.enterWith(value); |
@@ -7,3 +7,3 @@ import { DynamicModule, Type } from '@nestjs/common'; | ||
} | ||
export declare type DynamicRootBaseModuleExtended<T, Os, Oa extends AsyncModuleBasicOptions = AsyncModuleOptions<Os>> = Constructor<DynamicRootBaseModule> & { | ||
export type DynamicRootBaseModuleExtended<T, Os, Oa extends AsyncModuleBasicOptions = AsyncModuleOptions<Os>> = Constructor<DynamicRootBaseModule> & { | ||
isRegistered: boolean; | ||
@@ -10,0 +10,0 @@ forRoot(moduleCtor: Type<T>, moduleOptions: Os): DynamicModule; |
@@ -20,2 +20,4 @@ "use strict"; | ||
class DynamicRootModule extends DynamicRootBaseModule { | ||
static dynamicModule$ = new rxjs_1.ReplaySubject(1); | ||
static _isRegistered; | ||
static get isRegistered() { | ||
@@ -85,3 +87,2 @@ return DynamicRootModule._isRegistered; | ||
} | ||
DynamicRootModule.dynamicModule$ = new rxjs_1.ReplaySubject(1); | ||
return DynamicRootModule; | ||
@@ -88,0 +89,0 @@ } |
@@ -11,26 +11,24 @@ "use strict"; | ||
const writeFile = util.promisify(fs.writeFile); | ||
function writeFileIfChanged(outputPath, content) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
let oldContent; | ||
try { | ||
oldContent = yield readFile(outputPath, { encoding: 'utf8' }); | ||
} | ||
catch (err) { | ||
oldContent = undefined; | ||
} | ||
if (oldContent === content) { | ||
return false; | ||
} | ||
const dirname = path.dirname(outputPath); | ||
try { | ||
mkdirp.sync(dirname); | ||
yield writeFile(outputPath, content, { encoding: 'utf8' }); | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
return true; | ||
}); | ||
async function writeFileIfChanged(outputPath, content) { | ||
let oldContent; | ||
try { | ||
oldContent = await readFile(outputPath, { encoding: 'utf8' }); | ||
} | ||
catch (err) { | ||
oldContent = undefined; | ||
} | ||
if (oldContent === content) { | ||
return false; | ||
} | ||
const dirname = path.dirname(outputPath); | ||
try { | ||
mkdirp.sync(dirname); | ||
await writeFile(outputPath, content, { encoding: 'utf8' }); | ||
} | ||
catch (err) { | ||
return Promise.reject(err); | ||
} | ||
return true; | ||
} | ||
exports.writeFileIfChanged = writeFileIfChanged; | ||
//# sourceMappingURL=write-file-if-changed.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LruCache = void 0; | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
/* eslint-disable @typescript-eslint/no-empty-function */ | ||
class LruCache { | ||
constructor(_maxEntries = 20) { | ||
this._maxEntries = _maxEntries; | ||
this._map = new Map(); | ||
} | ||
_maxEntries; | ||
_map = new Map(); | ||
get maxEntries() { | ||
@@ -20,4 +19,7 @@ return this._maxEntries; | ||
} | ||
constructor(_maxEntries = 20) { | ||
this._maxEntries = _maxEntries; | ||
} | ||
get(key) { | ||
let item; | ||
let item = undefined; | ||
if (this._map.has(key)) { | ||
@@ -24,0 +26,0 @@ // mark item as least recently used |
export { Type } from '@nestjs/common'; | ||
export type { Constructor, JsonValue, Primitive } from 'type-fest'; | ||
export declare type GenericDictionary<T> = Record<string, T>; | ||
export declare type Dictionary = GenericDictionary<string>; | ||
export declare type AnyObject = GenericDictionary<unknown>; | ||
export type GenericDictionary<T> = Record<string, T>; | ||
export type Dictionary = GenericDictionary<string>; | ||
export type AnyObject = GenericDictionary<unknown>; |
import { AnyObject, Constructor } from './common-types'; | ||
export declare type MixinTarget<T extends AnyObject> = Constructor<{ | ||
export type MixinTarget<T extends AnyObject> = Constructor<{ | ||
[P in keyof T]: T[P]; | ||
}>; |
import { ModuleMetadata, Type } from '@nestjs/common'; | ||
export declare type InjectionToken = string | symbol | Type<any>; | ||
export type InjectionToken = string | symbol | Type<any>; | ||
export interface AsyncModuleBasicOptions extends Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'> { | ||
@@ -4,0 +4,0 @@ useFactory: (...args: any[]) => Promise<any> | any; |
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
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 5 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25561
31
310
5
6
+ Added@nestjs/common@*
+ Addedmkdirp@*
+ Addedrxjs@*
+ Addedtslib@*
+ Addedtype-fest@*
+ Added@lukeed/csprng@1.1.0(transitive)
+ Added@nestjs/common@10.4.11(transitive)
+ Addedmkdirp@3.0.1(transitive)
+ Addedreflect-metadata@0.2.2(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedtslib@2.7.0(transitive)
+ Addedtype-fest@4.29.0(transitive)
+ Addeduid@2.0.2(transitive)
- Removed@nestjs/common@8.4.7(transitive)
- Removedasynckit@0.4.0(transitive)
- Removedaxios@0.27.2(transitive)
- Removedcombined-stream@1.0.8(transitive)
- Removeddelayed-stream@1.0.0(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedform-data@4.0.1(transitive)
- Removedmime-db@1.52.0(transitive)
- Removedmime-types@2.1.35(transitive)
- Removedreflect-metadata@0.1.14(transitive)
- Removedrxjs@7.5.7(transitive)
- Removedtslib@2.4.0(transitive)
- Removeduuid@8.3.2(transitive)