Skip to content

Instantly share code, notes, and snippets.

View yagoag's full-sized avatar
💻

Yago Arroyo yagoag

💻
View GitHub Profile
@yagoag
yagoag / yarn-sync.js
Created April 24, 2021 20:35 — forked from bartvanandel/yarn-sync.js
Sync versions from yarn.lock back into package.json
const fs = require("fs");
/**
* Removes matching outer quotes from a string.
*
* @param {string} text - String to unquote
* @returns {string} - Unquoted string
*/
const unquote = text => /(["'])?(.*)\1/.exec(text)[2];