@vnejs/helpers.split-line-keywords 0.1.1 → 0.1.2

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.
@@ -0,0 +1,6 @@
1
+ export type SplitLineKeywordsResult = {
2
+ module: string;
3
+ line: string;
4
+ keywords: string[];
5
+ };
6
+ export declare const splitLineKeywords: (text: string) => SplitLineKeywordsResult;
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ export const splitLineKeywords = (text) => {
2
+ const [, module, ...other] = text.split(" ");
3
+ const indexKeywords = other.indexOf("|");
4
+ return indexKeywords === -1
5
+ ? { module, line: other.join(" "), keywords: [] }
6
+ : {
7
+ module,
8
+ line: other.slice(0, indexKeywords).join(" "),
9
+ keywords: other.slice(indexKeywords + 1),
10
+ };
11
+ };
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "@vnejs/helpers.split-line-keywords",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
- "main": "index.js",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
6
10
  "scripts": {
7
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
+ "build": "rm -rf dist && tsc -p tsconfig.json",
8
13
  "publish:major:plugin": "npm run publish:major",
9
14
  "publish:minor:plugin": "npm run publish:minor",
10
15
  "publish:patch:plugin": "npm run publish:patch",
11
- "publish:major": "npm version major && npm publish --access public",
12
- "publish:minor": "npm version minor && npm publish --access public",
13
- "publish:patch": "npm version patch && npm publish --access public"
16
+ "publish:major": "npm run build && npm version major && npm publish --access public",
17
+ "publish:minor": "npm run build && npm version minor && npm publish --access public",
18
+ "publish:patch": "npm run build && npm version patch && npm publish --access public"
14
19
  },
15
20
  "author": "",
16
- "license": "ISC"
21
+ "license": "ISC",
22
+ "devDependencies": {
23
+ "typescript": "^6.0.3"
24
+ }
17
25
  }
package/index.js DELETED
@@ -1,8 +0,0 @@
1
- export const splitLineKeywords = (text) => {
2
- const [dollar, module, ...other] = text.split(" ");
3
- const indexKeywords = other.indexOf("|");
4
-
5
- return indexKeywords === -1
6
- ? { module, line: other.join(" "), keywords: [] }
7
- : { module, line: other.slice(0, indexKeywords).join(" "), keywords: other.slice(indexKeywords + 1) };
8
- };