object
@bb-cli/portal-model : Load And Manipulate Model Xml Data
Example
import { fromXml, name }from '@bb-cli/portal-model';
console.log(`name is ${name(fromXml(fs.readFileSync('model.xml')))}`);
-
@bb-cli/portal-model :
object
-
~type(model) ⇒
string
-
~fromXml(xml) ⇒
object
-
~toXml(model) ⇒
string
-
~name(model) ⇒
string
-
~getPropertyValue(name, model) ⇒
string
-
~setProperty(propertyName, value, options, model) ⇒
object
-
~deleteProperty(propertyName, model) ⇒
object
-
~type(model) ⇒
string
@bb-cli/portal-model~type(model) ⇒ Extract catalog type from XML object.
Kind: inner method of @bb-cli/portal-model
Param | Type |
---|---|
model | object |
object
@bb-cli/portal-model~fromXml(xml) ⇒ Convert XML string to JS representation (using jxon).
Kind: inner method of @bb-cli/portal-model
Param | Type | Description |
---|---|---|
xml | string |
Model xml |
string
@bb-cli/portal-model~toXml(model) ⇒ Convert js object to XML
Kind: inner method of @bb-cli/portal-model
Returns: string
- model XML
Param | Type | Description |
---|---|---|
model | object |
XML object |
string
@bb-cli/portal-model~name(model) ⇒ Extract name from XML object.
Kind: inner method of @bb-cli/portal-model
Param | Type |
---|---|
model | object |
string
@bb-cli/portal-model~getPropertyValue(name, model) ⇒ Get the value of a property.
Kind: inner method of @bb-cli/portal-model
Param | Type |
---|---|
name | string |
model | object |
object
@bb-cli/portal-model~setProperty(propertyName, value, options, model) ⇒ Set the value & options of a property.
Kind: inner method of @bb-cli/portal-model
Returns: object
- Updated model
Param | Type |
---|---|
propertyName | string |
value | string |
options | object |
model | object |
object
@bb-cli/portal-model~deleteProperty(propertyName, model) ⇒ Delete a property.
Kind: inner method of @bb-cli/portal-model
Returns: object
- Updated model
Param | Type |
---|---|
propertyName | string |
model | object |