本文整理匯總了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);
};