Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@bpmn-io/moddle-utils
Advanced tools
[![CI](https://github.com/bpmn-io/moddle-utils/workflows/CI/badge.svg)](https://github.com/bpmn-io/moddle-utils/actions?query=workflow%3ACI)
Utils for moddle. 🛠️
getPath
import { getPath } from '@bpmn-io/moddle-utils';
// global
getPath(moddleElement); // [ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ]
// local
getPath(moddleElement, parentModdleElement); // [ 'extensionElements', 'values', 0 ]
// $parent === undefined
const task = moddle.create('bpmn:Task');
getPath(task); // null
// null
getPath(null); // null
pathConcat
import { pathConcat } from '@bpmn-io/moddle-utils';
pathConcat([ 'foo', 'bar' ], 'baz'); // [ 'foo', 'bar', 'baz' ]
// null
pathConcat([ 'foo', 'bar' ], null); // null
pathEquals
import { pathEquals } from '@bpmn-io/moddle-utils';
// default separator
pathEquals('extensionElements.values.0.type', 'extensionElements.values.0.type'); // true
pathEquals([ 'extensionElements', 'values', 0 ], [ 'extensionElements', 'values', 0 ]); // true
// custom separator
pathEquals('extensionElements-values-0-type', 'extensionElements-values-0-type', '-'); // true
// null
pathEquals(null, [ 'foo' ]); // false
parsePath
import { parsePath } from '@bpmn-io/moddle-utils';
// default separator
parsePath('rootElements.0.flowElements.0.extensionElements.values.0.type'); // [ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ]
// custom separator
parsePath('rootElements-0-flowElements-0-extensionElements-values-0-type', '-'); // [ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ]
// null
parsePath(null); // null
stringifyPath
import { stringifyPath } from '@bpmn-io/moddle-utils';
// default separator
stringifyPath([ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ]); // 'rootElements.0.flowElements.0.extensionElements.values.0.type'
// custom separator
stringifyPath([ 'rootElements', 0, 'flowElements', 0, 'extensionElements', 'values', 0 ], '-'); // 'rootElements-0-flowElements-0-extensionElements-values-0-type'
// null
stringifyPath(null); // null
MIT
0.2.0
DEPS
: update to min-dash@4.1.1
FAQs
[![CI](https://github.com/bpmn-io/moddle-utils/workflows/CI/badge.svg)](https://github.com/bpmn-io/moddle-utils/actions?query=workflow%3ACI)
The npm package @bpmn-io/moddle-utils receives a total of 3,061 weekly downloads. As such, @bpmn-io/moddle-utils popularity was classified as popular.
We found that @bpmn-io/moddle-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.