MCPcopy
hub / github.com/mynane/PDF / formateString

Function formateString

设计模式学习/行为设计模式/模板方法模式/Nav.js:1–5  ·  view source on GitHub ↗
(str, data)

Source from the content-addressed store, hash-verified

1function formateString(str, data){
2 return str.replace(/\{#(\w+)#\}/g, function(match, key){
3 return typeof data[key] === undefined ? '' : data[key]
4 });
5}
6
7var Nav = function (data){
8 this.item = '<a href ="{#href#}" title="{#title#}">{#name#}</a>';

Callers 3

NavFunction · 0.85
NumNavFunction · 0.85
LinkNavFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…