How to use the rambda.omit function in rambda

To help you get started, we’ve selected a few rambda 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 selfrefactor / rambda / _typings_tests / omit-spec.ts View on Github external
it('infered input type', () => {
    const x = omit('a,c', {a:1,b:2,c:3,d:4}); // $ExpectType Dictionary
    x // $ExpectType Dictionary
    const y = omit('a,c', {a:1,b:'1',c:3,d:4}); // $ExpectType Dictionary
    y // $ExpectType Dictionary
    const q = omit('a,c')({a:1,b:1,c:3,d:4}); // $ExpectType Dictionary
    q // $ExpectType Dictionary
  });
});
github selfrefactor / rambda / _typings_tests / omit-spec.ts View on Github external
it('one type', () => {
    const x = omit(['a,c'], {a:1,b:2,c:3,d:4}); // $ExpectType Dictionary
    x // $ExpectType Dictionary
    const y = omit(['a,c'])({a:1,b:2,c:3,d:4}); // $ExpectType Dictionary
    y // $ExpectType Dictionary
  });
});
github selfrefactor / rambda / _typings_tests / omit-spec.ts View on Github external
it('two types', () => {
    interface Output{
      b: string
      d: number
    }

    const x = omit('a,c', {a:1,b:'2',c:3,d:4}); // $ExpectType Output
    x.b // $ExpectType string
    const y = omit('a,c')({a:1,b:'2',c:3,d:4}); // $ExpectType Output
    y.d // $ExpectType number
  });
github selfrefactor / rambda / _typings_tests / omit-spec.ts View on Github external
it('one type', () => {
    const x = omit('a,c', {a:1,b:2,c:3,d:4}); // $ExpectType Dictionary
    x // $ExpectType Dictionary
    const y = omit('a,c')({a:1,b:2,c:3,d:4}); // $ExpectType Dictionary
    y // $ExpectType Dictionary
  });
  it('two types', () => {
github selfrefactor / rambda / _typings_tests / omit-spec.ts View on Github external
it('infered input type', () => {
    const x = omit('a,c', {a:1,b:2,c:3,d:4}); // $ExpectType Dictionary
    x // $ExpectType Dictionary
    const y = omit('a,c', {a:1,b:'1',c:3,d:4}); // $ExpectType Dictionary
    y // $ExpectType Dictionary
    const q = omit('a,c')({a:1,b:1,c:3,d:4}); // $ExpectType Dictionary
    q // $ExpectType Dictionary
  });
});
github farwayer / mst-decorators / src / index.js View on Github external
const {onSnapshot, onPatch, onAction} = values

  let props = extractTaggedProps(Class, PropsKey)
  props = pipe(
    rdMap(args => args[0]),
    convertValuesToMst,
  )(props)

  const propKeys = Object.keys(props)
  const viewKeys = Object.keys(extractTaggedProps(Class, ViewsKey))
  const ownKeys = Object.getOwnPropertyNames(values)
  const omitKeys = ExcludeKeys.concat(propKeys).concat(viewKeys)
  const descs = getOwnPropertyDescriptors(Class.prototype)

  const views = pick(viewKeys, descs)
  const volatile = omit(omitKeys, pick(ownKeys, values))
  const actions = {}

  pipe(
    filter((desc, key) => !omitKeys.includes(key)),
    forEach((desc, key) => {
      const {get, set, value} = desc
      if (get || set) return views[key] = desc
      if (is.fn(value)) return actions[key] = value
    }),
  )(descs)

  const mstType = getMstType(Class) // es6 extending
  let Model = mstType
    ? mstType.named(name).props(props)
    : MstTypes.model(name, props)