@thednp/shorty 2.0.0-alpha16 → 2.0.0-alpha17
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 +3 -3
- package/dist/shorty.cjs +1 -1
- package/dist/shorty.cjs.map +1 -1
- package/dist/shorty.d.ts +11 -0
- package/dist/shorty.js +1 -1
- package/dist/shorty.js.map +1 -1
- package/dist/shorty.mjs +120 -119
- package/dist/shorty.mjs.map +1 -1
- package/package.json +66 -66
- package/src/index.ts +2 -0
- package/src/misc/ObjectFromEntries.ts +11 -0
package/package.json
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@thednp/shorty",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "TypeScript shorties for the web",
|
|
5
|
-
"source": "./src/index.ts",
|
|
6
|
-
"main": "./dist/shorty.js",
|
|
7
|
-
"module": "./dist/shorty.mjs",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/shorty.d.ts",
|
|
11
|
-
"require": "./dist/shorty.cjs",
|
|
12
|
-
"import": "./dist/shorty.mjs"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"pre-test": "npm run clean-coverage",
|
|
17
|
-
"test": "npm run pre-test && npx cypress run",
|
|
18
|
-
"clean-coverage": "rimraf coverage .nyc_output",
|
|
19
|
-
"cypress": "npm run pre-test && npx cypress open",
|
|
20
|
-
"coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --reporter=json-summary",
|
|
21
|
-
"format": "prettier --write \"src/**/*.ts\"",
|
|
22
|
-
"lint:ts": "eslint -c .eslintrc.cjs --ext .ts src",
|
|
23
|
-
"fix:ts": "eslint -c .eslintrc.cjs --ext .ts src --fix",
|
|
24
|
-
"build": "npm run lint:ts && vite build && npm run dts",
|
|
25
|
-
"dts": "dts-bundle-generator --config ./dts.config.ts"
|
|
26
|
-
},
|
|
27
|
-
"publishConfig": {
|
|
28
|
-
"access": "public",
|
|
29
|
-
"registry": "https://registry.npmjs.org/"
|
|
30
|
-
},
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/thednp/shorty.git"
|
|
34
|
-
},
|
|
35
|
-
"keywords": [
|
|
36
|
-
"shorty",
|
|
37
|
-
"javascript",
|
|
38
|
-
"typescript"
|
|
39
|
-
],
|
|
40
|
-
"author": "
|
|
41
|
-
"license": "MIT",
|
|
42
|
-
"bugs": {
|
|
43
|
-
"url": "https://github.com/thednp/shorty/issues"
|
|
44
|
-
},
|
|
45
|
-
"homepage": "https://github.com/thednp/shorty",
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
|
|
48
|
-
"@cypress/code-coverage": "^3.
|
|
49
|
-
"@types/istanbul-lib-instrument": "^1.7.4",
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
51
|
-
"@typescript-eslint/parser": "^5.
|
|
52
|
-
"cypress": "^12.
|
|
53
|
-
"dts-bundle-generator": "^8.0.1",
|
|
54
|
-
"eslint": "^8.
|
|
55
|
-
"eslint-plugin-jsdoc": "^46.4.
|
|
56
|
-
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
57
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
58
|
-
"istanbul-lib-coverage": "^3.2.0",
|
|
59
|
-
"istanbul-lib-instrument": "^5.2.1",
|
|
60
|
-
"nyc": "^15.1.0",
|
|
61
|
-
"prettier": "^2.8.8",
|
|
62
|
-
"rimraf": "^5.0.1",
|
|
63
|
-
"typescript": "^5.1.6",
|
|
64
|
-
"vite": "^4.
|
|
65
|
-
}
|
|
66
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@thednp/shorty",
|
|
3
|
+
"version": "2.0.0alpha17",
|
|
4
|
+
"description": "TypeScript shorties for the web",
|
|
5
|
+
"source": "./src/index.ts",
|
|
6
|
+
"main": "./dist/shorty.js",
|
|
7
|
+
"module": "./dist/shorty.mjs",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/shorty.d.ts",
|
|
11
|
+
"require": "./dist/shorty.cjs",
|
|
12
|
+
"import": "./dist/shorty.mjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"pre-test": "npm run clean-coverage",
|
|
17
|
+
"test": "npm run pre-test && npx cypress run",
|
|
18
|
+
"clean-coverage": "rimraf coverage .nyc_output",
|
|
19
|
+
"cypress": "npm run pre-test && npx cypress open",
|
|
20
|
+
"coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --reporter=json-summary",
|
|
21
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
22
|
+
"lint:ts": "eslint -c .eslintrc.cjs --ext .ts src",
|
|
23
|
+
"fix:ts": "eslint -c .eslintrc.cjs --ext .ts src --fix",
|
|
24
|
+
"build": "npm run lint:ts && vite build && npm run dts",
|
|
25
|
+
"dts": "dts-bundle-generator --config ./dts.config.ts"
|
|
26
|
+
},
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public",
|
|
29
|
+
"registry": "https://registry.npmjs.org/"
|
|
30
|
+
},
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/thednp/shorty.git"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"shorty",
|
|
37
|
+
"javascript",
|
|
38
|
+
"typescript"
|
|
39
|
+
],
|
|
40
|
+
"author": "thednp",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/thednp/shorty/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/thednp/shorty",
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0",
|
|
48
|
+
"@cypress/code-coverage": "^3.11.0",
|
|
49
|
+
"@types/istanbul-lib-instrument": "^1.7.4",
|
|
50
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
51
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
52
|
+
"cypress": "^12.17.4",
|
|
53
|
+
"dts-bundle-generator": "^8.0.1",
|
|
54
|
+
"eslint": "^8.47.0",
|
|
55
|
+
"eslint-plugin-jsdoc": "^46.4.6",
|
|
56
|
+
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
57
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
58
|
+
"istanbul-lib-coverage": "^3.2.0",
|
|
59
|
+
"istanbul-lib-instrument": "^5.2.1",
|
|
60
|
+
"nyc": "^15.1.0",
|
|
61
|
+
"prettier": "^2.8.8",
|
|
62
|
+
"rimraf": "^5.0.1",
|
|
63
|
+
"typescript": "^5.1.6",
|
|
64
|
+
"vite": "^4.4.9"
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -185,6 +185,7 @@ import ObjectEntries from './misc/ObjectEntries';
|
|
|
185
185
|
import ObjectHasOwn from './misc/ObjectHasOwn';
|
|
186
186
|
import ObjectKeys from './misc/ObjectKeys';
|
|
187
187
|
import ObjectValues from './misc/ObjectValues';
|
|
188
|
+
import ObjectFromEntries from './misc/ObjectFromEntries';
|
|
188
189
|
import createCustomEvent from './misc/createCustomEvent';
|
|
189
190
|
import passiveHandler from './misc/passiveHandler';
|
|
190
191
|
import reflow from './misc/reflow';
|
|
@@ -455,6 +456,7 @@ export {
|
|
|
455
456
|
ObjectEntries,
|
|
456
457
|
ObjectKeys,
|
|
457
458
|
ObjectValues,
|
|
459
|
+
ObjectFromEntries,
|
|
458
460
|
getBoundingClientRect,
|
|
459
461
|
getDocument,
|
|
460
462
|
getDocumentBody,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortcut for `Object.fromEntries()` static method.
|
|
3
|
+
*
|
|
4
|
+
* @param entries a target entries object
|
|
5
|
+
* @returns a new Object created from the specified entries in array format [key, value][]
|
|
6
|
+
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
7
|
+
*/
|
|
8
|
+
const ObjectFromEntries = <K extends string, V>(entries: [K, V][]) =>
|
|
9
|
+
Object.fromEntries(entries) as Record<K, V>;
|
|
10
|
+
|
|
11
|
+
export default ObjectFromEntries;
|