本文整理汇总了TypeScript中vs/platform/configuration/common/configurationModels.ConfigurationModel类的典型用法代码示例。如果您正苦于以下问题:TypeScript ConfigurationModel类的具体用法?TypeScript ConfigurationModel怎么用?TypeScript ConfigurationModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ConfigurationModel类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: test
test('simple merge', () => {
let base = new ConfigurationModel({ 'a': 1, 'b': 2 }, ['a', 'b']);
let add = new ConfigurationModel({ 'a': 3, 'c': 4 }, ['a', 'c']);
let result = base.merge(add);
assert.deepEqual(result.contents, { 'a': 3, 'b': 2, 'c': 4 });
assert.deepEqual(result.keys, ['a', 'b', 'c']);
});
开发者ID:eamodio,项目名称:vscode,代码行数:8,代码来源:configurationModels.test.ts
示例2: test
test('removeValue: remove a multi segemented key', () => {
let testObject = new ConfigurationModel({ 'a': { 'b': 1 } }, ['a.b']);
testObject.removeValue('a.b');
assert.deepEqual(testObject.contents, {});
assert.deepEqual(testObject.keys, []);
});
开发者ID:AlexxNica,项目名称:sqlopsstudio,代码行数:8,代码来源:configurationModels.test.ts
示例3: test
test('removeValue: remove a single segmented key', () => {
let testObject = new ConfigurationModel({ 'a': 1 }, ['a']);
testObject.removeValue('a');
assert.deepEqual(testObject.contents, {});
assert.deepEqual(testObject.keys, []);
});
开发者ID:PKRoma,项目名称:vscode,代码行数:8,代码来源:configurationModels.test.ts
示例4: test
test('setValueInOverrides adds a nested key to overrides if exist', () => {
let testObject = new ConfigurationModel({ 'a': 1, 'b': 1 }, ['a'], [{ identifiers: ['or'], contents: { 'a': { 'c': 1 } } }]);
testObject.setValueInOverrides('or', 'a.c', 2);
assert.deepEqual(testObject.overrides[0].contents, { 'a': { 'c': 2 } });
assert.deepEqual(testObject.override('or').contents, { 'a': { 'c': 2 }, 'b': 1 });
});
开发者ID:gokulakrishna9,项目名称:vscode,代码行数:8,代码来源:configurationModels.test.ts
示例5: test
test('recursive merge', () => {
let base = new ConfigurationModel({ 'a': { 'b': 1 } }, ['a.b']);
let add = new ConfigurationModel({ 'a': { 'b': 2 } }, ['a.b']);
let result = base.merge(add);
assert.deepEqual(result.contents, { 'a': { 'b': 2 } });
assert.deepEqual(result.getValue('a'), { 'b': 2 });
assert.deepEqual(result.keys, ['a.b']);
});
开发者ID:VishalMadhvani,项目名称:vscode,代码行数:9,代码来源:configurationModels.test.ts
示例6: test
test('setValueInOverrides adds new overrides if exist', () => {
let testObject = new ConfigurationModel({ 'a': 1, 'b': 1 }, ['a'], [{ identifiers: ['or1'], contents: { 'a': 2 } }]);
testObject.setValueInOverrides('or2', 'b', 2);
assert.deepEqual(testObject.overrides[0].contents, { 'a': 2 });
assert.deepEqual(testObject.overrides[1].contents, { 'b': 2 });
assert.deepEqual(testObject.override('or1').contents, { 'a': 2, 'b': 1 });
assert.deepEqual(testObject.override('or2').contents, { 'a': 1, 'b': 2 });
});
开发者ID:SeanKilleen,项目名称:vscode,代码行数:10,代码来源:configurationModels.test.ts
注:本文中的vs/platform/configuration/common/configurationModels.ConfigurationModel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论