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