@dr.pogodin/js-utils 0.0.4 → 0.0.6

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/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![NPM Downloads](https://img.shields.io/npm/dm/@dr.pogodin/js-utils.svg)](https://www.npmjs.com/package/@dr.pogodin/js-utils)
7
7
  [![CircleCI](https://dl.circleci.com/status-badge/img/gh/birdofpreyru/js-utils/tree/master.svg?style=shield)](https://app.circleci.com/pipelines/github/birdofpreyru/js-utils)
8
8
  [![GitHub repo stars](https://img.shields.io/github/stars/birdofpreyru/js-utils?style=social)](https://github.com/birdofpreyru/js-utils)
9
- [![Dr. Pogodin Studio](https://raw.githubusercontent.com/birdofpreyru/js-utils/master/.README/logo-dr-pogodin-studio.png)](https://dr.pogodin.studio/docs/react-native-static-server)
9
+ [![Dr. Pogodin Studio](https://raw.githubusercontent.com/birdofpreyru/js-utils/master/.README/logo-dr-pogodin-studio.svg)](https://dr.pogodin.studio/docs/js-utils)
10
10
 
11
11
  The aim for this repo/package is to move in from the [React Utils] the pieces
12
12
  which are not React-specific, thus are also useful cross non-React projects,
@@ -25,7 +25,7 @@ version released to NPM it will be also compiled into plain JavaScript.
25
25
  Consumers of that NPM package thus will have access to both TS (`/ts` folder)
26
26
  and JS (`/js` folder) version of the library.
27
27
 
28
- [![Sponsor](.README/sponsor.png)](https://github.com/sponsors/birdofpreyru)
28
+ [![Sponsor](https://raw.githubusercontent.com/birdofpreyru/js-utils/master/.README/sponsor.svg)](https://github.com/sponsors/birdofpreyru)
29
29
 
30
30
  ## Content
31
31
 
@@ -21,6 +21,10 @@ export default class Emitter<T extends unknown[] = unknown[]> {
21
21
  * @param args
22
22
  */
23
23
  emit(...args: T): void;
24
+ /**
25
+ * Removes all connected listeners.
26
+ */
27
+ removeAllListeners(): void;
24
28
  /**
25
29
  * Removes specified `listener`, if connected.
26
30
  * @param listener
@@ -36,6 +36,12 @@ class Emitter {
36
36
  listeners[i](...args);
37
37
  }
38
38
  }
39
+ /**
40
+ * Removes all connected listeners.
41
+ */
42
+ removeAllListeners() {
43
+ this.p_listeners = [];
44
+ }
39
45
  /**
40
46
  * Removes specified `listener`, if connected.
41
47
  * @param listener
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@dr.pogodin/js-utils",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Collection of JavaScript (TypeScript) utilities.",
5
- "main": "js/index",
6
- "react-native": "ts/index",
7
- "source": "ts/index",
8
- "types": "js/index.d.ts",
5
+ "main": "build/index",
6
+ "react-native": "src/index",
7
+ "source": "src/index",
8
+ "types": "build/index.d.ts",
9
9
  "scripts": {
10
- "build": "rimraf js && tsc",
10
+ "build": "rimraf build && tsc",
11
11
  "jest": "jest --config jest.config.js",
12
12
  "lint": "eslint . --ext .js,.ts",
13
13
  "test": "npm run build && npm run lint && npm run typecheck && npm run jest",
14
- "typecheck": "tsc --noEmit && tsc --project __tests__/ts/tsconfig.json"
14
+ "typecheck": "tsc --noEmit && tsc --project __tests__/tsconfig.json"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
@@ -29,21 +29,21 @@
29
29
  },
30
30
  "homepage": "https://github.com/birdofpreyru/js-utils#readme",
31
31
  "devDependencies": {
32
- "@babel/core": "^7.21.8",
33
- "@babel/preset-env": "^7.21.5",
34
- "@babel/preset-typescript": "^7.21.5",
32
+ "@babel/core": "^7.22.5",
33
+ "@babel/preset-env": "^7.22.5",
34
+ "@babel/preset-typescript": "^7.22.5",
35
35
  "@tsconfig/recommended": "^1.0.2",
36
- "@types/jest": "^29.5.1",
37
- "@typescript-eslint/eslint-plugin": "^5.59.5",
38
- "@typescript-eslint/parser": "^5.59.5",
36
+ "@types/jest": "^29.5.2",
37
+ "@typescript-eslint/eslint-plugin": "^5.60.0",
38
+ "@typescript-eslint/parser": "^5.60.0",
39
39
  "babel-jest": "^29.5.0",
40
- "eslint": "^8.40.0",
40
+ "eslint": "^8.43.0",
41
41
  "eslint-config-airbnb-base": "^15.0.0",
42
42
  "eslint-config-airbnb-typescript": "^17.0.0",
43
43
  "eslint-import-resolver-typescript": "^3.5.5",
44
44
  "eslint-plugin-import": "^2.27.5",
45
45
  "jest": "^29.5.0",
46
- "rimraf": "^5.0.0",
47
- "typescript": "^5.0.4"
46
+ "rimraf": "^5.0.1",
47
+ "typescript": "^5.1.3"
48
48
  }
49
49
  }
@@ -39,6 +39,13 @@ export default class Emitter<T extends unknown[] = unknown[]> {
39
39
  }
40
40
  }
41
41
 
42
+ /**
43
+ * Removes all connected listeners.
44
+ */
45
+ removeAllListeners() {
46
+ this.p_listeners = [];
47
+ }
48
+
42
49
  /**
43
50
  * Removes specified `listener`, if connected.
44
51
  * @param listener
package/tsconfig.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "extends": "@tsconfig/recommended",
3
- "include": ["ts/**/*"],
3
+ "include": ["src/**/*"],
4
4
  "compilerOptions": {
5
5
  "declaration": true,
6
- "outDir": "js"
6
+ "outDir": "build"
7
7
  }
8
8
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes