@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 +2 -2
- package/{js → build}/Emitter.d.ts +4 -0
- package/{js → build}/Emitter.js +6 -0
- package/package.json +16 -16
- package/{ts → src}/Emitter.ts +7 -0
- package/tsconfig.json +2 -2
- /package/{js → build}/Barrier.d.ts +0 -0
- /package/{js → build}/Barrier.js +0 -0
- /package/{js → build}/Semaphore.d.ts +0 -0
- /package/{js → build}/Semaphore.js +0 -0
- /package/{js → build}/index.d.ts +0 -0
- /package/{js → build}/index.js +0 -0
- /package/{js → build}/time.d.ts +0 -0
- /package/{js → build}/time.js +0 -0
- /package/{ts → src}/Barrier.ts +0 -0
- /package/{ts → src}/Semaphore.ts +0 -0
- /package/{ts → src}/index.ts +0 -0
- /package/{ts → src}/time.ts +0 -0
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/@dr.pogodin/js-utils)
|
|
7
7
|
[](https://app.circleci.com/pipelines/github/birdofpreyru/js-utils)
|
|
8
8
|
[](https://github.com/birdofpreyru/js-utils)
|
|
9
|
-
[](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
|
-
[](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
|
package/{js → build}/Emitter.js
RENAMED
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dr.pogodin/js-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Collection of JavaScript (TypeScript) utilities.",
|
|
5
|
-
"main": "
|
|
6
|
-
"react-native": "
|
|
7
|
-
"source": "
|
|
8
|
-
"types": "
|
|
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
|
|
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__/
|
|
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.
|
|
33
|
-
"@babel/preset-env": "^7.
|
|
34
|
-
"@babel/preset-typescript": "^7.
|
|
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.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
38
|
-
"@typescript-eslint/parser": "^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
|
+
"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.
|
|
47
|
-
"typescript": "^5.
|
|
46
|
+
"rimraf": "^5.0.1",
|
|
47
|
+
"typescript": "^5.1.3"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/{ts → src}/Emitter.ts
RENAMED
|
@@ -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
|
File without changes
|
/package/{js → build}/Barrier.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{js → build}/index.d.ts
RENAMED
|
File without changes
|
/package/{js → build}/index.js
RENAMED
|
File without changes
|
/package/{js → build}/time.d.ts
RENAMED
|
File without changes
|
/package/{js → build}/time.js
RENAMED
|
File without changes
|
/package/{ts → src}/Barrier.ts
RENAMED
|
File without changes
|
/package/{ts → src}/Semaphore.ts
RENAMED
|
File without changes
|
/package/{ts → src}/index.ts
RENAMED
|
File without changes
|
/package/{ts → src}/time.ts
RENAMED
|
File without changes
|