From d84477ff8e76d13c205e438b7c38e5a3e3cdb23e Mon Sep 17 00:00:00 2001 From: "maksim.zhemerenko" Date: Mon, 20 May 2024 12:52:54 +0200 Subject: [PATCH] Fix json array iterator ios --- ios/src/json/utils/JsonArrayIterator.swift | 11 ++++++-- package.json | 4 +-- yarn.lock | 29 ++++++++++++++++------ 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/ios/src/json/utils/JsonArrayIterator.swift b/ios/src/json/utils/JsonArrayIterator.swift index 6140d25..4841762 100644 --- a/ios/src/json/utils/JsonArrayIterator.swift +++ b/ios/src/json/utils/JsonArrayIterator.swift @@ -10,7 +10,14 @@ public class JsonArrayIterator: IteratorProtocol { } public func next() -> JsonValue? { - index += 1; - return jsonArray.opt(index) + var el: JsonValue? = nil + while (index < jsonArray.size - 1) { + index += 1 + el = jsonArray.opt(index) + if (el != nil) { + break + } + } + return el } } diff --git a/package.json b/package.json index 2fb656a..b81324f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@spryrocks/capacitor-ionic-core-plugin", - "version": "5.8.2-alpha.0", + "version": "5.9.0-alpha.1", "description": "Ionic plugin core capacitor", "main": "dist/plugin.cjs.js", "module": "dist/esm/index.js", @@ -36,7 +36,7 @@ "@spryrocks/eslint-config": "^0.3.0-alpha.1", "rimraf": "^5.0.1", "rollup": "^3.29.2", - "typescript": "^5.2.2" + "typescript": "^5.4.5" }, "publishConfig": { "access": "public" diff --git a/yarn.lock b/yarn.lock index 5df9be6..b2e5087 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1972,8 +1972,16 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: - name string-width-cjs +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2054,7 +2062,14 @@ string.prototype.trimstart@^1.0.7: define-properties "^1.2.0" es-abstract "^1.22.1" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -2201,10 +2216,10 @@ typed-array-length@^1.0.4: for-each "^0.3.3" is-typed-array "^1.1.9" -typescript@^5.2.2: - version "5.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" - integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== +typescript@^5.4.5: + version "5.4.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.5.tgz#42ccef2c571fdbd0f6718b1d1f5e6e5ef006f611" + integrity sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ== unbox-primitive@^1.0.2: version "1.0.2"