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

yaml-edit

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

yaml-edit - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

8

index.js

@@ -82,2 +82,10 @@ 'use strict';

},
hasKey: (place) => {
const parts = search(place);
if (parts[1].length == 0) {
return false;
} else {
return true;
}
},
insertChild: (place, doc) => {

@@ -84,0 +92,0 @@ let parts = search(place);

2

package.json
{
"name": "yaml-edit",
"version": "0.1.2",
"version": "0.1.3",
"description": "Library for editing yaml files",

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

@@ -39,2 +39,6 @@ # yaml-edit

### Checking whether a key already exists
Existance of a key can be checked with the `hasKey(string target)` method. Returns true if the key is found, false otherwise.
### Getting the resulting YAML string

@@ -41,0 +45,0 @@

@@ -83,2 +83,14 @@ 'use strict';

it('hasKey() returns true for existing key', (done) => {
yamlEdit.init(sampleYaml);
expect(yamlEdit.hasKey('functions.hello')).to.be.equal(true);
done();
});
it('hasKey() returns false for non-existing key', (done) => {
yamlEdit.init(sampleYaml);
expect(yamlEdit.hasKey('functions.non-existing')).to.be.equal(false);
done();
});
it('insertChild (deeper level)', (done) => {

@@ -85,0 +97,0 @@ yamlEdit.init(sampleYaml);

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