Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module.exports = {
extends: [
'@ewerk/eslint-config',
'@ewerk/eslint-config/typescript',
],
extends: ['@ewerk/eslint-config', '@ewerk/eslint-config/typescript'],
env: {
jasmine: true, // 'describe' is not defined
jest: true, // 'jest' is not defined
Expand Down
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![NPM Version](https://img.shields.io/npm/v/%40ewerk%2Fnull-or-undefined?registry_uri=https%3A%2F%2Fregistry.npmjs.org)](https://www.npmjs.com/package/@ewerk/null-or-undefined)

Type safe utility functions for checking nullish values.
It's dependency free and has no dependencies on external libraries.
It's dependency-free and has no dependencies on external libraries.

## Installation

Expand Down Expand Up @@ -41,19 +41,19 @@ if (neitherNullNorUndefined(value)) {
}

// Example with RxJS
const value$: Observable<{title: string} | undefined> = of(undefined);
const value$: Observable<{ title: string } | undefined> = of(undefined);

// before
const titleOld$: string = value$.pipe(
filter((value) => value !== null && value !== undefined),
map((value) => value as {title: string}), // cast is necessary to get rid of the undefined type
map((value) => value as { title: string }), // cast is necessary to get rid of the undefined type
map((value) => value.title),
);

// after
const titleNew$: string = value$.pipe(
filter(neitherNullNorUndefined),
map((value) => value.title)
map((value) => value.title),
);
```

Expand Down
5 changes: 1 addition & 4 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ const esbuild = require('esbuild');

const commonConfig = {
entryPoints: ['./src/index.ts'],
target: [
'esnext',
'node20',
],
target: ['esnext', 'node20'],
bundle: true,
minify: true,
treeShaking: true,
Expand Down
5 changes: 0 additions & 5 deletions jest.config.js

This file was deleted.

Loading
Loading