[#7543] documented the unmarshal jsvm helper

This commit is contained in:
Gani Georgiev
2026-02-24 15:14:25 +02:00
parent eb28f898d0
commit d5d8decf6e
3 changed files with 3829 additions and 3781 deletions

View File

@@ -2,6 +2,8 @@
- Set `NumberField.OnlyInt:true` for the generated View collection schema fields when a view column expression is known to return int-only values ([#7538](https://github.com/pocketbase/pocketbase/issues/7538)).
- Documented the `unmarshal` JSVM helper ([#7543](https://github.com/pocketbase/pocketbase/issues/7543)).
## v0.36.5

File diff suppressed because it is too large Load Diff

View File

@@ -254,6 +254,29 @@ declare function sleep(milliseconds: number): void;
*/
declare function arrayOf<T>(model: T): Array<T>;
/**
* unmarshal clones and merges the data argument on top of dst.
*
* This method is rarely used directly by the users and it is most
* commonly used in the autogenerated migrations.
*
* To an extent it is similar to the JS native ` + "`" + `Object.assign` + "`" + `
* but the arguments are reversed and it invokes the Go standard
* ` + "`" + `json.Marshal/Unmarshal` + "`" + ` methods under the hood.
*
* The data argument could be anything serializable, usually a plain object (map).
* The dst argument culd be any pointer value, usually a model instance.
*
* Example:
*
* ` + "```" + `js
* unmarshal({ authAlert: { enabled: true } }, collection)
* ` + "```" + `
*
* @group PocketBase
*/
declare function unmarshal(data: any, dst: any): void;
/**
* DynamicModel creates a new dynamic model with fields from the provided data shape.
*