本文整理汇总了TypeScript中tinymce/core/api/util/JSON.serialize函数的典型用法代码示例。如果您正苦于以下问题:TypeScript serialize函数的具体用法?TypeScript serialize怎么用?TypeScript serialize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了serialize函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: function
suite.test('serialize', function () {
LegacyUnit.equal(
Json.serialize({
arr1: [1, 2, 3, [1, 2, 3]],
bool1: true,
float1: 3.14,
int1: 123,
null1: null,
obj1: { key1: 'val1', key2: 'val2' }, str1: '\"\'abc\u00C5123\\'
}
),
'{"arr1":[1,2,3,[1,2,3]],"bool1":true,"float1":3.14,"int1":123,"null1":null,' +
'"obj1":{"key1":"val1","key2":"val2"},"str1":"\\"\'abc\\u00c5123\\\\"}'
);
LegacyUnit.equal(
Json.serialize({
arr1: [1, 2, 3, [1, 2, 3]],
bool1: true,
float1: 3.14,
int1: 123,
null1: null,
obj1: { key1: 'val1', key2: 'val2' }, str1: '\"\'abc\u00C5123'
}, '\''
),
'{\'arr1\':[1,2,3,[1,2,3]],\'bool1\':true,\'float1\':3.14,\'int1\':123,\'null1\':null,' +
'\'obj1\':{\'key1\':\'val1\',\'key2\':\'val2\'},\'str1\':\'\\"\\\'abc\\u00c5123\'}'
);
});
开发者ID:abstask,项目名称:tinymce,代码行数:29,代码来源:JsonTest.ts
示例2: function
suite.test('serialize', function () {
LegacyUnit.equal(
JSON.serialize({
'arr1': [1, 2, 3, [1, 2, 3]],
'bool1': true,
'float1': 3.14,
'int1': 123,
'null1': null,
'obj1': { key1: 'val1', key2: 'val2' },
'\"obj2': { key1: undefined },
'str1': '\"\'abc\u00C5123\\',
'date1': new Date(0)
}
),
'{"arr1":[1,2,3,[1,2,3]],"bool1":true,"float1":3.14,"int1":123,"null1":null,' +
'"obj1":{"key1":"val1","key2":"val2"},"\\"obj2":{},"str1":"\\"\'abc\\u00c5123\\\\",' +
'"date1":"1970-01-01T00:00:00.000Z"}'
);
});
开发者ID:tinymce,项目名称:tinymce,代码行数:19,代码来源:JsonTest.ts
示例3: function
suite.test('mceInsertRawHTML - insert char at char surrounded by spaces', function (editor) {
editor.setContent('<p>a b c</p>');
LegacyUnit.setSelection(editor, 'p', 2, 'p', 3);
editor.execCommand('mceInsertRawHTML', false, '<strong>X</strong>');
LegacyUnit.equal(JSON.serialize(editor.getContent()), '"<p>a <strong>X</strong> c</p>"');
});
开发者ID:tinymce,项目名称:tinymce,代码行数:6,代码来源:InsertContentCommandTest.ts
注:本文中的tinymce/core/api/util/JSON.serialize函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论