utilium 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/objects.d.ts CHANGED
@@ -6,7 +6,7 @@ export declare abstract class FileMap<V> implements Map<string, V> {
6
6
  protected readonly path: string;
7
7
  protected fs: typeof FS;
8
8
  get [Symbol.toStringTag](): string;
9
- constructor(path: string, fs?: typeof FS);
9
+ constructor(path: string, fs: typeof FS);
10
10
  protected abstract readonly _map: Map<string, V>;
11
11
  abstract clear(): void;
12
12
  abstract delete(key: string): boolean;
package/dist/objects.js CHANGED
@@ -1,6 +1,3 @@
1
- // default fs for FileMap
2
- let _fs;
3
- import('fs').then(_ => (_fs = _));
4
1
  export function filterObject(object, ...keys) {
5
2
  const entries = Object.entries(object);
6
3
  return Object.fromEntries(entries.filter(([key]) => keys.includes(key)));
@@ -18,7 +15,7 @@ export class FileMap {
18
15
  get [Symbol.toStringTag]() {
19
16
  return 'FileMap';
20
17
  }
21
- constructor(path, fs = _fs) {
18
+ constructor(path, fs) {
22
19
  this.path = path;
23
20
  this.fs = fs;
24
21
  if (!path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilium",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Typescript utilies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/objects.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  import type * as FS from 'fs';
2
2
 
3
- // default fs for FileMap
4
- let _fs: typeof FS;
5
- import('fs').then(_ => (_fs = _));
6
-
7
3
  export function filterObject<T extends object, K extends keyof T>(object: T, ...keys: K[]): Omit<T, K> {
8
4
  const entries = <[K, T[K]][]>Object.entries(object);
9
5
  return <Omit<T, K>>(<unknown>Object.fromEntries(entries.filter(([key]) => keys.includes(key))));
@@ -25,7 +21,7 @@ export abstract class FileMap<V> implements Map<string, V> {
25
21
 
26
22
  public constructor(
27
23
  protected readonly path: string,
28
- protected fs: typeof FS = _fs
24
+ protected fs: typeof FS
29
25
  ) {
30
26
  if (!path) {
31
27
  throw new ReferenceError('No path specified');