[#7543] documented the unmarshal jsvm helper
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
7585
plugins/jsvm/internal/types/generated/types.d.ts
vendored
7585
plugins/jsvm/internal/types/generated/types.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user