當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。