本文整理匯總了TypeScript中wed/dloc.DLoc.makeWithOffset方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript DLoc.makeWithOffset方法的具體用法?TypeScript DLoc.makeWithOffset怎麽用?TypeScript DLoc.makeWithOffset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類wed/dloc.DLoc
的用法示例。
在下文中一共展示了DLoc.makeWithOffset方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: before
before(() => {
parentBefore = DLoc.mustMakeDLoc(root, p.parentNode, 0);
parentAfter = parentBefore.makeWithOffset(1);
// We want to check that we are looking at the p element we think
// we are looking at.
assert.equal(parentBefore.node.childNodes[0], p);
});
示例2: it
it("returns false when the two ranges differ in start positions", () => {
const range = new DLocRange(loc, loc.makeWithOffset(1));
const range2 = new DLocRange(DLoc.mustMakeDLoc(root, a, 1),
DLoc.mustMakeDLoc(root, a, 1));
assert.isFalse(range.start.equals(range2.start));
assert.isTrue(range.end.equals(range2.end));
assert.isFalse(range.equals(range2));
});