Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
});
});
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', () => {
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
});
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', () => {
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
});
});
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)