appium-mac2-driver 4.3.5 → 4.3.6
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.
- package/CHANGELOG.md +6 -0
- package/WebDriverAgentMac/WebDriverAgentLib/Utilities/FBXPath.m +48 -2
- package/WebDriverAgentMac/WebDriverAgentMac.xcodeproj/project.pbxproj +4 -0
- package/build/lib/wda-mac.d.ts.map +1 -1
- package/build/lib/wda-mac.js +4 -5
- package/build/lib/wda-mac.js.map +1 -1
- package/lib/wda-mac.ts +4 -5
- package/node_modules/@appium/logger/CHANGELOG.md +8 -0
- package/node_modules/@appium/logger/package.json +3 -3
- package/node_modules/@appium/strongbox/build/lib/index.d.ts.map +1 -1
- package/node_modules/@appium/strongbox/build/lib/index.js +6 -1
- package/node_modules/@appium/strongbox/build/lib/index.js.map +1 -1
- package/node_modules/@appium/strongbox/lib/index.ts +6 -1
- package/node_modules/@appium/strongbox/package.json +2 -2
- package/node_modules/@appium/support/build/lib/fs.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/fs.js +7 -0
- package/node_modules/@appium/support/build/lib/fs.js.map +1 -1
- package/node_modules/@appium/support/build/lib/index.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/net.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/net.js +6 -2
- package/node_modules/@appium/support/build/lib/net.js.map +1 -1
- package/node_modules/@appium/support/build/lib/util.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/util.js +10 -4
- package/node_modules/@appium/support/build/lib/util.js.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.d.ts.map +1 -1
- package/node_modules/@appium/support/build/lib/zip.js +2 -7
- package/node_modules/@appium/support/build/lib/zip.js.map +1 -1
- package/node_modules/@appium/support/lib/fs.ts +8 -1
- package/node_modules/@appium/support/lib/net.ts +7 -2
- package/node_modules/@appium/support/lib/util.ts +9 -3
- package/node_modules/@appium/support/lib/zip.ts +3 -9
- package/node_modules/@appium/support/package.json +9 -9
- package/node_modules/@appium/types/package.json +4 -4
- package/node_modules/@img/sharp-darwin-arm64/index.cjs +1 -1
- package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.5.node +0 -0
- package/node_modules/@img/sharp-darwin-arm64/package.json +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/README.md +1 -1
- package/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/lib/{libvips-cpp.8.18.6.dylib → libvips-cpp.8.18.7.dylib} +0 -0
- package/node_modules/@img/sharp-libvips-darwin-arm64/package.json +2 -2
- package/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +11 -11
- package/node_modules/appium-xcode/CHANGELOG.md +28 -0
- package/node_modules/appium-xcode/README.md +1 -1
- package/node_modules/appium-xcode/package.json +14 -18
- package/node_modules/b4a/browser.js +5 -0
- package/node_modules/b4a/index.d.ts +144 -0
- package/node_modules/b4a/index.js +5 -0
- package/node_modules/b4a/package.json +4 -1
- package/node_modules/b4a/runtime.d.ts +14 -0
- package/node_modules/bare-fs/binding.c +53 -24
- package/node_modules/bare-fs/index.d.ts +12 -10
- package/node_modules/bare-fs/index.js +13 -4
- package/node_modules/bare-fs/package.json +2 -1
- package/node_modules/bare-fs/prebuilds/android-arm/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-ia32/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/android-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/darwin-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-arm64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/ios-x64-simulator/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/linux-x64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-arm64/bare-fs.bare +0 -0
- package/node_modules/bare-fs/prebuilds/win32-x64/bare-fs.bare +0 -0
- package/node_modules/bplist-creator/README.md +26 -6
- package/node_modules/bplist-creator/dist/index.cjs +508 -0
- package/node_modules/bplist-creator/dist/index.cjs.map +7 -0
- package/node_modules/bplist-creator/dist/index.d.cts +12 -0
- package/node_modules/bplist-creator/dist/index.d.ts +12 -0
- package/node_modules/bplist-creator/dist/index.mjs +472 -0
- package/node_modules/bplist-creator/dist/index.mjs.map +7 -0
- package/node_modules/bplist-creator/package.json +43 -9
- package/node_modules/bplist-parser/README.md +37 -3
- package/node_modules/bplist-parser/dist/index.cjs +385 -0
- package/node_modules/bplist-parser/dist/index.cjs.map +7 -0
- package/node_modules/bplist-parser/dist/index.d.cts +13 -0
- package/node_modules/bplist-parser/dist/index.d.ts +13 -0
- package/node_modules/bplist-parser/{bplistParser.js → dist/index.mjs} +141 -171
- package/node_modules/bplist-parser/dist/index.mjs.map +7 -0
- package/node_modules/bplist-parser/package.json +39 -12
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts +4 -0
- package/node_modules/brace-expansion/dist/commonjs/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/commonjs/index.js +69 -25
- package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.d.ts +4 -0
- package/node_modules/brace-expansion/dist/esm/index.d.ts.map +1 -1
- package/node_modules/brace-expansion/dist/esm/index.js +68 -24
- package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/follow-redirects/index.js +10 -1
- package/node_modules/follow-redirects/package.json +1 -1
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel-react-native.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.d.ts +5 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/diagnostics-channel.js +7 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts +1400 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.js +1733 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/index.js.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts +12 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.js +10 -0
- package/node_modules/lru-cache/dist/commonjs/react-native/perf.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel-react-native.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.d.ts +5 -0
- package/node_modules/lru-cache/dist/esm/react-native/diagnostics-channel.js +4 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.d.ts +1400 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.js +1729 -0
- package/node_modules/lru-cache/dist/esm/react-native/index.js.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts +12 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.d.ts.map +1 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.js +7 -0
- package/node_modules/lru-cache/dist/esm/react-native/perf.js.map +1 -0
- package/node_modules/lru-cache/package.json +27 -1
- package/node_modules/p-limit/index.d.ts +2 -0
- package/node_modules/p-limit/index.js +17 -1
- package/node_modules/p-limit/package.json +1 -1
- package/node_modules/p-limit/readme.md +2 -0
- package/node_modules/sharp/dist/index.d.cts +2 -2
- package/node_modules/sharp/dist/index.d.mts +3 -3
- package/node_modules/sharp/dist/is.cjs +8 -2
- package/node_modules/sharp/dist/is.mjs +8 -2
- package/node_modules/sharp/dist/operation.cjs +2 -2
- package/node_modules/sharp/dist/operation.mjs +2 -2
- package/node_modules/sharp/dist/output.cjs +1 -0
- package/node_modules/sharp/dist/output.mjs +1 -0
- package/node_modules/sharp/dist/resize.cjs +14 -14
- package/node_modules/sharp/dist/resize.mjs +14 -14
- package/node_modules/sharp/dist/sharp.cjs +3 -3
- package/node_modules/sharp/dist/sharp.mjs +3 -3
- package/node_modules/sharp/lib/index.d.ts +2 -2
- package/node_modules/sharp/package.json +35 -35
- package/node_modules/sharp/src/binding.gyp +1 -1
- package/node_modules/sharp/src/common.cc +4 -4
- package/node_modules/sharp/src/common.h +2 -2
- package/node_modules/sharp/src/pipeline.cc +31 -6
- package/node_modules/sharp/src/utilities.cc +1 -1
- package/node_modules/spdx-license-ids/index.json +13 -0
- package/node_modules/spdx-license-ids/package.json +1 -1
- package/node_modules/stream-buffers/.codeclimate.yml +12 -0
- package/node_modules/stream-buffers/.eslintignore +1 -0
- package/node_modules/stream-buffers/.eslintrc +25 -0
- package/node_modules/stream-buffers/.github/workflows/codeql-analysis.yml +71 -0
- package/node_modules/stream-buffers/.github/workflows/node.js.yml +31 -0
- package/node_modules/stream-buffers/.mailmap +1 -0
- package/node_modules/stream-buffers/.nvmrc +1 -0
- package/node_modules/stream-buffers/README.md +65 -65
- package/node_modules/stream-buffers/lib/constants.js +8 -6
- package/node_modules/stream-buffers/lib/readable_streambuffer.js +114 -136
- package/node_modules/stream-buffers/lib/streambuffer.js +5 -3
- package/node_modules/stream-buffers/lib/writable_streambuffer.js +72 -97
- package/node_modules/stream-buffers/package.json +7 -5
- package/node_modules/type-fest/index.d.ts +7 -7
- package/node_modules/type-fest/package.json +2 -1
- package/node_modules/type-fest/readme.md +7 -16
- package/node_modules/type-fest/source/all-extend.d.ts +9 -7
- package/node_modules/type-fest/source/array-reverse.d.ts +13 -12
- package/node_modules/type-fest/source/array-tail.d.ts +3 -3
- package/node_modules/type-fest/source/delimiter-case.d.ts +1 -1
- package/node_modules/type-fest/source/get.d.ts +1 -1
- package/node_modules/type-fest/source/int-closed-range.d.ts +4 -1
- package/node_modules/type-fest/source/int-range.d.ts +56 -9
- package/node_modules/type-fest/source/internal/array.d.ts +14 -13
- package/node_modules/type-fest/source/internal/numeric.d.ts +0 -38
- package/node_modules/type-fest/source/internal/object.d.ts +30 -1
- package/node_modules/type-fest/source/is-boolean-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-literal.d.ts +43 -269
- package/node_modules/type-fest/source/is-numeric-literal.d.ts +50 -0
- package/node_modules/type-fest/source/is-string-literal.d.ts +72 -0
- package/node_modules/type-fest/source/is-symbol-literal.d.ts +39 -0
- package/node_modules/type-fest/source/is-tuple.d.ts +3 -3
- package/node_modules/type-fest/source/jsonify.d.ts +1 -5
- package/node_modules/type-fest/source/merge-deep.d.ts +3 -3
- package/node_modules/type-fest/source/remove-prefix.d.ts +1 -1
- package/node_modules/type-fest/source/remove-suffix.d.ts +1 -1
- package/node_modules/type-fest/source/rename-keys.d.ts +163 -0
- package/node_modules/type-fest/source/set-required.d.ts +10 -9
- package/node_modules/type-fest/source/shared-union-fields-deep.d.ts +6 -4
- package/node_modules/type-fest/source/some-extend.d.ts +9 -7
- package/node_modules/type-fest/source/split-on-rest-element.d.ts +14 -13
- package/node_modules/type-fest/source/split.d.ts +22 -11
- package/node_modules/type-fest/source/string-repeat.d.ts +1 -1
- package/node_modules/type-fest/source/string-to-array.d.ts +1 -1
- package/node_modules/type-fest/source/tsconfig-json.d.ts +1 -1
- package/node_modules/type-fest/source/typed-array.d.ts +6 -0
- package/node_modules/type-fest/source/union-max.d.ts +56 -0
- package/node_modules/type-fest/source/writable.d.ts +2 -2
- package/package.json +3 -3
- package/node_modules/@appium/support/node_modules/asyncbox/LICENSE +0 -203
- package/node_modules/@appium/support/node_modules/asyncbox/README.md +0 -215
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts +0 -103
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js +0 -301
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/asyncbox.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts +0 -84
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/lib/types.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/cjs/package.json +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts +0 -103
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js +0 -288
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/asyncbox.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts +0 -84
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.d.ts.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js +0 -2
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/lib/types.js.map +0 -1
- package/node_modules/@appium/support/node_modules/asyncbox/build/esm/package.json +0 -3
- package/node_modules/@appium/support/node_modules/asyncbox/lib/asyncbox.ts +0 -365
- package/node_modules/@appium/support/node_modules/asyncbox/lib/types.ts +0 -88
- package/node_modules/@appium/support/node_modules/asyncbox/package.json +0 -74
- package/node_modules/@appium/support/node_modules/axios/CHANGELOG.md +0 -1872
- package/node_modules/@appium/support/node_modules/axios/LICENSE +0 -7
- package/node_modules/@appium/support/node_modules/axios/MIGRATION_GUIDE.md +0 -877
- package/node_modules/@appium/support/node_modules/axios/README.md +0 -2623
- package/node_modules/@appium/support/node_modules/axios/dist/axios.js +0 -5509
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js +0 -5
- package/node_modules/@appium/support/node_modules/axios/dist/axios.min.js.map +0 -1
- package/node_modules/@appium/support/node_modules/axios/dist/browser/axios.cjs +0 -5469
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.js +0 -5490
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/dist/esm/axios.min.js.map +0 -1
- package/node_modules/@appium/support/node_modules/axios/dist/node/axios.cjs +0 -6356
- package/node_modules/@appium/support/node_modules/axios/index.d.cts +0 -762
- package/node_modules/@appium/support/node_modules/axios/index.d.ts +0 -783
- package/node_modules/@appium/support/node_modules/axios/index.js +0 -45
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/README.md +0 -36
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/adapters.js +0 -132
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/fetch.js +0 -643
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/http.js +0 -1406
- package/node_modules/@appium/support/node_modules/axios/lib/adapters/xhr.js +0 -228
- package/node_modules/@appium/support/node_modules/axios/lib/axios.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CancelToken.js +0 -135
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/CanceledError.js +0 -22
- package/node_modules/@appium/support/node_modules/axios/lib/cancel/isCancel.js +0 -5
- package/node_modules/@appium/support/node_modules/axios/lib/core/Axios.js +0 -301
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosError.js +0 -219
- package/node_modules/@appium/support/node_modules/axios/lib/core/AxiosHeaders.js +0 -474
- package/node_modules/@appium/support/node_modules/axios/lib/core/InterceptorManager.js +0 -72
- package/node_modules/@appium/support/node_modules/axios/lib/core/README.md +0 -8
- package/node_modules/@appium/support/node_modules/axios/lib/core/buildFullPath.js +0 -88
- package/node_modules/@appium/support/node_modules/axios/lib/core/dispatchRequest.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/core/mergeConfig.js +0 -174
- package/node_modules/@appium/support/node_modules/axios/lib/core/setFormDataHeaders.js +0 -27
- package/node_modules/@appium/support/node_modules/axios/lib/core/settle.js +0 -27
- package/node_modules/@appium/support/node_modules/axios/lib/core/transformData.js +0 -28
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/index.js +0 -177
- package/node_modules/@appium/support/node_modules/axios/lib/defaults/transitional.js +0 -10
- package/node_modules/@appium/support/node_modules/axios/lib/env/README.md +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/env/classes/FormData.js +0 -2
- package/node_modules/@appium/support/node_modules/axios/lib/env/data.js +0 -1
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosTransformStream.js +0 -156
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +0 -59
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/Http2Sessions.js +0 -119
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/HttpStatusCode.js +0 -78
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/README.md +0 -7
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +0 -29
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/bind.js +0 -14
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/buildURL.js +0 -69
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/callbackify.js +0 -18
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/combineURLs.js +0 -23
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/composeSignals.js +0 -68
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/cookies.js +0 -64
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -31
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +0 -166
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToJSON.js +0 -125
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/formDataToStream.js +0 -119
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/fromDataURI.js +0 -68
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -19
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isAxiosError.js +0 -14
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -16
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/null.js +0 -2
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseHeaders.js +0 -71
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/parseProtocol.js +0 -6
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/progressEventReducer.js +0 -54
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/readBlob.js +0 -15
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/resolveConfig.js +0 -105
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +0 -60
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/shouldBypassProxy.js +0 -329
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/speedometer.js +0 -55
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/spread.js +0 -28
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/throttle.js +0 -44
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toFormData.js +0 -286
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/toURLEncodedForm.js +0 -19
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/trackStream.js +0 -89
- package/node_modules/@appium/support/node_modules/axios/lib/helpers/validator.js +0 -112
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/Blob.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/FormData.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +0 -4
- package/node_modules/@appium/support/node_modules/axios/lib/platform/browser/index.js +0 -13
- package/node_modules/@appium/support/node_modules/axios/lib/platform/common/utils.js +0 -52
- package/node_modules/@appium/support/node_modules/axios/lib/platform/index.js +0 -7
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/Buffer.js +0 -11
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/FormData.js +0 -3
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +0 -4
- package/node_modules/@appium/support/node_modules/axios/lib/platform/node/index.js +0 -37
- package/node_modules/@appium/support/node_modules/axios/lib/utils.js +0 -1029
- package/node_modules/@appium/support/node_modules/axios/package.json +0 -203
- package/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64-0.35.4.node +0 -0
- package/node_modules/big-integer/BigInteger.d.ts +0 -2393
- package/node_modules/big-integer/BigInteger.js +0 -1453
- package/node_modules/big-integer/BigInteger.min.js +0 -1
- package/node_modules/big-integer/LICENSE +0 -24
- package/node_modules/big-integer/README.md +0 -589
- package/node_modules/big-integer/bower.json +0 -29
- package/node_modules/big-integer/package.json +0 -48
- package/node_modules/big-integer/tsconfig.json +0 -24
- package/node_modules/bplist-creator/bplistCreator.d.ts +0 -8
- package/node_modules/bplist-creator/bplistCreator.js +0 -460
- package/node_modules/bplist-creator/test/airplay.bplist +0 -0
- package/node_modules/bplist-creator/test/binaryData.bplist +0 -0
- package/node_modules/bplist-creator/test/creatorTest.js +0 -211
- package/node_modules/bplist-creator/test/iTunes-small.bplist +0 -0
- package/node_modules/bplist-creator/test/integers.bplist +0 -0
- package/node_modules/bplist-creator/test/sample1.bplist +0 -0
- package/node_modules/bplist-creator/test/sample2.bplist +0 -0
- package/node_modules/bplist-creator/test/uid.bplist +0 -0
- package/node_modules/bplist-creator/test/utf16.bplist +0 -0
- package/node_modules/bplist-parser/.editorconfig +0 -12
- package/node_modules/bplist-parser/.eslintignore +0 -1
- package/node_modules/bplist-parser/.eslintrc.js +0 -296
- package/node_modules/bplist-parser/bplistParser.d.ts +0 -8
- package/node_modules/stream-buffers/.travis.yml +0 -28
- package/node_modules/stream-buffers/coverage/coverage.json +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/base.css +0 -182
- package/node_modules/stream-buffers/coverage/lcov-report/index.html +0 -73
- package/node_modules/stream-buffers/coverage/lcov-report/lib/constants.js.html +0 -63
- package/node_modules/stream-buffers/coverage/lcov-report/lib/index.html +0 -112
- package/node_modules/stream-buffers/coverage/lcov-report/lib/readable_streambuffer.js.html +0 -453
- package/node_modules/stream-buffers/coverage/lcov-report/lib/streambuffer.js.html +0 -54
- package/node_modules/stream-buffers/coverage/lcov-report/lib/writable_streambuffer.js.html +0 -336
- package/node_modules/stream-buffers/coverage/lcov-report/prettify.css +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/prettify.js +0 -1
- package/node_modules/stream-buffers/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/node_modules/stream-buffers/coverage/lcov-report/sorter.js +0 -156
- package/node_modules/stream-buffers/coverage/lcov.info +0 -305
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
// bplistCreator.ts
|
|
2
|
+
import util from "node:util";
|
|
3
|
+
import streamBuffers from "stream-buffers";
|
|
4
|
+
var debug = false;
|
|
5
|
+
var Real = class {
|
|
6
|
+
value;
|
|
7
|
+
constructor(value) {
|
|
8
|
+
this.value = value;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var bplistCreator = function bplistCreator2(dicts) {
|
|
12
|
+
const buffer = new streamBuffers.WritableStreamBuffer();
|
|
13
|
+
buffer.write(Buffer.from("bplist00"));
|
|
14
|
+
if (debug) {
|
|
15
|
+
console.log("create", util.inspect(dicts, false, 10));
|
|
16
|
+
}
|
|
17
|
+
let entries = toEntries(dicts);
|
|
18
|
+
if (debug) {
|
|
19
|
+
console.log("entries", entries);
|
|
20
|
+
}
|
|
21
|
+
const idSizeInBytes = computeIdSizeInBytes(entries.length);
|
|
22
|
+
const offsets = [];
|
|
23
|
+
let offsetSizeInBytes;
|
|
24
|
+
let offsetTableOffset;
|
|
25
|
+
updateEntryIds();
|
|
26
|
+
entries.forEach(function(entry, entryIdx) {
|
|
27
|
+
offsets[entryIdx] = buffer.size();
|
|
28
|
+
if (!entry) {
|
|
29
|
+
buffer.write(Buffer.from([0]));
|
|
30
|
+
} else {
|
|
31
|
+
write(entry);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
writeOffsetTable();
|
|
35
|
+
writeTrailer();
|
|
36
|
+
return buffer.getContents();
|
|
37
|
+
function updateEntryIds() {
|
|
38
|
+
const strings = {};
|
|
39
|
+
let entryId = 0;
|
|
40
|
+
entries.forEach(function(entry) {
|
|
41
|
+
if (entry.id) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (entry.type === "string") {
|
|
45
|
+
if (!entry.bplistOverride && Object.prototype.hasOwnProperty.call(strings, entry.value)) {
|
|
46
|
+
entry.type = "stringref";
|
|
47
|
+
entry.id = strings[entry.value];
|
|
48
|
+
} else {
|
|
49
|
+
strings[entry.value] = entry.id = entryId++;
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
entry.id = entryId++;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
entries = entries.filter(function(entry) {
|
|
56
|
+
return entry.type !== "stringref";
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function writeTrailer() {
|
|
60
|
+
if (debug) {
|
|
61
|
+
console.log("0x" + buffer.size().toString(16), "writeTrailer");
|
|
62
|
+
}
|
|
63
|
+
buffer.write(Buffer.from([0, 0, 0, 0, 0, 0]));
|
|
64
|
+
if (debug) {
|
|
65
|
+
console.log("0x" + buffer.size().toString(16), "writeTrailer(offsetSizeInBytes):", offsetSizeInBytes);
|
|
66
|
+
}
|
|
67
|
+
writeByte(offsetSizeInBytes);
|
|
68
|
+
if (debug) {
|
|
69
|
+
console.log("0x" + buffer.size().toString(16), "writeTrailer(offsetSizeInBytes):", idSizeInBytes);
|
|
70
|
+
}
|
|
71
|
+
writeByte(idSizeInBytes);
|
|
72
|
+
if (debug) {
|
|
73
|
+
console.log("0x" + buffer.size().toString(16), "writeTrailer(number of objects):", entries.length);
|
|
74
|
+
}
|
|
75
|
+
writeLong(entries.length);
|
|
76
|
+
if (debug) {
|
|
77
|
+
console.log("0x" + buffer.size().toString(16), "writeTrailer(top object)");
|
|
78
|
+
}
|
|
79
|
+
writeLong(0);
|
|
80
|
+
if (debug) {
|
|
81
|
+
console.log("0x" + buffer.size().toString(16), "writeTrailer(offset table offset):", offsetTableOffset);
|
|
82
|
+
}
|
|
83
|
+
writeLong(offsetTableOffset);
|
|
84
|
+
}
|
|
85
|
+
function writeOffsetTable() {
|
|
86
|
+
if (debug) {
|
|
87
|
+
console.log("0x" + buffer.size().toString(16), "writeOffsetTable");
|
|
88
|
+
}
|
|
89
|
+
offsetTableOffset = buffer.size();
|
|
90
|
+
offsetSizeInBytes = computeOffsetSizeInBytes(offsetTableOffset);
|
|
91
|
+
offsets.forEach(function(offset) {
|
|
92
|
+
writeBytes(offset, offsetSizeInBytes);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function write(entry) {
|
|
96
|
+
switch (entry.type) {
|
|
97
|
+
case "dict":
|
|
98
|
+
writeDict(entry);
|
|
99
|
+
break;
|
|
100
|
+
case "number":
|
|
101
|
+
case "double":
|
|
102
|
+
writeNumber(entry);
|
|
103
|
+
break;
|
|
104
|
+
case "UID":
|
|
105
|
+
writeUID(entry);
|
|
106
|
+
break;
|
|
107
|
+
case "array":
|
|
108
|
+
writeArray(entry);
|
|
109
|
+
break;
|
|
110
|
+
case "boolean":
|
|
111
|
+
writeBoolean(entry);
|
|
112
|
+
break;
|
|
113
|
+
case "string":
|
|
114
|
+
case "string-utf16":
|
|
115
|
+
writeString(entry);
|
|
116
|
+
break;
|
|
117
|
+
case "date":
|
|
118
|
+
writeDate(entry);
|
|
119
|
+
break;
|
|
120
|
+
case "data":
|
|
121
|
+
writeData(entry);
|
|
122
|
+
break;
|
|
123
|
+
default:
|
|
124
|
+
throw new Error("unhandled entry type: " + entry.type);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function writeDate(entry) {
|
|
128
|
+
writeByte(51);
|
|
129
|
+
const timestamp = entry.value instanceof Date ? entry.value.getTime() : Date.parse(entry.value);
|
|
130
|
+
if (!isFinite(timestamp)) {
|
|
131
|
+
throw new Error("invalid date: " + entry.value);
|
|
132
|
+
}
|
|
133
|
+
const date = timestamp / 1e3 - 978307200;
|
|
134
|
+
writeDouble(date);
|
|
135
|
+
}
|
|
136
|
+
function writeDict(entry) {
|
|
137
|
+
if (debug) {
|
|
138
|
+
const keysStr = entry.entryKeys.map(function(k) {
|
|
139
|
+
return k.id;
|
|
140
|
+
});
|
|
141
|
+
const valsStr = entry.entryValues.map(function(k) {
|
|
142
|
+
return k.id;
|
|
143
|
+
});
|
|
144
|
+
console.log("0x" + buffer.size().toString(16), "writeDict", "(id: " + entry.id + ")", "(keys: " + keysStr + ")", "(values: " + valsStr + ")");
|
|
145
|
+
}
|
|
146
|
+
writeIntHeader(13, entry.entryKeys.length);
|
|
147
|
+
entry.entryKeys.forEach(function(entry2) {
|
|
148
|
+
writeID(entry2.id);
|
|
149
|
+
});
|
|
150
|
+
entry.entryValues.forEach(function(entry2) {
|
|
151
|
+
writeID(entry2.id);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
function writeNumber(entry) {
|
|
155
|
+
if (debug) {
|
|
156
|
+
console.log("0x" + buffer.size().toString(16), "writeNumber", entry.value, " (type: " + entry.type + ")", "(id: " + entry.id + ")");
|
|
157
|
+
}
|
|
158
|
+
if (entry.type !== "double" && isIntegerValue(entry.value)) {
|
|
159
|
+
writeInteger(entry.value);
|
|
160
|
+
} else {
|
|
161
|
+
writeByte(35);
|
|
162
|
+
writeDouble(Number(entry.value));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function writeInteger(value) {
|
|
166
|
+
const integer = toBigInt(value);
|
|
167
|
+
if (integer < 0n) {
|
|
168
|
+
writeByte(19);
|
|
169
|
+
writeBytes(integer, 8, true);
|
|
170
|
+
} else if (integer <= 0xffn) {
|
|
171
|
+
writeByte(16);
|
|
172
|
+
writeBytes(integer, 1);
|
|
173
|
+
} else if (integer <= 0xffffn) {
|
|
174
|
+
writeByte(17);
|
|
175
|
+
writeBytes(integer, 2);
|
|
176
|
+
} else if (integer <= 0xffffffffn) {
|
|
177
|
+
writeByte(18);
|
|
178
|
+
writeBytes(integer, 4);
|
|
179
|
+
} else if (integer <= 0x7fffffffffffffffn) {
|
|
180
|
+
writeByte(19);
|
|
181
|
+
writeBytes(integer, 8);
|
|
182
|
+
} else {
|
|
183
|
+
writeByte(20);
|
|
184
|
+
writeBytes(integer, 16);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function writeUID(entry) {
|
|
188
|
+
if (debug) {
|
|
189
|
+
console.log("0x" + buffer.size().toString(16), "writeUID", entry.value, " (type: " + entry.type + ")", "(id: " + entry.id + ")");
|
|
190
|
+
}
|
|
191
|
+
const value = toBigInt(entry.value);
|
|
192
|
+
const bytes = computeUIDSizeInBytes(value);
|
|
193
|
+
writeByte(128 | bytes - 1);
|
|
194
|
+
writeBytes(value, bytes);
|
|
195
|
+
}
|
|
196
|
+
function writeArray(entry) {
|
|
197
|
+
if (debug) {
|
|
198
|
+
console.log("0x" + buffer.size().toString(16), "writeArray (length: " + entry.entries.length + ")", "(id: " + entry.id + ")");
|
|
199
|
+
}
|
|
200
|
+
writeIntHeader(10, entry.entries.length);
|
|
201
|
+
entry.entries.forEach(function(e) {
|
|
202
|
+
writeID(e.id);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function writeBoolean(entry) {
|
|
206
|
+
if (debug) {
|
|
207
|
+
console.log("0x" + buffer.size().toString(16), "writeBoolean", entry.value, "(id: " + entry.id + ")");
|
|
208
|
+
}
|
|
209
|
+
writeByte(entry.value ? 9 : 8);
|
|
210
|
+
}
|
|
211
|
+
function writeString(entry) {
|
|
212
|
+
if (debug) {
|
|
213
|
+
console.log("0x" + buffer.size().toString(16), "writeString", entry.value, "(id: " + entry.id + ")");
|
|
214
|
+
}
|
|
215
|
+
if (entry.type === "string-utf16" || mustBeUtf16(entry.value)) {
|
|
216
|
+
const utf16 = Buffer.from(entry.value, "ucs2");
|
|
217
|
+
writeIntHeader(6, utf16.length / 2);
|
|
218
|
+
for (let i = 0; i < utf16.length; i += 2) {
|
|
219
|
+
const t = utf16[i + 0];
|
|
220
|
+
utf16[i + 0] = utf16[i + 1];
|
|
221
|
+
utf16[i + 1] = t;
|
|
222
|
+
}
|
|
223
|
+
buffer.write(utf16);
|
|
224
|
+
} else {
|
|
225
|
+
const utf8 = Buffer.from(entry.value, "ascii");
|
|
226
|
+
writeIntHeader(5, utf8.length);
|
|
227
|
+
buffer.write(utf8);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function writeData(entry) {
|
|
231
|
+
if (debug) {
|
|
232
|
+
console.log("0x" + buffer.size().toString(16), "writeData", entry.value, "(id: " + entry.id + ")");
|
|
233
|
+
}
|
|
234
|
+
writeIntHeader(4, entry.value.length);
|
|
235
|
+
buffer.write(entry.value);
|
|
236
|
+
}
|
|
237
|
+
function writeLong(l) {
|
|
238
|
+
writeBytes(l, 8);
|
|
239
|
+
}
|
|
240
|
+
function writeByte(b) {
|
|
241
|
+
buffer.write(Buffer.from([b]));
|
|
242
|
+
}
|
|
243
|
+
function writeDouble(v) {
|
|
244
|
+
const buf = Buffer.alloc(8);
|
|
245
|
+
buf.writeDoubleBE(v, 0);
|
|
246
|
+
buffer.write(buf);
|
|
247
|
+
}
|
|
248
|
+
function writeIntHeader(kind, value) {
|
|
249
|
+
if (value < 15) {
|
|
250
|
+
writeByte((kind << 4) + value);
|
|
251
|
+
} else if (value < 256) {
|
|
252
|
+
writeByte((kind << 4) + 15);
|
|
253
|
+
writeByte(16);
|
|
254
|
+
writeBytes(value, 1);
|
|
255
|
+
} else if (value < 65536) {
|
|
256
|
+
writeByte((kind << 4) + 15);
|
|
257
|
+
writeByte(17);
|
|
258
|
+
writeBytes(value, 2);
|
|
259
|
+
} else {
|
|
260
|
+
writeByte((kind << 4) + 15);
|
|
261
|
+
writeByte(18);
|
|
262
|
+
writeBytes(value, 4);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
function writeID(id) {
|
|
266
|
+
writeBytes(id, idSizeInBytes);
|
|
267
|
+
}
|
|
268
|
+
function writeBytes(value, bytes, isSignedInt) {
|
|
269
|
+
let integer = toBigInt(value);
|
|
270
|
+
const bits = BigInt(bytes * 8);
|
|
271
|
+
const limit = 1n << bits;
|
|
272
|
+
if (isSignedInt) {
|
|
273
|
+
const signedLimit = 1n << bits - 1n;
|
|
274
|
+
if (integer < -signedLimit || integer >= signedLimit) {
|
|
275
|
+
throw new Error("integer out of range for " + bytes + " signed bytes: " + value);
|
|
276
|
+
}
|
|
277
|
+
if (integer < 0n) {
|
|
278
|
+
integer = limit + integer;
|
|
279
|
+
}
|
|
280
|
+
} else if (integer < 0n || integer >= limit) {
|
|
281
|
+
throw new Error("integer out of range for " + bytes + " unsigned bytes: " + value);
|
|
282
|
+
}
|
|
283
|
+
const buf = Buffer.alloc(bytes);
|
|
284
|
+
for (let i = bytes - 1; i >= 0; i--) {
|
|
285
|
+
buf[i] = Number(integer & 0xffn);
|
|
286
|
+
integer >>= 8n;
|
|
287
|
+
}
|
|
288
|
+
buffer.write(buf);
|
|
289
|
+
}
|
|
290
|
+
function isIntegerValue(value) {
|
|
291
|
+
if (typeof value === "bigint") {
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
if (typeof value === "number") {
|
|
295
|
+
return isFinite(value) && Math.floor(value) === value;
|
|
296
|
+
}
|
|
297
|
+
if (typeof value === "string") {
|
|
298
|
+
return /^-?\d+$/.test(value);
|
|
299
|
+
}
|
|
300
|
+
return !!value && typeof value.toString === "function" && /^-?\d+$/.test(String(value));
|
|
301
|
+
}
|
|
302
|
+
function toBigInt(value) {
|
|
303
|
+
if (typeof value === "bigint") {
|
|
304
|
+
return value;
|
|
305
|
+
}
|
|
306
|
+
if (typeof value === "number") {
|
|
307
|
+
return BigInt(value);
|
|
308
|
+
}
|
|
309
|
+
return BigInt(String(value));
|
|
310
|
+
}
|
|
311
|
+
function mustBeUtf16(string) {
|
|
312
|
+
return Buffer.byteLength(string, "utf8") !== string.length;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
function toEntries(dicts) {
|
|
316
|
+
if (dicts.bplistOverride) {
|
|
317
|
+
return [dicts];
|
|
318
|
+
}
|
|
319
|
+
if (dicts instanceof Array) {
|
|
320
|
+
return toEntriesArray(dicts);
|
|
321
|
+
} else if (dicts instanceof Buffer) {
|
|
322
|
+
return [
|
|
323
|
+
{
|
|
324
|
+
type: "data",
|
|
325
|
+
value: dicts
|
|
326
|
+
}
|
|
327
|
+
];
|
|
328
|
+
} else if (dicts instanceof Real) {
|
|
329
|
+
return [
|
|
330
|
+
{
|
|
331
|
+
type: "double",
|
|
332
|
+
value: dicts.value
|
|
333
|
+
}
|
|
334
|
+
];
|
|
335
|
+
} else if (typeof dicts === "object") {
|
|
336
|
+
if (dicts instanceof Date) {
|
|
337
|
+
return [
|
|
338
|
+
{
|
|
339
|
+
type: "date",
|
|
340
|
+
value: dicts
|
|
341
|
+
}
|
|
342
|
+
];
|
|
343
|
+
} else if (Object.keys(dicts).length === 1 && (typeof dicts.UID === "number" || typeof dicts.UID === "bigint")) {
|
|
344
|
+
return [
|
|
345
|
+
{
|
|
346
|
+
type: "UID",
|
|
347
|
+
value: dicts.UID
|
|
348
|
+
}
|
|
349
|
+
];
|
|
350
|
+
} else {
|
|
351
|
+
return toEntriesObject(dicts);
|
|
352
|
+
}
|
|
353
|
+
} else if (typeof dicts === "string") {
|
|
354
|
+
return [
|
|
355
|
+
{
|
|
356
|
+
type: "string",
|
|
357
|
+
value: dicts
|
|
358
|
+
}
|
|
359
|
+
];
|
|
360
|
+
} else if (typeof dicts === "number") {
|
|
361
|
+
return [
|
|
362
|
+
{
|
|
363
|
+
type: "number",
|
|
364
|
+
value: dicts
|
|
365
|
+
}
|
|
366
|
+
];
|
|
367
|
+
} else if (typeof dicts === "boolean") {
|
|
368
|
+
return [
|
|
369
|
+
{
|
|
370
|
+
type: "boolean",
|
|
371
|
+
value: dicts
|
|
372
|
+
}
|
|
373
|
+
];
|
|
374
|
+
} else if (typeof dicts === "bigint") {
|
|
375
|
+
return [
|
|
376
|
+
{
|
|
377
|
+
type: "number",
|
|
378
|
+
value: dicts
|
|
379
|
+
}
|
|
380
|
+
];
|
|
381
|
+
} else {
|
|
382
|
+
throw new Error("unhandled entry: " + dicts);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function toEntriesArray(arr) {
|
|
386
|
+
if (debug) {
|
|
387
|
+
console.log("toEntriesArray");
|
|
388
|
+
}
|
|
389
|
+
let results = [
|
|
390
|
+
{
|
|
391
|
+
type: "array",
|
|
392
|
+
entries: []
|
|
393
|
+
}
|
|
394
|
+
];
|
|
395
|
+
const arrayEntry = results[0];
|
|
396
|
+
arr.forEach(function(v) {
|
|
397
|
+
const entry = toEntries(v);
|
|
398
|
+
arrayEntry.entries.push(entry[0]);
|
|
399
|
+
results = results.concat(entry);
|
|
400
|
+
});
|
|
401
|
+
return results;
|
|
402
|
+
}
|
|
403
|
+
function toEntriesObject(dict) {
|
|
404
|
+
if (debug) {
|
|
405
|
+
console.log("toEntriesObject");
|
|
406
|
+
}
|
|
407
|
+
let results = [
|
|
408
|
+
{
|
|
409
|
+
type: "dict",
|
|
410
|
+
entryKeys: [],
|
|
411
|
+
entryValues: []
|
|
412
|
+
}
|
|
413
|
+
];
|
|
414
|
+
const dictEntry = results[0];
|
|
415
|
+
Object.keys(dict).forEach(function(key) {
|
|
416
|
+
const entryKey = toEntries(key);
|
|
417
|
+
dictEntry.entryKeys.push(entryKey[0]);
|
|
418
|
+
results = results.concat(entryKey[0]);
|
|
419
|
+
});
|
|
420
|
+
Object.keys(dict).forEach(function(key) {
|
|
421
|
+
const entryValue = toEntries(dict[key]);
|
|
422
|
+
dictEntry.entryValues.push(entryValue[0]);
|
|
423
|
+
results = results.concat(entryValue);
|
|
424
|
+
});
|
|
425
|
+
return results;
|
|
426
|
+
}
|
|
427
|
+
function computeOffsetSizeInBytes(maxOffset) {
|
|
428
|
+
if (maxOffset < 256) {
|
|
429
|
+
return 1;
|
|
430
|
+
}
|
|
431
|
+
if (maxOffset < 65536) {
|
|
432
|
+
return 2;
|
|
433
|
+
}
|
|
434
|
+
if (maxOffset < 4294967296) {
|
|
435
|
+
return 4;
|
|
436
|
+
}
|
|
437
|
+
return 8;
|
|
438
|
+
}
|
|
439
|
+
function computeIdSizeInBytes(numberOfIds) {
|
|
440
|
+
if (numberOfIds < 256) {
|
|
441
|
+
return 1;
|
|
442
|
+
}
|
|
443
|
+
if (numberOfIds < 65536) {
|
|
444
|
+
return 2;
|
|
445
|
+
}
|
|
446
|
+
return 4;
|
|
447
|
+
}
|
|
448
|
+
function computeUIDSizeInBytes(value) {
|
|
449
|
+
if (value < 0n) {
|
|
450
|
+
throw new Error("UID out of range: " + value);
|
|
451
|
+
}
|
|
452
|
+
if (value <= 0xffn) {
|
|
453
|
+
return 1;
|
|
454
|
+
}
|
|
455
|
+
if (value <= 0xffffn) {
|
|
456
|
+
return 2;
|
|
457
|
+
}
|
|
458
|
+
if (value <= 0xffffffffn) {
|
|
459
|
+
return 4;
|
|
460
|
+
}
|
|
461
|
+
if (value <= 0xffffffffffffffffn) {
|
|
462
|
+
return 8;
|
|
463
|
+
}
|
|
464
|
+
throw new Error("UID out of range: " + value);
|
|
465
|
+
}
|
|
466
|
+
bplistCreator.Real = Real;
|
|
467
|
+
var bplistCreator_default = bplistCreator;
|
|
468
|
+
export {
|
|
469
|
+
Real,
|
|
470
|
+
bplistCreator_default as default
|
|
471
|
+
};
|
|
472
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../bplistCreator.ts"],
|
|
4
|
+
"sourcesContent": ["// adapted from http://code.google.com/p/plist/source/browse/trunk/src/main/java/com/dd/plist/BinaryPropertyListWriter.java\n\nimport util from 'node:util';\nimport streamBuffers from 'stream-buffers';\n\nconst debug = false;\n\nexport type PlistJsObj = any[] | Record<any, any>;\n\n/** Wraps a number so it is always encoded as a binary plist `real`. */\nexport class Real {\n value: number;\n\n constructor(value: number) {\n this.value = value;\n }\n}\n\ntype DictEntry = { type: 'dict'; entryKeys: Entry[]; entryValues: Entry[]; id?: number };\ntype NumberEntry = { type: 'number' | 'double'; value: number | bigint; id?: number; bplistOverride?: true };\ntype UidEntry = { type: 'UID'; value: number | bigint; id?: number };\ntype ArrayEntry = { type: 'array'; entries: Entry[]; id?: number };\ntype BooleanEntry = { type: 'boolean'; value: boolean; id?: number };\ntype StringEntry = {\n type: 'string' | 'string-utf16' | 'stringref';\n value: string;\n id?: number;\n bplistOverride?: true;\n};\ntype DateEntry = { type: 'date'; value: Date | string; id?: number };\ntype DataEntry = { type: 'data'; value: Buffer; id?: number };\n\ntype Entry = DictEntry | NumberEntry | UidEntry | ArrayEntry | BooleanEntry | StringEntry | DateEntry | DataEntry;\n\ninterface BplistCreator {\n (dicts: PlistJsObj): Buffer;\n Real: typeof Real;\n}\n\nconst bplistCreator = function bplistCreator(dicts: PlistJsObj): Buffer {\n const buffer = new streamBuffers.WritableStreamBuffer();\n buffer.write(Buffer.from(\"bplist00\"));\n\n if (debug) {\n console.log('create', util.inspect(dicts, false, 10));\n }\n\n let entries = toEntries(dicts);\n if (debug) {\n console.log('entries', entries);\n }\n const idSizeInBytes = computeIdSizeInBytes(entries.length);\n const offsets: number[] = [];\n let offsetSizeInBytes: number;\n let offsetTableOffset: number;\n\n updateEntryIds();\n\n entries.forEach(function(entry, entryIdx) {\n offsets[entryIdx] = buffer.size();\n if (!entry) {\n buffer.write(Buffer.from([0x00]));\n } else {\n write(entry);\n }\n });\n\n writeOffsetTable();\n writeTrailer();\n return buffer.getContents() as Buffer;\n\n function updateEntryIds() {\n const strings: Record<string, number> = {};\n let entryId = 0;\n entries.forEach(function(entry) {\n if (entry.id) {\n return;\n }\n if (entry.type === 'string') {\n if (!entry.bplistOverride && Object.prototype.hasOwnProperty.call(strings, entry.value)) {\n (entry as StringEntry).type = 'stringref';\n entry.id = strings[entry.value];\n } else {\n strings[entry.value] = entry.id = entryId++;\n }\n } else {\n entry.id = entryId++;\n }\n });\n\n entries = entries.filter(function(entry) {\n return (entry.type !== 'stringref');\n });\n }\n\n function writeTrailer() {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeTrailer');\n }\n // 6 null bytes\n buffer.write(Buffer.from([0, 0, 0, 0, 0, 0]));\n\n // size of an offset\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeTrailer(offsetSizeInBytes):', offsetSizeInBytes);\n }\n writeByte(offsetSizeInBytes);\n\n // size of a ref\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeTrailer(offsetSizeInBytes):', idSizeInBytes);\n }\n writeByte(idSizeInBytes);\n\n // number of objects\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeTrailer(number of objects):', entries.length);\n }\n writeLong(entries.length);\n\n // top object\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeTrailer(top object)');\n }\n writeLong(0);\n\n // offset table offset\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeTrailer(offset table offset):', offsetTableOffset);\n }\n writeLong(offsetTableOffset);\n }\n\n function writeOffsetTable() {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeOffsetTable');\n }\n offsetTableOffset = buffer.size();\n offsetSizeInBytes = computeOffsetSizeInBytes(offsetTableOffset);\n offsets.forEach(function(offset) {\n writeBytes(offset, offsetSizeInBytes);\n });\n }\n\n function write(entry: Entry) {\n switch (entry.type) {\n case 'dict':\n writeDict(entry);\n break;\n case 'number':\n case 'double':\n writeNumber(entry);\n break;\n case 'UID':\n writeUID(entry);\n break;\n case 'array':\n writeArray(entry);\n break;\n case 'boolean':\n writeBoolean(entry);\n break;\n case 'string':\n case 'string-utf16':\n writeString(entry);\n break;\n case 'date':\n writeDate(entry);\n break;\n case 'data':\n writeData(entry);\n break;\n default:\n throw new Error(\"unhandled entry type: \" + (entry as Entry).type);\n }\n }\n\n function writeDate(entry: DateEntry) {\n writeByte(0x33);\n const timestamp = entry.value instanceof Date ? entry.value.getTime() : Date.parse(entry.value);\n if (!isFinite(timestamp)) {\n throw new Error('invalid date: ' + entry.value);\n }\n const date = (timestamp / 1000) - 978307200;\n writeDouble(date);\n }\n\n function writeDict(entry: DictEntry) {\n if (debug) {\n const keysStr = entry.entryKeys.map(function(k) {return k.id;});\n const valsStr = entry.entryValues.map(function(k) {return k.id;});\n console.log('0x' + buffer.size().toString(16), 'writeDict', '(id: ' + entry.id + ')', '(keys: ' + keysStr + ')', '(values: ' + valsStr + ')');\n }\n writeIntHeader(0xD, entry.entryKeys.length);\n entry.entryKeys.forEach(function(entry) {\n writeID(entry.id as number);\n });\n entry.entryValues.forEach(function(entry) {\n writeID(entry.id as number);\n });\n }\n\n function writeNumber(entry: NumberEntry) {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeNumber', entry.value, ' (type: ' + entry.type + ')', '(id: ' + entry.id + ')');\n }\n\n if (entry.type !== 'double' && isIntegerValue(entry.value)) {\n writeInteger(entry.value);\n } else {\n writeByte(0x23);\n writeDouble(Number(entry.value));\n }\n }\n\n function writeInteger(value: number | bigint) {\n const integer = toBigInt(value);\n\n if (integer < 0n) {\n writeByte(0x13);\n writeBytes(integer, 8, true);\n } else if (integer <= 0xffn) {\n writeByte(0x10);\n writeBytes(integer, 1);\n } else if (integer <= 0xffffn) {\n writeByte(0x11);\n writeBytes(integer, 2);\n } else if (integer <= 0xffffffffn) {\n writeByte(0x12);\n writeBytes(integer, 4);\n } else if (integer <= 0x7fffffffffffffffn) {\n writeByte(0x13);\n writeBytes(integer, 8);\n } else {\n writeByte(0x14);\n writeBytes(integer, 16);\n }\n }\n\n function writeUID(entry: UidEntry) {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeUID', entry.value, ' (type: ' + entry.type + ')', '(id: ' + entry.id + ')');\n }\n\n const value = toBigInt(entry.value);\n const bytes = computeUIDSizeInBytes(value);\n writeByte(0x80 | (bytes - 1));\n writeBytes(value, bytes);\n }\n\n function writeArray(entry: ArrayEntry) {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeArray (length: ' + entry.entries.length + ')', '(id: ' + entry.id + ')');\n }\n writeIntHeader(0xA, entry.entries.length);\n entry.entries.forEach(function(e) {\n writeID(e.id as number);\n });\n }\n\n function writeBoolean(entry: BooleanEntry) {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeBoolean', entry.value, '(id: ' + entry.id + ')');\n }\n writeByte(entry.value ? 0x09 : 0x08);\n }\n\n function writeString(entry: StringEntry) {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeString', entry.value, '(id: ' + entry.id + ')');\n }\n if (entry.type === 'string-utf16' || mustBeUtf16(entry.value)) {\n const utf16 = Buffer.from(entry.value, 'ucs2');\n writeIntHeader(0x6, utf16.length / 2);\n // needs to be big endian so swap the bytes\n for (let i = 0; i < utf16.length; i += 2) {\n const t = utf16[i + 0];\n utf16[i + 0] = utf16[i + 1];\n utf16[i + 1] = t;\n }\n buffer.write(utf16);\n } else {\n const utf8 = Buffer.from(entry.value, 'ascii');\n writeIntHeader(0x5, utf8.length);\n buffer.write(utf8);\n }\n }\n\n function writeData(entry: DataEntry) {\n if (debug) {\n console.log('0x' + buffer.size().toString(16), 'writeData', entry.value, '(id: ' + entry.id + ')');\n }\n writeIntHeader(0x4, entry.value.length);\n buffer.write(entry.value);\n }\n\n function writeLong(l: number) {\n writeBytes(l, 8);\n }\n\n function writeByte(b: number) {\n buffer.write(Buffer.from([b]));\n }\n\n function writeDouble(v: number) {\n const buf = Buffer.alloc(8);\n buf.writeDoubleBE(v, 0);\n buffer.write(buf);\n }\n\n function writeIntHeader(kind: number, value: number) {\n if (value < 15) {\n writeByte((kind << 4) + value);\n } else if (value < 256) {\n writeByte((kind << 4) + 15);\n writeByte(0x10);\n writeBytes(value, 1);\n } else if (value < 65536) {\n writeByte((kind << 4) + 15);\n writeByte(0x11);\n writeBytes(value, 2);\n } else {\n writeByte((kind << 4) + 15);\n writeByte(0x12);\n writeBytes(value, 4);\n }\n }\n\n function writeID(id: number) {\n writeBytes(id, idSizeInBytes);\n }\n\n function writeBytes(value: number | bigint, bytes: number, isSignedInt?: boolean) {\n let integer = toBigInt(value);\n const bits = BigInt(bytes * 8);\n const limit = 1n << bits;\n\n if (isSignedInt) {\n const signedLimit = 1n << (bits - 1n);\n if (integer < -signedLimit || integer >= signedLimit) {\n throw new Error('integer out of range for ' + bytes + ' signed bytes: ' + value);\n }\n if (integer < 0n) {\n integer = limit + integer;\n }\n } else if (integer < 0n || integer >= limit) {\n throw new Error('integer out of range for ' + bytes + ' unsigned bytes: ' + value);\n }\n\n const buf = Buffer.alloc(bytes);\n for (let i = bytes - 1; i >= 0; i--) {\n buf[i] = Number(integer & 0xffn);\n integer >>= 8n;\n }\n buffer.write(buf);\n }\n\n function isIntegerValue(value: unknown): boolean {\n if (typeof value === 'bigint') {\n return true;\n }\n if (typeof value === 'number') {\n return isFinite(value) && Math.floor(value) === value;\n }\n if (typeof value === 'string') {\n return /^-?\\d+$/.test(value);\n }\n return !!value && typeof (value as { toString?: unknown }).toString === 'function' && /^-?\\d+$/.test(String(value));\n }\n\n function toBigInt(value: unknown): bigint {\n if (typeof value === 'bigint') {\n return value;\n }\n if (typeof value === 'number') {\n return BigInt(value);\n }\n return BigInt(String(value));\n }\n\n function mustBeUtf16(string: string) {\n return Buffer.byteLength(string, 'utf8') !== string.length;\n }\n} as BplistCreator;\n\nfunction toEntries(dicts: any): Entry[] {\n if (dicts.bplistOverride) {\n return [dicts];\n }\n\n if (dicts instanceof Array) {\n return toEntriesArray(dicts);\n } else if (dicts instanceof Buffer) {\n return [\n {\n type: 'data',\n value: dicts\n }\n ];\n } else if (dicts instanceof Real) {\n return [\n {\n type: 'double',\n value: dicts.value\n }\n ];\n } else if (typeof(dicts) === 'object') {\n if (dicts instanceof Date) {\n return [\n {\n type: 'date',\n value: dicts\n }\n ];\n } else if (Object.keys(dicts).length === 1 && (typeof(dicts.UID) === 'number' || typeof(dicts.UID) === 'bigint')) {\n return [\n {\n type: 'UID',\n value: dicts.UID\n }\n ];\n } else {\n return toEntriesObject(dicts);\n }\n } else if (typeof(dicts) === 'string') {\n return [\n {\n type: 'string',\n value: dicts\n }\n ];\n } else if (typeof(dicts) === 'number') {\n return [\n {\n type: 'number',\n value: dicts\n }\n ];\n } else if (typeof(dicts) === 'boolean') {\n return [\n {\n type: 'boolean',\n value: dicts\n }\n ];\n } else if (typeof(dicts) === 'bigint') {\n return [\n {\n type: 'number',\n value: dicts\n }\n ];\n } else {\n throw new Error('unhandled entry: ' + dicts);\n }\n}\n\nfunction toEntriesArray(arr: any[]): Entry[] {\n if (debug) {\n console.log('toEntriesArray');\n }\n let results: Entry[] = [\n {\n type: 'array',\n entries: []\n }\n ];\n const arrayEntry = results[0] as ArrayEntry;\n arr.forEach(function(v) {\n const entry = toEntries(v);\n arrayEntry.entries.push(entry[0]);\n results = results.concat(entry);\n });\n return results;\n}\n\nfunction toEntriesObject(dict: Record<string, any>): Entry[] {\n if (debug) {\n console.log('toEntriesObject');\n }\n let results: Entry[] = [\n {\n type: 'dict',\n entryKeys: [],\n entryValues: []\n }\n ];\n const dictEntry = results[0] as DictEntry;\n Object.keys(dict).forEach(function(key) {\n const entryKey = toEntries(key);\n dictEntry.entryKeys.push(entryKey[0]);\n results = results.concat(entryKey[0]);\n });\n Object.keys(dict).forEach(function(key) {\n const entryValue = toEntries(dict[key]);\n dictEntry.entryValues.push(entryValue[0]);\n results = results.concat(entryValue);\n });\n return results;\n}\n\nfunction computeOffsetSizeInBytes(maxOffset: number): number {\n if (maxOffset < 256) {\n return 1;\n }\n if (maxOffset < 65536) {\n return 2;\n }\n if (maxOffset < 4294967296) {\n return 4;\n }\n return 8;\n}\n\nfunction computeIdSizeInBytes(numberOfIds: number): number {\n if (numberOfIds < 256) {\n return 1;\n }\n if (numberOfIds < 65536) {\n return 2;\n }\n return 4;\n}\n\nfunction computeUIDSizeInBytes(value: bigint): number {\n if (value < 0n) {\n throw new Error('UID out of range: ' + value);\n }\n if (value <= 0xffn) {\n return 1;\n }\n if (value <= 0xffffn) {\n return 2;\n }\n if (value <= 0xffffffffn) {\n return 4;\n }\n if (value <= 0xffffffffffffffffn) {\n return 8;\n }\n throw new Error('UID out of range: ' + value);\n}\n\n// Kept as a property of the default export so CommonJS consumers can continue\n// to reach it via `require('bplist-creator').Real`.\nbplistCreator.Real = Real;\n\nexport default bplistCreator;\n"],
|
|
5
|
+
"mappings": ";AAEA,OAAO,UAAU;AACjB,OAAO,mBAAmB;AAE1B,IAAM,QAAQ;AAKP,IAAM,OAAN,MAAW;AAAA,EAChB;AAAA,EAEA,YAAY,OAAe;AACzB,SAAK,QAAQ;AAAA,EACf;AACF;AAuBA,IAAM,gBAAgB,SAASA,eAAc,OAA2B;AACtE,QAAM,SAAS,IAAI,cAAc,qBAAqB;AACtD,SAAO,MAAM,OAAO,KAAK,UAAU,CAAC;AAEpC,MAAI,OAAO;AACT,YAAQ,IAAI,UAAU,KAAK,QAAQ,OAAO,OAAO,EAAE,CAAC;AAAA,EACtD;AAEA,MAAI,UAAU,UAAU,KAAK;AAC7B,MAAI,OAAO;AACT,YAAQ,IAAI,WAAW,OAAO;AAAA,EAChC;AACA,QAAM,gBAAgB,qBAAqB,QAAQ,MAAM;AACzD,QA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description": "Binary Mac OS X Plist (property list) creator.",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.mjs"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./package.json": "./package.json"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
6
25
|
"scripts": {
|
|
7
|
-
"
|
|
26
|
+
"build": "node build.js",
|
|
27
|
+
"lint": "eslint .",
|
|
28
|
+
"typecheck": "tsc --noEmit",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"smoke": "npm run build && node smoke.cjs",
|
|
31
|
+
"prepublishOnly": "npm run typecheck && npm run build"
|
|
8
32
|
},
|
|
9
33
|
"repository": {
|
|
10
34
|
"type": "git",
|
|
11
|
-
"url": "https://github.com/
|
|
35
|
+
"url": "https://github.com/joeferner/node-bplist-creator.git"
|
|
12
36
|
},
|
|
13
37
|
"keywords": [
|
|
14
38
|
"bplist",
|
|
@@ -17,12 +41,22 @@
|
|
|
17
41
|
],
|
|
18
42
|
"author": "Joe Ferner",
|
|
19
43
|
"license": "MIT",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"stream-buffers": "3.0.x"
|
|
46
|
+
},
|
|
20
47
|
"devDependencies": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
48
|
+
"@eslint/js": "10.0.x",
|
|
49
|
+
"@types/node": "26.4.x",
|
|
50
|
+
"@types/stream-buffers": "3.0.x",
|
|
51
|
+
"bplist-parser": "0.5.x",
|
|
52
|
+
"esbuild": "0.28.x",
|
|
53
|
+
"eslint": "10.10.x",
|
|
54
|
+
"globals": "17.12.x",
|
|
55
|
+
"typescript": "6.0.x",
|
|
56
|
+
"typescript-eslint": "8.69.x",
|
|
57
|
+
"vitest": "5.0.x"
|
|
24
58
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=20.19.0"
|
|
27
61
|
}
|
|
28
62
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# bplist-parser
|
|
2
2
|
|
|
3
|
+
[](https://github.com/joeferner/node-bplist-parser/actions/workflows/ci.yml)
|
|
4
|
+
|
|
3
5
|
Binary Mac OS X Plist (property list) parser.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -10,18 +12,50 @@ $ npm install bplist-parser
|
|
|
10
12
|
|
|
11
13
|
## Quick Examples
|
|
12
14
|
|
|
15
|
+
This package ships both ES module and CommonJS builds, so either import style works.
|
|
16
|
+
|
|
13
17
|
```javascript
|
|
18
|
+
// ESM
|
|
19
|
+
import { parseFile } from 'bplist-parser';
|
|
20
|
+
|
|
21
|
+
const [obj] = await parseFile('myPlist.bplist');
|
|
22
|
+
console.log(JSON.stringify(obj));
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```javascript
|
|
26
|
+
// CommonJS
|
|
14
27
|
const bplist = require('bplist-parser');
|
|
15
28
|
|
|
16
29
|
(async () => {
|
|
30
|
+
const [obj] = await bplist.parseFile('myPlist.bplist');
|
|
31
|
+
console.log(JSON.stringify(obj));
|
|
32
|
+
})();
|
|
33
|
+
```
|
|
17
34
|
|
|
18
|
-
|
|
35
|
+
`parseFileSync` and `parseBuffer` are also exported, and both return an array of
|
|
36
|
+
the plist's root objects.
|
|
19
37
|
|
|
20
|
-
|
|
38
|
+
## Limits
|
|
21
39
|
|
|
22
|
-
|
|
40
|
+
The parser refuses plists that would allocate more than `maxObjectSize` bytes or
|
|
41
|
+
contain more than `maxObjectCount` objects. Both are readable as exports and
|
|
42
|
+
adjusted through setters:
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
import { setMaxObjectSize, setMaxObjectCount } from 'bplist-parser';
|
|
46
|
+
|
|
47
|
+
setMaxObjectSize(200 * 1000 * 1000);
|
|
48
|
+
setMaxObjectCount(65536);
|
|
23
49
|
```
|
|
24
50
|
|
|
51
|
+
> **Note:** before 0.4.0 these were assignable (`bplist.maxObjectSize = n`).
|
|
52
|
+
> Exported bindings are read-only in both module systems now, so assignment must
|
|
53
|
+
> be replaced with the setters above.
|
|
54
|
+
|
|
55
|
+
## Requirements
|
|
56
|
+
|
|
57
|
+
Node.js 20.19 or newer.
|
|
58
|
+
|
|
25
59
|
## License
|
|
26
60
|
|
|
27
61
|
(The MIT License)
|