本文整理匯總了TypeScript中@delon/util.deepCopy函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript deepCopy函數的具體用法?TypeScript deepCopy怎麽用?TypeScript deepCopy使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了deepCopy函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should be has $items when is array', () => {
const schema = deepCopy(arrSchema) as SFSchema;
schema.properties.name.ui = deepCopy(arrUI);
page
.newSchema(schema)
.checkUI('/name', 'grid.arraySpan', arrUI.grid.arraySpan);
});
示例2: it
it('should be set default value', () => {
const schema = deepCopy(SCHEMA.user) as SFSchema;
schema.properties.name.default = 'cipchk';
page
.newSchema(schema)
.reset()
.checkValue('/name', 'cipchk');
});
示例3: it
it('with false', () => {
const s = deepCopy(schema) as SFSchema;
s.properties.arr.ui = { removable: false };
page
.newSchema(s)
.checkCount('.sf-array-item', 0)
.add()
.checkCount('.sf-array-item', 1)
.checkCount(`.sf-array-container [data-index="0"] .remove`, 0);
});
示例4: it
it(`should be unix timestamp when is date param`, (done: () => void) => {
const p = Object.assign(deepCopy(PARAMS), { time, date: new Date() });
http.get(URL, p).subscribe(res => {
expect(res).toBe(OK);
done();
});
const ret = backend.expectOne(
req => req.method === 'GET' && req.url === URL,
) as TestRequest;
// tslint:disable-next-line:forin
for (const key in p) {
let v = p[key];
if (v instanceof Date) v = v.valueOf();
expect(ret.request.params.get(key)).toBe(
v,
`param "${key}" muse be "${v}"`,
);
}
ret.flush(OK);
});