diff --git a/tcomb/tcomb-tests.ts b/tcomb/tcomb-tests.ts index 19ca39b3aa..3a27ffc7fe 100644 --- a/tcomb/tcomb-tests.ts +++ b/tcomb/tcomb-tests.ts @@ -256,9 +256,9 @@ describe('update', function () { } }); - assert.strictEqual(updated[0], instance[0]); - assert.notStrictEqual(updated[1], instance[1]); - assert.strictEqual(updated[1].c, instance[1].c); + assert.strictEqual(( updated)[0], ( instance)[0]); + assert.notStrictEqual(( updated)[1], ( instance)[1]); + assert.strictEqual(( updated)[1].c, ( instance)[1].c); }); }); @@ -1328,8 +1328,8 @@ describe('tuple', function () { it('should coerce values', function () { var t = T([{}, {}]); - ok(S.is(t[0])); - ok(S.is(t[1])); + ok(S.is(( t)[0])); + ok(S.is(( t)[1])); }); it('should accept only valid values', function () { @@ -1381,8 +1381,8 @@ describe('tuple', function () { it('should return a new instance', function () { var newInstance = Type.update(instance, {0: {$set: 'b'}}); assert(Type.is(newInstance)); - assert(instance[0] === 'a'); - assert(newInstance[0] === 'b'); + assert(( instance)[0] === 'a'); + assert(( newInstance)[0] === 'b'); }); }); @@ -1418,7 +1418,7 @@ describe('list', function () { it('should coerce values', function () { var t = T([{}]); - ok(S.is(t[0])); + ok(S.is(( t)[0])); }); it('should accept only valid values', function () { diff --git a/tcomb/tcomb.d.ts b/tcomb/tcomb.d.ts index 91add803a9..1c8825061e 100644 --- a/tcomb/tcomb.d.ts +++ b/tcomb/tcomb.d.ts @@ -1,10 +1,13 @@ // Type definitions for tcomb v1.0.3 // Project: http://gcanti.github.io/tcomb/guide/index.html -// Definitions by: Jed Mao and Hans Windhoff +// Definitions by: Jed Mao +// and Hans Windhoff // Definitions: https://github.com/borisyankov/DefinitelyTyped - declare module TComb { + export interface NumbersOnly { + [idx:number]:string; + } export interface tcomb { format: (format: string, ...values: any[]) => string; getFunctionName: (fn: Function) => string; @@ -12,7 +15,7 @@ declare module TComb { mixin: (target: {}, source: {}, overwrite?: boolean) => any; slice: typeof Array.prototype.slice; shallowCopy: (x: TCombBase) => TCombBase; - update: (instance: any, spec: {}) => TCombBase; + update: (instance: any, spec: {} ) => TCombBase; assert: (condition: boolean, message?: string, ...values: any[]) => void; fail: (message?: string) => void; Any: Any_Static;