@fp-ts/schema
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -142,4 +142,4 @@ "use strict"; | ||
return record(fc, parameter, type).map(d => ({ | ||
...o, | ||
...d | ||
...d, | ||
...o | ||
})); | ||
@@ -146,0 +146,0 @@ }); |
{ | ||
"name": "@fp-ts/schema", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -290,2 +290,5 @@ "use strict"; | ||
for (const key of keys) { | ||
if (Object.prototype.hasOwnProperty.call(expectedKeys, key)) { | ||
continue; | ||
} | ||
// --------------------------------------------- | ||
@@ -292,0 +295,0 @@ // handle keys |
@@ -110,2 +110,3 @@ "use strict"; | ||
const output = []; | ||
const expectedKeys = {}; | ||
// --------------------------------------------- | ||
@@ -121,2 +122,3 @@ // handle property signatures | ||
output.push(`${prettyName(name)}: ${propertySignaturesTypes[i].pretty(input[name])}`); | ||
expectedKeys[name] = null; | ||
} | ||
@@ -131,2 +133,5 @@ // --------------------------------------------- | ||
for (const key of keys) { | ||
if (Object.prototype.hasOwnProperty.call(expectedKeys, key)) { | ||
continue; | ||
} | ||
output.push(`${prettyName(key)}: ${type.pretty(input[key])}`); | ||
@@ -133,0 +138,0 @@ } |
@@ -623,6 +623,6 @@ <h3 align="center"> | ||
```ts | ||
// $ExpectType Schema<{ [x: string]: string; readonly a: string; readonly b: string; readonly c: boolean; }> | ||
// $ExpectType Schema<{ [x: string]: string; readonly a: string; readonly b: string; readonly c: string; }> | ||
pipe( | ||
S.struct({ a: S.string, b: S.string }), | ||
S.extend(S.struct({ c: S.boolean })), // <= you can add more fields | ||
S.extend(S.struct({ c: S.string })), // <= you can add more fields | ||
S.extend(S.record(S.string, S.string)) // <= you can add index signatures | ||
@@ -629,0 +629,0 @@ ); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
528788
7784