0.2.7 • Published 9 years ago

toybox-js-parse-variables v0.2.7

Weekly downloads
3
License
X11
Repository
-
Last release
9 years ago

Convert variables inside %{} markers within strings to functions that return interpolated variables.

Functions

parseData(data, sourceData, templates, defaults, contextPath) ⇒ Object

Recursively replaces %{variable} references with functions Returns the transformed data object

Kind: global function

ParamType
dataObject
sourceDataObject
templatesObject
defaultsObject
contextPathString

parseString(string, sourceData, templates, defaults, contextPath) ⇒ Object

Recursively replace instances of %{somevariable} in a string Returns a string or a function that interpolates variables

Kind: global function

ParamType
stringString
sourceDataObject
templatesObject
defaultsObject
contextPathString

interpolateVar(varName, sourceData, templates, defaults, contextPath) ⇒ Object

Given a variable name and source data, returns the closest matching value in source data, or an empty string

Kind: global function

ParamType
varNameString
sourceDataObject
templatesObject
defaultsObject
contextPathString
0.2.7

9 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago