本文整理汇总了TypeScript中dom5.predicates.NOT方法的典型用法代码示例。如果您正苦于以下问题:TypeScript predicates.NOT方法的具体用法?TypeScript predicates.NOT怎么用?TypeScript predicates.NOT使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dom5.predicates
的用法示例。
在下文中一共展示了predicates.NOT方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _moveUnhiddenHtmlImportsIntoHiddenDiv
/**
* Move any remaining htmlImports that are not inside the hidden div
* already, into the hidden div.
*/
private _moveUnhiddenHtmlImportsIntoHiddenDiv(ast: ASTNode) {
const unhiddenHtmlImports = dom5.queryAll(
ast,
dom5.predicates.AND(
matchers.eagerHtmlImport,
dom5.predicates.NOT(matchers.inHiddenDiv)));
for (const htmlImport of unhiddenHtmlImports) {
removeElementAndNewline(htmlImport);
dom5.append(this._findOrCreateHiddenDiv(ast), htmlImport);
}
}
示例2:
// jshint node: true
'use strict';
import constants from './constants';
import {predicates} from 'dom5';
import * as parse5 from 'parse5';
export interface Matcher { (node: parse5.ASTNode): boolean; }
// TODO(aomarks) Look at what's using this matcher. A number of code paths
// should probably not be excluding type=module scripts.
export const nonModuleScript: Matcher = predicates.AND(
predicates.hasTagName('script'),
predicates.OR(
predicates.NOT(predicates.hasAttr('type')),
predicates.hasAttrValue('type', 'text/javascript'),
predicates.hasAttrValue('type', 'application/javascript')));
export const moduleScript: Matcher = predicates.AND(
predicates.hasTagName('script'), predicates.hasAttrValue('type', 'module'));
export const externalStyle: Matcher = predicates.AND(
predicates.hasTagName('link'),
predicates.hasAttrValue('rel', 'stylesheet'));
// polymer specific external stylesheet
export const polymerExternalStyle: Matcher = predicates.AND(
predicates.hasTagName('link'),
predicates.hasAttrValue('rel', 'import'),
predicates.hasAttrValue('type', 'css'));