@based/schema 5.0.0-alpha.24 → 5.0.0-alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import { StrictSchema } from './types.js';
2
2
  type Opts = {
3
3
  readOnly?: boolean;
4
4
  stripMetaInformation?: boolean;
5
+ stripTransform?: boolean;
5
6
  };
6
7
  export declare const serialize: (schema: any, opts?: Opts) => Uint8Array;
7
8
  export declare const deSerializeKey: (buf: Uint8Array, keySize: number, i: number) => {
package/dist/serialize.js CHANGED
@@ -207,7 +207,13 @@ const walk = (opts, obj, prev, prev2, fromObject, schemaBuffer) => {
207
207
  }
208
208
  else {
209
209
  for (const key in obj) {
210
- if (opts.readOnly &&
210
+ if (opts.stripTransform &&
211
+ isFromObj &&
212
+ key === 'transform' &&
213
+ typeof obj[key] === 'function') {
214
+ continue;
215
+ }
216
+ else if (opts.readOnly &&
211
217
  isFromObj &&
212
218
  (key === 'validation' || key === 'default')) {
213
219
  if (key === 'validation' && typeof obj[key] === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@based/schema",
3
- "version": "5.0.0-alpha.24",
3
+ "version": "5.0.0-alpha.26",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",