Socket
Socket
Sign inDemoInstall

@philippfromme/moddle-helpers

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@philippfromme/moddle-helpers - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

4

CHANGELOG.md

@@ -9,2 +9,6 @@ # Changelog

## 0.4.0
* `FEAT`: handle `null` and `undefined` paths ([`49651c`](https://github.com/philippfromme/moddle-helpers/commit/49651c16b359829e3639f10da683dc665e11f886))
## 0.3.0

@@ -11,0 +15,0 @@

const {
isNil,
isString
isString,
isUndefined
} = require('min-dash');

@@ -82,3 +83,3 @@

for (let path of paths) {
if (isNil(path)) {
if (isNil(path) || isUndefined(path)) {
return null;

@@ -105,2 +106,6 @@ }

module.exports.pathEquals = function(a, b, separator = '.') {
if (isNil(a) || isUndefined(a) || isNil(b) || isUndefined(b)) {
return false;
}
if (!isString(a)) {

@@ -124,2 +129,6 @@ a = pathStringify(a, separator);

module.exports.pathParse = function(path, separator = '.') {
if (isNil(path) || isUndefined(path)) {
return null;
}
return path

@@ -137,2 +146,6 @@ .split(separator)

function pathStringify(path, separator = '.') {
if (isNil(path) || isUndefined(path)) {
return null;
}
return path.join(separator);

@@ -139,0 +152,0 @@ }

2

package.json
{
"name": "@philippfromme/moddle-helpers",
"version": "0.3.0",
"version": "0.4.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -18,8 +18,9 @@ # moddle-helpers

// null
const task = moddle.create('bpmn:Task'); // task.$parent === undefined
// $parent === undefined
const task = moddle.create('bpmn:Task');
getPath(task); // null
getPath(undefined); // null
// null
getPath(null); // null
```

@@ -34,2 +35,3 @@

// null
pathConcat([ 'foo', 'bar' ], null); // null

@@ -49,3 +51,6 @@ ```

// custom separator
parsePath('extensionElements-values-0-type', 'extensionElements-values-0-type', '-'); // true
pathEquals('extensionElements-values-0-type', 'extensionElements-values-0-type', '-'); // true
// null
pathEquals(null, [ 'foo' ]); // false
```

@@ -63,2 +68,5 @@

parsePath('rootElements-0-flowElements-0-extensionElements-values-0-type', '-'); // [ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ]
// null
parsePath(null); // null
```

@@ -76,2 +84,5 @@

stringifyPath([ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ], '-'); // 'rootElements-0-flowElements-0-extensionElements-values-0-type'
// null
stringifyPath(null); // null
```

@@ -78,0 +89,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