@bemoje/map 0.0.1 → 0.0.3
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 +39 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/jest.config.ts +13 -0
- package/package.json +2 -5
- package/project.json +23 -1
- package/tsconfig.spec.json +9 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# @bemoje/map
|
|
2
|
+
Map related tools/util.
|
|
3
|
+
|
|
4
|
+

|
|
5
|
+
|
|
6
|
+
##### Github
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
##### NPM
|
|
14
|
+
<span><a href="https://npmjs.org/@bemoje/map" title="View this project on NPM"><img src="https://img.shields.io/npm/v/@bemoje/map" alt="NPM Version" /></a></span>
|
|
15
|
+
<span><a href="https://npmjs.org/@bemoje/map" title="NPM Downloads"><img src="https://img.shields.io/npm/dt/@bemoje/map" alt="NPM Downloads" /></a></span>
|
|
16
|
+
|
|
17
|
+
## Documentation
|
|
18
|
+
[map docs](https://bemoje.github.io/tsmono/html/map/modules.html)
|
|
19
|
+
|
|
20
|
+
##### Donate
|
|
21
|
+
<span><a href="https://www.patreon.com/user?u=40752770" title="Donate using Patreon"><img src="https://img.shields.io/badge/patreon-donate-yellow.svg" alt="Patreon Donation" /></a></span>
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
This library is published in the NPM registry and can be installed using any compatible package manager.
|
|
25
|
+
|
|
26
|
+
#### NPM
|
|
27
|
+
```sh
|
|
28
|
+
npm install @bemoje/map
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Issues
|
|
33
|
+
Please let me know of any bugs or [issues](https://github.com/bemoje/https://github.com/bemoje/tsmono/issues).
|
|
34
|
+
|
|
35
|
+
## Contribute
|
|
36
|
+
Contributors are welcome to open a [pull request](https://github.com/bemoje/https://github.com/bemoje/tsmono/pulls).
|
|
37
|
+
|
|
38
|
+
## License
|
|
39
|
+
Released under the [MIT License](./LICENSE).
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @bemoje/map v0.0.
|
|
2
|
+
* @bemoje/map v0.0.2
|
|
3
3
|
* (c) Benjamin Møller Jensen
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/"use strict";function mapGetOrElse(map,key,callback){let value=map.get(key);return void 0===value?(value=callback(key),map.set(key,value),value):value}function mapReverse(map){return new Map([...map.entries()].reverse())}function mapUpdate(map,key,fun){const value=fun(map.get(key),key);return map.set(key,value),value}exports.mapGetOrElse=mapGetOrElse,exports.mapReverse=mapReverse,exports.mapUpdate=mapUpdate;
|
package/dist/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @bemoje/map v0.0.
|
|
2
|
+
* @bemoje/map v0.0.2
|
|
3
3
|
* (c) Benjamin Møller Jensen
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/function mapGetOrElse(map,key,callback){let value=map.get(key);return void 0===value?(value=callback(key),map.set(key,value),value):value}function mapReverse(map){return new Map([...map.entries()].reverse())}function mapUpdate(map,key,fun){const value=fun(map.get(key),key);return map.set(key,value),value}export{mapGetOrElse,mapReverse,mapUpdate};
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
const pkg = require('./package.json')
|
|
3
|
+
const name = pkg.name.split('@')[1]
|
|
4
|
+
export default {
|
|
5
|
+
displayName: name,
|
|
6
|
+
preset: '../../jest.preset.js',
|
|
7
|
+
testEnvironment: 'node',
|
|
8
|
+
transform: {
|
|
9
|
+
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
|
10
|
+
},
|
|
11
|
+
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
12
|
+
coverageDirectory: '../../coverage/pkg/' + name,
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bemoje/map",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Map related tools/util.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"lint": "eslint \"*/**/*.{ts,js,json}\" --fix",
|
|
10
|
-
"test": "jest --preset ts-jest",
|
|
11
9
|
"build": "rimraf dist && rollup --config ./rollup.config.js --bundleConfigAsCjs",
|
|
12
|
-
"docs": "rimraf ../../docs/map && typedoc --out ../../docs/map --entryPoints src/index.ts"
|
|
13
|
-
"prepub": "npm run lint && npm run build && npm run test && npm run docs"
|
|
10
|
+
"docs": "rimraf ../../docs/map && typedoc --out ../../docs/map --entryPoints src/index.ts"
|
|
14
11
|
},
|
|
15
12
|
"author": {
|
|
16
13
|
"name": "Benjamin Møller Jensen",
|
package/project.json
CHANGED
|
@@ -3,6 +3,28 @@
|
|
|
3
3
|
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
4
|
"sourceRoot": "pkg/map/src",
|
|
5
5
|
"projectType": "library",
|
|
6
|
-
"targets": {
|
|
6
|
+
"targets": {
|
|
7
|
+
"lint": {
|
|
8
|
+
"executor": "@nx/linter:eslint",
|
|
9
|
+
"outputs": ["{options.outputFile}"],
|
|
10
|
+
"options": {
|
|
11
|
+
"lintFilePatterns": ["pkg/map/**/*.ts"]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"test": {
|
|
15
|
+
"executor": "@nx/jest:jest",
|
|
16
|
+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
|
|
17
|
+
"options": {
|
|
18
|
+
"jestConfig": "pkg/map/jest.config.ts",
|
|
19
|
+
"passWithNoTests": true
|
|
20
|
+
},
|
|
21
|
+
"configurations": {
|
|
22
|
+
"ci": {
|
|
23
|
+
"ci": true,
|
|
24
|
+
"codeCoverage": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
7
29
|
"tags": []
|
|
8
30
|
}
|