redput 1.4.0 → 1.5.1

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/ChangeLog CHANGED
@@ -1,3 +1,13 @@
1
+ 2023.08.21, v1.5.1
2
+
3
+ fix:
4
+ - c0511bf redput: parseLink
5
+
6
+ 2023.08.17, v1.5.0
7
+
8
+ feature:
9
+ - 4cebd14 redput: add support of Mobile Putout Editor
10
+
1
11
  2023.08.16, v1.4.0
2
12
 
3
13
  feature:
@@ -0,0 +1,8 @@
1
+ export const PUTOUT_EDITOR = 'https://putout.cloudcmd.io/#/gist/';
2
+ export const MOBILE_PUTOUT_EDITOR = 'https://putout.vercel.app/#/gist/';
3
+
4
+ export const parseLink = (link) => {
5
+ return link
6
+ .replace(PUTOUT_EDITOR, '')
7
+ .replace(MOBILE_PUTOUT_EDITOR, '');
8
+ };
package/lib/redput.js CHANGED
@@ -2,13 +2,12 @@ import tryToCatch from 'try-to-catch';
2
2
  import {getReport} from './get-report/get-report.js';
3
3
  import {readGist} from './read-gist/read-gist.js';
4
4
  import {writePlugin} from './write/index.js';
5
+ import {parseLink} from './parse-link.js';
5
6
 
6
7
  const SUCCESS = [null, 'Done'];
7
8
 
8
- const URL = 'https://putout.cloudcmd.io/#/gist/';
9
-
10
9
  export const redput = async (link, {token}) => {
11
- const gistLink = link.replace(URL, '');
10
+ const gistLink = parseLink(link);
12
11
  const [error, result] = await tryToCatch(readGist, gistLink, {
13
12
  token,
14
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redput",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "CLI tool to convert source from 🐊Putout Editor to files",
5
5
  "main": "lib/redput.js",
6
6
  "bin": {