feat: bump deps (#14076)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated core dependencies, developer tooling and Rust toolchain to
newer stable versions across the repo
* Upgraded Storybook to v10 and improved ESM path resolution for
storybook tooling
* Broadened native binding platform/architecture support and
strengthened native module version validation, loading and WASI handling

* **New Features**
* Exposed an additional native text export for consumers (enhanced
JS/native surface)

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
DarkSky
2025-12-10 03:52:14 +08:00
committed by GitHub
parent 215541d331
commit 40f3337d45
33 changed files with 3583 additions and 2047 deletions
-1
View File
@@ -28,7 +28,6 @@ export declare class YArray {
}
export declare class YMap {
constructor()
get length(): number
get isEmpty(): boolean
get<T = unknown>(key: string): T
+448 -42
View File
@@ -3,10 +3,7 @@
// @ts-nocheck
/* auto-generated by NAPI-RS */
const { createRequire } = require('node:module')
require = createRequire(__filename);
const { readFileSync } = require('node:fs');
const { readFileSync } = require('node:fs')
let nativeBinding = null;
const loadErrors = [];
@@ -68,7 +65,7 @@ const isMuslFromChildProcess = () => {
function requireNative() {
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
try {
nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
} catch (err) {
loadErrors.push(err);
}
@@ -80,7 +77,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-android-arm64');
const binding = require('@y-octo/node-android-arm64');
const bindingPackageVersion =
require('@y-octo/node-android-arm64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -91,7 +100,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-android-arm-eabi');
const binding = require('@y-octo/node-android-arm-eabi');
const bindingPackageVersion =
require('@y-octo/node-android-arm-eabi/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -102,15 +123,55 @@ function requireNative() {
}
} else if (process.platform === 'win32') {
if (process.arch === 'x64') {
try {
return require('./y-octo.win32-x64-msvc.node');
} catch (e) {
loadErrors.push(e);
}
try {
return require('@y-octo/node-win32-x64-msvc');
} catch (e) {
loadErrors.push(e);
if (
process.config?.variables?.shlib_suffix === 'dll.a' ||
process.config?.variables?.node_target_type === 'shared_library'
) {
try {
return require('./y-octo.win32-x64-gnu.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-win32-x64-gnu');
const bindingPackageVersion =
require('@y-octo/node-win32-x64-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return require('./y-octo.win32-x64-msvc.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-win32-x64-msvc');
const bindingPackageVersion =
require('@y-octo/node-win32-x64-msvc/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
}
} else if (process.arch === 'ia32') {
try {
@@ -119,7 +180,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-win32-ia32-msvc');
const binding = require('@y-octo/node-win32-ia32-msvc');
const bindingPackageVersion =
require('@y-octo/node-win32-ia32-msvc/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -130,7 +203,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-win32-arm64-msvc');
const binding = require('@y-octo/node-win32-arm64-msvc');
const bindingPackageVersion =
require('@y-octo/node-win32-arm64-msvc/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -146,11 +231,22 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-darwin-universal');
const binding = require('@y-octo/node-darwin-universal');
const bindingPackageVersion =
require('@y-octo/node-darwin-universal/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
if (process.arch === 'x64') {
try {
return require('./y-octo.darwin-x64.node');
@@ -158,7 +254,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-darwin-x64');
const binding = require('@y-octo/node-darwin-x64');
const bindingPackageVersion =
require('@y-octo/node-darwin-x64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -169,7 +277,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-darwin-arm64');
const binding = require('@y-octo/node-darwin-arm64');
const bindingPackageVersion =
require('@y-octo/node-darwin-arm64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -186,7 +306,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-freebsd-x64');
const binding = require('@y-octo/node-freebsd-x64');
const bindingPackageVersion =
require('@y-octo/node-freebsd-x64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -197,7 +329,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-freebsd-arm64');
const binding = require('@y-octo/node-freebsd-arm64');
const bindingPackageVersion =
require('@y-octo/node-freebsd-arm64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -215,7 +359,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-x64-musl');
const binding = require('@y-octo/node-linux-x64-musl');
const bindingPackageVersion =
require('@y-octo/node-linux-x64-musl/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -226,7 +382,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-x64-gnu');
const binding = require('@y-octo/node-linux-x64-gnu');
const bindingPackageVersion =
require('@y-octo/node-linux-x64-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -239,7 +407,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-arm64-musl');
const binding = require('@y-octo/node-linux-arm64-musl');
const bindingPackageVersion =
require('@y-octo/node-linux-arm64-musl/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -250,7 +430,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-arm64-gnu');
const binding = require('@y-octo/node-linux-arm64-gnu');
const bindingPackageVersion =
require('@y-octo/node-linux-arm64-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -263,7 +455,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-arm-musleabihf');
const binding = require('@y-octo/node-linux-arm-musleabihf');
const bindingPackageVersion =
require('@y-octo/node-linux-arm-musleabihf/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -274,7 +478,67 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-arm-gnueabihf');
const binding = require('@y-octo/node-linux-arm-gnueabihf');
const bindingPackageVersion =
require('@y-octo/node-linux-arm-gnueabihf/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
}
} else if (process.arch === 'loong64') {
if (isMusl()) {
try {
return require('./y-octo.linux-loong64-musl.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-linux-loong64-musl');
const bindingPackageVersion =
require('@y-octo/node-linux-loong64-musl/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
try {
return require('./y-octo.linux-loong64-gnu.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-linux-loong64-gnu');
const bindingPackageVersion =
require('@y-octo/node-linux-loong64-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -287,7 +551,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-riscv64-musl');
const binding = require('@y-octo/node-linux-riscv64-musl');
const bindingPackageVersion =
require('@y-octo/node-linux-riscv64-musl/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -298,7 +574,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-riscv64-gnu');
const binding = require('@y-octo/node-linux-riscv64-gnu');
const bindingPackageVersion =
require('@y-octo/node-linux-riscv64-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -310,7 +598,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-ppc64-gnu');
const binding = require('@y-octo/node-linux-ppc64-gnu');
const bindingPackageVersion =
require('@y-octo/node-linux-ppc64-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -321,7 +621,19 @@ function requireNative() {
loadErrors.push(e);
}
try {
return require('@y-octo/node-linux-s390x-gnu');
const binding = require('@y-octo/node-linux-s390x-gnu');
const bindingPackageVersion =
require('@y-octo/node-linux-s390x-gnu/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
@@ -330,6 +642,81 @@ function requireNative() {
new Error(`Unsupported architecture on Linux: ${process.arch}`)
);
}
} else if (process.platform === 'openharmony') {
if (process.arch === 'arm64') {
try {
return require('./y-octo.openharmony-arm64.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-openharmony-arm64');
const bindingPackageVersion =
require('@y-octo/node-openharmony-arm64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === 'x64') {
try {
return require('./y-octo.openharmony-x64.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-openharmony-x64');
const bindingPackageVersion =
require('@y-octo/node-openharmony-x64/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
} else if (process.arch === 'arm') {
try {
return require('./y-octo.openharmony-arm.node');
} catch (e) {
loadErrors.push(e);
}
try {
const binding = require('@y-octo/node-openharmony-arm');
const bindingPackageVersion =
require('@y-octo/node-openharmony-arm/package.json').version;
if (
bindingPackageVersion !== '0.25.7' &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0'
) {
throw new Error(
`Native binding package version mismatch, expected 0.25.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`
);
}
return binding;
} catch (e) {
loadErrors.push(e);
}
} else {
loadErrors.push(
new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`)
);
}
} else {
loadErrors.push(
new Error(
@@ -342,35 +729,54 @@ function requireNative() {
nativeBinding = requireNative();
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
let wasiBinding = null;
let wasiBindingError = null;
try {
nativeBinding = require('./y-octo.wasi.cjs');
wasiBinding = require('./y-octo.wasi.cjs');
nativeBinding = wasiBinding;
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
loadErrors.push(err);
wasiBindingError = err;
}
}
if (!nativeBinding) {
try {
nativeBinding = require('@y-octo/node-wasm32-wasi');
wasiBinding = require('@y-octo/node-wasm32-wasi');
nativeBinding = wasiBinding;
} catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) {
wasiBindingError.cause = err;
loadErrors.push(err);
}
}
}
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
const error = new Error(
'WASI binding not found and NAPI_RS_FORCE_WASI is set to error'
);
error.cause = wasiBindingError;
throw error;
}
}
if (!nativeBinding) {
if (loadErrors.length > 0) {
// TODO Link to documentation with potential fixes
// - The package owner could build/publish bindings for this arch
// - The user may need to bundle the correct files
// - The user may need to re-install node_modules to get new packages
throw new Error('Failed to load native binding', { cause: loadErrors });
throw new Error(
`Cannot find native binding. ` +
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
{
cause: loadErrors.reduce((err, cur) => {
cur.cause = err;
return cur;
}),
}
);
}
throw new Error(`Failed to load native binding`);
}
module.exports = nativeBinding;
module.exports.Doc = nativeBinding.Doc;
module.exports.YArray = nativeBinding.YArray;
module.exports.YMap = nativeBinding.YMap;
+1 -1
View File
@@ -21,7 +21,7 @@
},
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "3.0.0-alpha.89",
"@napi-rs/cli": "3.0.0",
"@types/node": "^22.14.1",
"@types/prompts": "^2.4.9",
"c8": "^10.1.3",
+1 -1
View File
@@ -105,7 +105,7 @@ impl YMap {
}
#[napi]
pub fn to_json(&self, env: Env) -> Result<Object> {
pub fn to_json(&self, env: Env) -> Result<Object<'_>> {
let mut js_object = Object::new(&env)?;
for (key, value) in self.map.iter() {
js_object.set(key, get_js_unknown_from_value(&env, value))?;
+2 -2
View File
@@ -9,7 +9,7 @@ use super::*;
pub type MixedYType<'a> = Either4<YArray, YMap, YText, Unknown<'a>>;
pub type MixedRefYType<'a> = Either4<&'a YArray, &'a YMap, &'a YText, Unknown<'a>>;
pub fn get_js_unknown_from_any(env: &Env, any: Any) -> Result<Unknown> {
pub fn get_js_unknown_from_any(env: &Env, any: Any) -> Result<Unknown<'_>> {
match any {
Any::Null | Any::Undefined => Null.into_unknown(env),
Any::True => true.into_unknown(env),
@@ -33,7 +33,7 @@ pub fn get_js_unknown_from_any(env: &Env, any: Any) -> Result<Unknown> {
}
}
pub fn get_js_unknown_from_value(env: &Env, value: Value) -> Result<Unknown> {
pub fn get_js_unknown_from_value(env: &Env, value: Value) -> Result<Unknown<'_>> {
match value {
Value::Any(any) => get_js_unknown_from_any(env, any),
Value::Array(array) => {