![From Academia to Industry](https://cdn.sanity.io/images/cgdhsj6q/production/70501690bf807891573e259da9719cf24302c7e3-4288x2848.jpg?w=400&fit=max&auto=format)
Employee Spotlight
From Academia to Industry
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
@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)
Changelog
0.1.0
FEAT
: initial version :tada:Readme
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
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 5,328 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.
Employee Spotlight
Philipp Burckhardt recounts his journey from childhood computer fascinations, to building an e-learning platform at Carnegie Mellon University, and on to his current role at Socket.
Security News
Git dependencies in open source packages can introduce significant risks, including lack of version control, stability issues, dependency drift, and difficulty in auditing, making them potential targets for supply chain attacks.
Security News
Node.js has added experimental support for TypeScript, a move that highlights the growing importance of TypeScript in modern development.