UNPKG

compound-ex4

Version:

Compound-ex4 - MVC framework for NodeJS (ExpressJs 4 version), fork compoundjs(https://github.com/1602/compound)

14 lines (11 loc) 392 B
'use strict'; var object = require('es5-ext/object/valid-object') , stringifiable = require('es5-ext/object/validate-stringifiable-value') , forOf = require('es6-iterator/for-of'); module.exports = function (text, style) { var result = ''; text = stringifiable(text); object(style); forOf(text, function (char) { result += style[char] || char; }); return result; };