How to use the immutable.List.of function in immutable

To help you get started, we’ve selected a few immutable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bbc / unicode-bidirectional / test / unit / paragraph / matchingPDIForIndex.spec.js View on Github external
it('should match 3 with 4 for [RLI, RLI, RLI, FSI, PDI, PDI, PDI, PDI]', () => {
    const codepoints = List.of(RLI, RLI, RLI, FSI, PDI, PDI, PDI, PDI);
    expect(matchingPDIForIndex(codepoints, 3)).to.equal(4);
  });
github bbc / unicode-bidirectional / test / unit / weak / rule / es.spec.js View on Github external
it('should change [AN,CS,AN] to [AN,AN,AN]', () => {
    const points = List.of(AN, CS, AN);
    const types = List.of('AN', 'CS', 'AN');
    expect(es(types, points)).to.equal(List.of('AN', 'AN', 'AN'));
  });
github netceteragroup / skele / packages / core / src / registry / __tests__ / MultivalueRegistry.js View on Github external
it('prepends matching values of lesser specificity to the result', () => {
    registry.register('a', 1)
    registry.register(['a', 'b'], 2)
    registry.register(['a', 'b'], 20)
    registry.register(['a', 'b', 'c'], 3)
    registry.register('a', 4)
    registry.register(['a', 'b'], 5)

    expect(registry.get('a')).toEqualI(List.of(1, 4))
    expect(registry.get(['a', 'b'])).toEqualI(List.of(1, 4, 2, 20, 5))
    expect(registry.get(['a', 'b', 'c'])).toEqualI(List.of(1, 4, 2, 20, 5, 3))
  })
})
github netceteragroup / skele / packages / ramda / src / __tests__ / list.js View on Github external
test('contains', () => {
    expect(R.contains(1, List.of(1, 2))).toBe(true);
    expect(R.contains(1, List.of(3, 2))).toBe(false);
    expect(R.contains(List.of(1), fromJS([1, [1]]))).toBe(true);
    expect(R.contains([1], fromJS([1, [1]]))).toBe(false);
    expect(R.contains([1], List.of([1, [1]]))).toBe(false);
  });
github netceteragroup / skele / packages / ramda / src / __tests__ / list.js View on Github external
test('all',  () => {
    const equals3 = R.equals(3);
    expect(R.all(equals3, List.of(3, 3, 3, 3))).toBe(true);
    expect(R.all(equals3, List.of(3, 2, 3, 2))).toBe(false);
    expect(R.all(equals3, [3, 3, 3, 3])).toBe(true);
  });
github netceteragroup / skele / packages / ramda / src / __tests__ / object.js View on Github external
test('assoc', () => {
    expect(R.assoc('name', 'bla', Map({a: 1}))).toEqualI(Map({name: 'bla', a: 1}));
    expect(R.assoc(1, 'bla', List.of('a', 'b'))).toEqualI(List.of('a', 'bla'));
  });
github netceteragroup / skele / packages / ramda / src / __tests__ / list.js View on Github external
test('append', () => {
    expect(R.append(3, List())).toEqualI(List.of(3));
    expect(R.append(3, List.of(1, 2))).toEqualI(List.of(1, 2, 3));
    expect(R.append(3)(List.of(1))).toEqualI(List.of(1, 3));
  });
github bbc / unicode-bidirectional / test / unit / resolve / reorderLevels.spec.js View on Github external
it('should give partial permutations; ignoring all levels marked as invisible ("x")', () => {
      expect(reorderPermutation(List.of(0,'x',1,'x'), IGNORE_INVISIBLE)).to.equal(List.of(0,2));
      expect(reorderPermutation(List.of('x',1,4), IGNORE_INVISIBLE)).to.equal(List.of(2,1));
      expect(reorderPermutation(List.of(2,1,'x',1), IGNORE_INVISIBLE)).to.equal(List.of(3,1,0));
    });
github netceteragroup / skele / packages / classic / src / ui / __tests__ / ui.js View on Github external
expect(() =>
          ui.register(List.of('component', 'subkind'), Comp)
        ).not.toThrow()
github allegro / turnilo / src / common / view-definitions / version-2 / view-definition-converter-2.ts View on Github external
function readFixedTimeFilter(selection: LiteralExpression, dimension: Dimension): FixedTimeFilterClause {
  const { name: reference } = dimension;

  return new FixedTimeFilterClause({ reference, values: List.of(new DateRange(selection.value as TimeRange)) });
}