Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@changesets/parse

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@changesets/parse - npm Package Compare versions

Comparing version 0.3.7 to 0.3.8

7

CHANGELOG.md
# @changesets/parse
## 0.3.8
### Patch Changes
- Updated dependencies [[`de2b4a5`](https://github.com/atlassian/changesets/commit/de2b4a5a7b244a37d94625bcb70ecde9dde5b612)]:
- @changesets/types@4.0.0
## 0.3.7

@@ -4,0 +11,0 @@

8

dist/parse.cjs.dev.js

@@ -5,6 +5,8 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var yaml = require('js-yaml');
var yaml = _interopDefault(require('js-yaml'));
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var yaml__default = /*#__PURE__*/_interopDefault(yaml);
const mdRegex = /\s*---([^]*?)\n\s*---\s*\n([^]*)/;

@@ -23,3 +25,3 @@ function parseChangesetFile(contents) {

try {
const yamlStuff = yaml.safeLoad(roughReleases);
const yamlStuff = yaml__default['default'].safeLoad(roughReleases);

@@ -26,0 +28,0 @@ if (yamlStuff) {

"use strict";
function _interopDefault(ex) {
return ex && "object" == typeof ex && "default" in ex ? ex.default : ex;
}
Object.defineProperty(exports, "__esModule", {

@@ -11,4 +7,12 @@ value: !0

var yaml = _interopDefault(require("js-yaml"));
var yaml = require("js-yaml");
function _interopDefault(e) {
return e && e.__esModule ? e : {
default: e
};
}
var yaml__default = _interopDefault(yaml);
const mdRegex = /\s*---([^]*?)\n\s*---\s*\n([^]*)/;

@@ -18,14 +22,14 @@

const execResult = mdRegex.exec(contents);
if (!execResult) throw new Error(`could not parse changeset - invalid frontmatter: ${contents}`);
if (!execResult) throw new Error("could not parse changeset - invalid frontmatter: " + contents);
let releases, [, roughReleases, roughSummary] = execResult, summary = roughSummary.trim();
try {
const yamlStuff = yaml.safeLoad(roughReleases);
releases = yamlStuff ? Object.entries(yamlStuff).map(([name, type]) => ({
const yamlStuff = yaml__default.default.safeLoad(roughReleases);
releases = yamlStuff ? Object.entries(yamlStuff).map((([name, type]) => ({
name: name,
type: type
})) : [];
}))) : [];
} catch (e) {
throw new Error(`could not parse changeset - invalid frontmatter: ${contents}`);
throw new Error("could not parse changeset - invalid frontmatter: " + contents);
}
if (!releases) throw new Error(`could not parse changeset - unknown error: ${contents}`);
if (!releases) throw new Error("could not parse changeset - unknown error: " + contents);
return {

@@ -32,0 +36,0 @@ releases: releases,

{
"name": "@changesets/parse",
"version": "0.3.7",
"version": "0.3.8",
"description": "Parse a changeset file's contents into a usable json object",

@@ -8,5 +8,5 @@ "main": "dist/parse.cjs.js",

"license": "MIT",
"repository": "https://github.com/changesets/changesets/tree/master/packages/parse",
"repository": "https://github.com/changesets/changesets/tree/main/packages/parse",
"dependencies": {
"@changesets/types": "^3.0.0",
"@changesets/types": "^4.0.0",
"js-yaml": "^3.13.1"

@@ -13,0 +13,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc