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

sls-yaml

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sls-yaml - npm Package Compare versions

Comparing version 1.0.11 to 1.0.12

24

dist/index.js

@@ -35,3 +35,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

/******/ // eslint-disable-next-line no-unused-vars
/******/ var hotCurrentHash = "b4c26dc2f92d49fe5c1d";
/******/ var hotCurrentHash = "681b9e457b43d59a72c6";
/******/ var hotRequestTimeout = 10000;

@@ -781,2 +781,3 @@ /******/ var hotCurrentModuleData = {};

var path = __webpack_require__("path");
var spawnSync = __webpack_require__("child_process").spawnSync;
var get = __webpack_require__("lodash.get");

@@ -809,2 +810,16 @@

},
git: function (name) {
var cmds;
switch (name) {
case "branch":
cmds = ["rev-parse", "--abbrev-ref", "HEAD"];
break;
case "sha1":
cmds = ["rev-parse", "HEAD"];
break;
}
var result = spawnSync("git", cmds);
var output = result.output.toString().replace(/,|\n/gi, "");
return output;
},
env: function (name) {

@@ -1122,2 +1137,9 @@ return process.env[name];

/***/ "child_process":
/***/ (function(module, exports) {
module.exports = require("child_process");
/***/ }),
/***/ "fs":

@@ -1124,0 +1146,0 @@ /***/ (function(module, exports) {

2

package.json
{
"name": "sls-yaml",
"version": "1.0.11",
"version": "1.0.12",
"description": "Serverless framework yaml extension parser",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

const fs = require("fs");
const path = require("path");
const { spawnSync } = require("child_process");
const get = require("lodash.get");

@@ -34,2 +35,16 @@ import readYamlSync from "./sls-yaml";

},
git: (name: string) => {
let cmds;
switch (name) {
case "branch":
cmds = ["rev-parse", "--abbrev-ref", "HEAD"];
break;
case "sha1":
cmds = ["rev-parse", "HEAD"];
break;
}
const result = spawnSync("git", cmds);
const output = result.output.toString().replace(/,|\n/gi, "");
return output;
},
env: (name: string) => {

@@ -36,0 +51,0 @@ return process.env[name];

@@ -341,3 +341,18 @@ import yaml from "./sls-yaml";

});
describe("When passing a git:branch command", () => {
it("Should return result of command", () => {
const content = Buffer.from("branch: ${git:branch}");
const result = yaml(content);
expect(result).toEqual({ branch: "master" });
});
});
describe("When passing a git:sha1 command", () => {
it("Should return result of command", () => {
const content = Buffer.from("sha1: ${git:sha1}");
const result = yaml(content);
expect(result.sha1).toBeDefined();
});
});
});
});

Sorry, the diff of this file is not supported yet

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