当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript deep-equal.default函数代码示例

本文整理汇总了TypeScript中deep-equal.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

    it('should extend defaults with custom options object passed to constructor', () => {
      let expected = extend({}, defaultOptions, {
        trigger: [new Trigger('click')],
        text: 'hello world',
        placement: 'bottom'
      }); // copy

      expect(deepEqual((new Options({
        trigger: 'click',
        text: expected.text,
        placement: expected.placement
      })), expected)).toBe(true);
    });
开发者ID:dangsd,项目名称:popgun,代码行数:13,代码来源:Options.spec.ts

示例2: it

    it('end to end test to check priority', () => {

      let groupVal: Object = {
        trigger: 'hover, click',
        placement: 'top right',
        showDelay: '123',
        transitionPlacement: false
      };

      let schemaVal: Object = {
        transitionPlacement: true
      };

      let jsonVal: Object = {
        trigger: 'hover',
        placement: 'top bottom',
        showDelay: '123'
      };

      groupStore.add('group-test', { options: groupVal });
      groupStore.add('schema-test', schemaVal);

      let el = document.createElement('div');
      el.setAttribute('popgun-group', 'group-test');
      el.setAttribute('popgun-schema', 'schema-test');
      el.setAttribute('popgun-json', JSON.stringify(jsonVal));
      el.setAttribute('popgun-placement', 'top left');

      expect(deepEqual(OptionsParser.fromElement(el), {
        placement: 'top left',
        showDelay: 123,
        trigger: [new Trigger('hover')],
        transitionPlacement: false
      })).toBe(true);
    });
开发者ID:dangsd,项目名称:popgun,代码行数:35,代码来源:OptionsParser.spec.ts

示例3: extractProvide

function extractProvide(
  statement: estree.Statement | estree.ModuleDeclaration,
  provides: string[]
): boolean {
  if (
    statement.type === Syntax.ExpressionStatement &&
    statement.expression.type === Syntax.CallExpression
  ) {
    const callExp = statement.expression;
    const firstArg = callExp.arguments[0];
    if (
      firstArg &&
      firstArg.type === Syntax.Literal &&
      deepEqual(espurify(callExp.callee), {
        type: 'MemberExpression',
        computed: false,
        object: {
          type: 'Identifier',
          name: 'goog',
        },
        property: {
          type: 'Identifier',
          name: 'provide',
        },
      })
    ) {
      if (typeof firstArg.value !== 'string') {
        throw new Error('Unexpected value: ' + firstArg.value);
      }
      provides.push(firstArg.value!);
      return true;
    }
  }
  return false;
}
开发者ID:teppeis,项目名称:closure-ts,代码行数:35,代码来源:generator.ts

示例4: deepEquals

export function structuralEquals<T extends object>(
  actual: T,
  expected: T
): boolean {
  return deepEquals(actual, expected, { strict: true })
}
开发者ID:ghmoore,项目名称:desktop,代码行数:6,代码来源:equality.ts

示例5: callAndReportFailure

 ? callAndReportFailure("Failed to strictly compare objects", () =>
     strictDeepEquals(givenJSON, expectedJSON)
开发者ID:nrkn,项目名称:quicktype,代码行数:2,代码来源:utils.ts


注:本文中的deep-equal.default函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。