本文整理汇总了TypeScript中vs/base/common/objects.equals函数的典型用法代码示例。如果您正苦于以下问题:TypeScript equals函数的具体用法?TypeScript equals怎么用?TypeScript equals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了equals函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: set
set(text: string, highlights: IHighlight[] = []) {
if (!text) {
text = '';
}
if (this.didEverRender && this.text === text && objects.equals(this.highlights, highlights)) {
return;
}
if (!Array.isArray(highlights)) {
highlights = [];
}
this.text = text;
this.highlights = highlights;
this.render();
}
示例2: set
set(text: string, highlights: IHighlight[] = [], title: string = '', escapeNewLines?: boolean) {
if (!text) {
text = '';
}
if (escapeNewLines) {
// adjusts highlights inplace
text = HighlightedLabel.escapeNewLines(text, highlights);
}
if (this.didEverRender && this.text === text && this.title === title && objects.equals(this.highlights, highlights)) {
return;
}
if (!Array.isArray(highlights)) {
highlights = [];
}
this.text = text;
this.title = title;
this.highlights = highlights;
this.render();
}
示例3: areSame
private static areSame(a: Matches, b: Matches): boolean {
if (a === b || (!a && !b)) {
return true;
}
return !!a && !!b && equals(a.firstPart, b.firstPart) && equals(a.chordPart, b.chordPart);
}
示例4: assert
let check = (one: any, other: any, msg: string) => {
assert(objects.equals(one, other), msg);
assert(objects.equals(other, one), '[reverse] ' + msg);
};