本文整理汇总了TypeScript中@core/parser/exports.mask_stringify函数的典型用法代码示例。如果您正苦于以下问题:TypeScript mask_stringify函数的具体用法?TypeScript mask_stringify怎么用?TypeScript mask_stringify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mask_stringify函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: parser_parse
.forEach(data => {
var {template} = data;
debugger;
var nodes = parser_parse(template);
var str = mask_stringify(nodes);
eq_(str, template);
})
示例2: function
serializeNodes: function(){
var arr = [], i, x;
if (this.importItems == null || this.importItems.length === 0) {
i = this.nodes.length;
while( --i > -1 ){
x = this.nodes[i];
if (x.tagName === IMPORT) {
arr.unshift(x);
}
}
}
else {
i = this.importItems.length;
while( --i > -1 ){
x = this.importItems[i];
if (x.module && x.module.stringifyImport) {
var result = x.module.stringifyImport(x.node);
if (result != null) {
arr.unshift(result);
}
continue;
}
arr.unshift(x.node);
}
}
return mask_stringify(arr);
},
示例3: mask_stringify
.forEach(parts => {
if (parts.length < 2)
return;
var [ mask, expect ] = parts;
var str = mask_stringify(mask, opts);
eq_(str, expect.replace(/\r\n/g, '\n'));
});
示例4: parser_parse
.forEach(str => {
var node = parser_parse(str);
eq_(node.tagName, 'div');
deepEq_(node.props, { 'style.baz': 'green' });
eq_(node.type, Dom.NODE);
var back = mask_stringify(node);
eq_(back, `div [style.baz] = green;`);
})
示例5: function
serializeNodes: function(current){
var nodes = [ current ];
while (true) {
current = current.nextSibling;
if (current == null || current.tagName !== 'else') {
break;
}
nodes.push(current);
}
return mask_stringify(nodes);
}
示例6: function
'tag not closed warning': function(){
var fragment = parser_parse(`
foo {
bar { foo
baz { some }
}
`)
var error = errors.pop();
has_(error.message, 'Tag was not closed: bar')
eq_(mask_stringify(fragment), 'foo>bar>foo baz>some;');
},
示例7: function
.done(function(str) {
// remove all remote styles
var ast = mask_TreeWalker.walk(str, function(node){
if (node.tagName === 'link' && node.attr.href) {
return { remove: true };
}
});
ast = jMask('module')
.attr('path', path)
.append(ast);
var str = mask_stringify(ast[0], {
indent: opts.minify ? 0 : 4
});
resolve(str);
});
示例8: eq_
[Colorize]
div;
`);
var nodes = ast.nodes;
eq_(nodes.length, 2);
eq_(nodes[0].expression, 'Colorize');
eq_(nodes[0].type, Dom.DECORATOR);
eq_(nodes[1].tagName, 'div');
eq_(nodes[1].type, Dom.NODE);
'> serialize'
var str = mask_stringify(ast);
eq_(str, '[Colorize]div;')
},
'should parse multiple decorators' () {
var template = `
[RedBackground]
[GreenColor]
div > 'Hello';
`;
var ast = parser_parse(template);
var nodes = ast.nodes;
eq_(nodes.length, 3);
eq_(nodes[0].expression, 'RedBackground');
eq_(nodes[0].type, Dom.DECORATOR);