(...params)
| 36 | // resolveVariable(scope, variableName) -> Tries to get the variable under specific scope |
| 37 | // Variable name can be stringified object path or a regular string, i.e -> text.color |
| 38 | resolveVariable(...params) { |
| 39 | if (arguments.length === 1) { |
| 40 | const variablePath = _.split(params[0], '.'); |
| 41 | |
| 42 | return _.get(this.variables, variablePath); |
| 43 | } |
| 44 | |
| 45 | if (arguments.length === 2) { |
| 46 | return this.getScopedVariable(params[0], params[1]); |
| 47 | } |
| 48 | |
| 49 | throw new Error( |
| 50 | "Invalid theme variable resolution call. Please use full signature \n-> resolveVariable(scope, variableName),\n or the shorthand if you're getting a variable from shoutem.theme extension \n->resolveVariable(variableName)", |
| 51 | ); |
| 52 | } |
| 53 | |
| 54 | createScopedResolver(scope) { |
| 55 | return (...params) => { |
nothing calls this directly
no test coverage detected