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 +10 -0
- package/lib/parse-link.js +8 -0
- package/lib/redput.js +2 -3
- package/package.json +1 -1
package/ChangeLog
CHANGED
|
@@ -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
|
|
10
|
+
const gistLink = parseLink(link);
|
|
12
11
|
const [error, result] = await tryToCatch(readGist, gistLink, {
|
|
13
12
|
token,
|
|
14
13
|
});
|