@bemoje/map 0.0.2 → 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/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/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
|
}
|