diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000000000000000000000000000000000..f2a5b449368d45acc2747e118eb6ee4c6e6eb2fb --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +okio/src/main/ets/utils/Utilities.js \ No newline at end of file diff --git a/.gitignore b/.gitignore index b95ee6bd39152d449da19b133622a48dbfa1ef8c..a98ead0809297b5cf28b08203aad1ffaf73e32b6 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ .cxx /node_modules .idea +.hvigor +package-lock.json diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9c1e6094c4ee7cae44e0bac62f7f313f1c5e5ab2 --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,11 @@ +{ + "app": { + "bundleName": "cn.openharmony.okio.sample", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..633e227f813513911c69d79184a504d0da1b1d27 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "okio" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/AppScope/resources/base/media/app_icon.png differ diff --git a/CHANGELOG.md b/CHANGELOG.md index 31c8bce6855d3dd3b4aced1747bf9cd73b356200..8f4bf639719a464e4959cebab05fef0ee68bc7e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -##1.0.0 +## 1.0.1 + +适配DevEco Studio 3.1 Beta1及以上版本 + +## 1.0.0 1、在Openharmony框架中使用JS语言移植适配okio diff --git a/OAT.xml b/OAT.xml index c272048c77a5ab63c9a8913bb4c24cb822b443a2..7c12ea656ddcb2cbb6fde70e66b2e96ff98772a1 100644 --- a/OAT.xml +++ b/OAT.xml @@ -2,15 +2,33 @@ - - - + + + - - - + + + - + diff --git a/README.en.md b/README.en.md deleted file mode 100644 index e3caca80ab8f5b6ad1e1b64ed010b129637a333f..0000000000000000000000000000000000000000 --- a/README.en.md +++ /dev/null @@ -1,294 +0,0 @@ -# okio - -okio is a library that provides support for system input and output through data streams, serialization and the file system, and defines buffers, which are containers for data, and provides an overview of the other NIO packages. To make it much easier to access, store, and process your data. It started as a component of OkHttp. - -## Usage Instructions -Import okio as below from node_modules after adding okio_ohos module in project root directory: -`` -import okio from 'okio; -`` - -1. To write and read Utf8 data in buffer: -`` - performWriteUtf8() { - var buffer = new okio.Buffer(); - buffer.writeUtf8("test"); - var readUtfValue = buffer.readUtf8(); - } -`` - -2. To write and read int data in buffer: -`` - performWriteInt() { - var buffer = new okio.Buffer(); - buffer.writeInt(10); - var readInt = buffer.readInt(); - } -`` - -3. To write and read String data in buffer: -`` - performWriteString() { - var buffer = new okio.Buffer(); - buffer.writeString("Test"); - var readString = buffer.readString(); - } -`` - -4. To write and read intLe data in buffer: -`` - performWriteIntLe() { - var buffer = new okio.Buffer(); - buffer.writeIntLe(25); - var readIntLe = buffer.readIntLe(); - } -`` - -5. To write and read short data in buffer: -`` - performWriteShort() { - var buffer = new okio.Buffer(); - buffer.writeShort(25); - var readShort = buffer.readShort(); - } -`` - -6. To write and read shortLe data in buffer: -`` - performWriteShortLe() { - var buffer = new okio.Buffer(); - buffer.writeShortLe(100); - var readShortLe = buffer.readShortLe(); - } -`` - -7. To write and read byte data in buffer: -`` - performWriteByte() { - var buffer = new okio.Buffer(); - buffer.writeByte(9) - var readByte = buffer.readByte(); - } -`` - -8. To write and read Utf8CodePoint data in buffer: -`` - performWriteUtf8CodePoint() { - var buffer = new okio.Buffer(); - buffer.writeUtf8CodePoint(99); - var readUtf8CodePointValue = buffer.readUtf8CodePoint(); - } -`` - -9. To write Base64 string data in ByteString format: -`` - decodeBase64() { - let decodeBase64 = byteStringCompanObj.decodeBase64('SGVsbG8gd29ybGQ='); - let decodeBase64Value = JSON.stringify(decodeBase64); - } -`` - -10. To write Hex string data in ByteString format: -`` - decodeHex() { - let decodehex = byteStringCompanObj.decodeHex('48656C6C6F20776F726C640D0A'); - let decodeHexValue = JSON.stringify(decodehex); - } -`` - -11. To write Utf8 string data in ByteString format: -`` - encodeUtf8() { - let encodeUtf8 = byteStringCompanObj.encodeUtf8('Hello world #4 ❤ ( ͡ㆆ ͜ʖ ͡ㆆ)'); - let encodeUtf8Value = JSON.stringify(encodeUtf8); - } -`` - -12. To write type of string data in ByteString format: -`` - ofValue() { - let ofData = byteStringCompanObj.of(["Hello", "world"]); - let ofOutputValue = JSON.stringify(ofData); - } -`` - -13. To write content on file: -`` - writeFile() { - let fileUri = '/data/data/com.openharmony.ohos.okioapplication/cache/test.txt'; - let writeInputValue = "openharmony"; - var sink = new okio.Sink(fileUri); - var isAppend = false; - - sink.write(writeInputValue,isAppend); - } -`` - -14. To read content from file: -`` - readFileValue() { - let fileUri = '/data/data/com.openharmony.ohos.okioapplication/cache/test.txt'; - var source = new okio.Source(fileUri); - - source.read().then(function (data) { - that.readValue = data; - }).catch(function (error) { - //Error - }); - } -`` - -## API - -### Buffer -**writeUtf8(data: string): Buffer;** -Take Utf8 as input to write into Buffer - -**readUtf8(): string;** -Returns string from Buffer - -**writeInt(data: int): Buffer; -Take int as input to write into Buffer - -**readInt(): int;** -Returns int from Buffer - -**writeString(data: string): Buffer;** -Take string as input to write into Buffer - -**readString(): string;** -Returns string from Buffer - -**writeIntLe(data: intLe): Buffer; -Take intLe as input to write into Buffer - -**readIntLe(): intLe;** -Returns int from Buffer - -**writeShortLe(data: shortLe): Buffer;** -Take shortLe as input to write into Buffer - -**readShortLe(): shortLe;** -Returns shortLe from Buffer - -**writeShort(data: short): Buffer;** -Take short as input to write into Buffer - -**readShort(): short;** -Returns short from Buffer - -**writeByte(data: byte): Buffer;** -Take byte as input to write into Buffer - -**readByte(): byte;** -Returns byte from Buffer - -**writeUtf8CodePoint(data: Utf8CodePoint): Buffer;** -Take Utf8CodePoint as input to write into Buffer - -**readUtf8CodePoint(): Utf8CodePoint;** -Returns Utf8CodePoint from Buffer - -**readUtf8ByteCount(byteCount): string** -Returns string from Buffer - -**writableSegment(minimumCapacity): int;** -Write segment capacity and return it - -**writeSubString(string, beginIndex, endIndex): Buffer** -Write sub string of string and returns Buffer - -**writeUtf8BeginEndIndex(string, beginIndex, endIndex): Buffer** -Write sub string of string and returns Buffer - -**getCommonResult(pos: int): string;** -get common result with position and returns string - -**skipByteCount(bytecount: int)** -skip the number of bytes when you read from buffer - -**readByteArray(byteCount): string** -read byte array and returns string - -**readFully(sink: int): Buffer** -read data as per given length and returns Buffer - -**read(sink, offset, byteCount): int** -reads data and returns length - -### ByteString -**ByteString(data: buffer);** -Take data buffer and create ByteString instance - -**decodeBase64(data: Base64String): ByteString;** -Takes Base64-encoded bytes as input, decodes it and returns their value as a byte string - -**decodeHex(data: HexString): ByteString;** -Takes Hex-encoded bytes as input, decodes it and returns their value as a byte string. - -**encodeUtf8(data: string): ByteString;** -Takes string as input and returns a new byte string containing the UTF-8 bytes of input - -**of(data: array): ByteString;** -Returns a new byte string containing a clone of the bytes of data. - -**toAsciiLowercase(data: string): ByteString;** -Take string as input and returns Ascii lowercase value in ByteString with array - -**toAsciiUppercase(data: string): ByteString;** -Take string as input and returns Ascii uppercase value in ByteString with array - -**toByteArray():ByteArray;** -Returns a byte array containing a copy of the bytes in this ByteString. - -**getWithIndex(index: int):ByteValue;** -Take integer as input and returns ByteValue - -**getSize():DataLength;** -Returns the number of bytes in this ByteString. - -**internalArray():ByteArray;** -Returns the bytes of this string without a defensive copy. Do not mutate! - -**hashCode():Hashcode;** -Returns the hashcode value - -**compareToOther(other: Buffer): ByteArray** -It can be used to compare two bytestrings and returns: -(a) 0 if bytestring’s size is same and strings are equal -(b) -1 if original bytestring’s 1st character is less than comparing bytestring’s 1st character -(c) 1 if original byte string’s 1st character is higher than comparing bytestring’s 1st character - - -### FIleHandler(Sink, Source) -**read(): string;** -Read content from file and returns it - -**write(writeInputValue: string, isAppend: boolean);** -Writes string value to new file if isAPpend set to false or update in the existing file if isAppend is set to true - -## Download and install - - ```javascript - npm install @ohos/okio --save - ``` -For more information on OpenHarmony npm environment configuration, please refer to [How to Install OpenHarmony npm package](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_npm_usage.md) - -## Compatibility -Supports OpenHarmony API version 8 and above - -## Directory Structure -```` -|---- okio -| |---- entry # sample app usage -| |---- okio # okio library -| |---- index.ets # External interface -| |---- README.MD # installation and usage -```` - -## Code Contribution -If you find any problems during usage, you can submit an [Issue](https://gitee.com/openharmony-tpc/okio/issues) to us. Of course, we also welcome you to send us [PR](https://gitee.com/openharmony-tpc/httpclient/pulls). - -## Open source License -This project is based on [Apache License 2.0](https://gitee.com/openharmony-tpc/okio/blob/master/LICENSE) ,please enjoy and participate in open source freely. - diff --git a/README.md b/README.md index 717333313b139f69bd499d1897f5036b3bf15ff5..6f68c4213d36f3b6946e54210c04c98269b48b4e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ npm install @ohos/okio --save OpenHarmony npm环境配置等更多内容,请参考[如何安装OpenHarmony npm包](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_npm_usage.md) ## 使用说明: + ```javascript import okio from '@ohos/okio'; ``` @@ -217,9 +218,12 @@ import okio from '@ohos/okio'; | write | writeInputValue: string, isAppend: boolean | void | 如果 isAppend 设置为 false,则将字符串值写入新文件;如果 isAppend 设置为 true,则附加更新到现有文件 | ## 兼容性 -支持OpenHarmony API version 8 及以上版本 + +- [DevEco Studio](https://developer.harmonyos.com/cn/develop/deveco-studio#download) 版本:DevEco Studio 3.1 Beta1及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 ## 目录结构 + ````javascript |---- okio | |---- entry # 示例代码文件夹 @@ -233,4 +237,5 @@ import okio from '@ohos/okio'; 使用过程中发现任何问题都可以提[Issue](https://gitee.com/openharmony-tpc/okio/issues) 给我们,当然,我们也非常欢迎你给我们提[PR](https://gitee.com/openharmony-tpc/okio/pulls)。 ## 开源协议 + 本项目基于 [Apache License 2.0](https://gitee.com/openharmony-tpc/okio/blob/master/LICENSE),请自由地享受和参与开源。 diff --git a/build-profile.json5 b/build-profile.json5 index 0d925128c8e1bc5e253dd38a940b53c17881deca..479d5ccc6e8a6c5cdfb25cec432e4f8d9f9072ff 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -14,15 +14,15 @@ */ { "app": { - "signingConfigs": [], - "compileSdkVersion": 8, - "compatibleSdkVersion": 8, + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, "products": [ { "name": "default", "signingConfig": "default" - }, + } ], + "signingConfigs": [] }, "modules": [ { @@ -32,10 +32,10 @@ { "name": "default", "applyToProducts": [ - "default", - ], - }, - ], + "default" + ] + } + ] }, { "name": "okio", diff --git a/entry/.gitignore b/entry/.gitignore index 7d5b7a94f4dcf381f03ff21f28f8a2494b58023f..02a4a5dee327aa9f03cc179c72b3a47114430629 100644 --- a/entry/.gitignore +++ b/entry/.gitignore @@ -1,2 +1,3 @@ /build /node_modules +package-lock.json diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index 62a5100a430b12691a4b79f8c05362c9d5d5f4a1..6b80253fc641397fee14cf6c6cdbc4fef842d6c8 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -13,12 +13,12 @@ * limitations under the License. */ { - "apiType": 'faMode', + "apiType": 'stageMode', "buildOption": { }, "targets": [ { - "name": "default", + "name": "default" }, { "name": "ohosTest", diff --git a/entry/hvigorfile.js b/entry/hvigorfile.js deleted file mode 100644 index 09b3b4d3959d21b059dd935da913510a29afdad0..0000000000000000000000000000000000000000 --- a/entry/hvigorfile.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks diff --git a/entry/hvigorfile.ts b/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 --- /dev/null +++ b/entry/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/entry/package-lock.json b/entry/package-lock.json deleted file mode 100644 index 6121c479934cd036828aed9f9e81f054e215efce..0000000000000000000000000000000000000000 --- a/entry/package-lock.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "entry", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "okio": { - "version": "file:../okio" - } - } -} diff --git a/entry/package.json b/entry/package.json index 390032f31f8de1184d50d51d67b9db1563a823bd..f0c93ff26380bab78f8dcc8edba84ebddbec8154 100644 --- a/entry/package.json +++ b/entry/package.json @@ -1,16 +1,16 @@ { - "license": "ISC", - "devDependencies": {}, - "name": "entry", - "ohos": { - "org": "huawei", - "directoryLevel": "module", - "buildTool": "hvigor" - }, - "description": "Sample app usage for Openharmony library for okio", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "okio": "file:../okio" - } + "license": "ISC", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "Sample app usage for Openharmony library for okio", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/okio": "file:../okio" + } } diff --git a/entry/src/main/config.json b/entry/src/main/config.json deleted file mode 100644 index 9d575fee2999413657173cf521638875d860f8d6..0000000000000000000000000000000000000000 --- a/entry/src/main/config.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "app": { - "vendor": "openharmony", - "bundleName": "cn.openharmony.okio.sample", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "cn.openharmony.okio.sample", - "name": ".MyApplication", - "mainAbility": ".MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "js", - "icon": "$media:icon", - "description": "$string:mainability_description", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.WRITE_USER_STORAGE", - "reason": "Storage", - "usedScene": { - "when": "always", - "ability": [ - "cn.openharmony.okio.sample" - ] - } - }, - { - "name": "ohos.permission.READ_USER_STORAGE", - "reason": "Storage", - "usedScene": { - "when": "always", - "ability": [ - "cn.openharmony.okio.sample" - ] - } - }, - { - "name": "ohos.permission.WRITE_EXTERNAL_MEDIA_MEMORY", - "reason": "Storage", - "usedScene": { - "when": "always", - "ability": [ - "cn.openharmony.okio.sample" - ] - } - } - ], - "js": [ - { - "pages": [ - "pages/index/index", - "pages/buffer/buffer", - "pages/bytestring/bytestring", - "pages/filehandler/filehandler" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ] - } -} \ No newline at end of file diff --git a/entry/src/main/ets/entryability/EntryAbility.ts b/entry/src/main/ets/entryability/EntryAbility.ts new file mode 100644 index 0000000000000000000000000000000000000000..be5efb699479b90ff7723f19f28e8b1b2ca8bda4 --- /dev/null +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; + +export default class EntryAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + globalThis.context = this.context; + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground() { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground() { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..17ce043ea3862967b664a160ab8562e49aef0b5a --- /dev/null +++ b/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@ohos.router'; + + +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + build() { + Row() { + Column() { + Text('测试Buffer') + .width('90%') + .height(50) + .backgroundColor(0xCCCCCC) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + .onClick(() => { + router.pushUrl({ + url: 'pages/buffer' + }) + }) + Text('测试ByteString') + .width('90%') + .height(50) + .backgroundColor(0xCCCCCC) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + .onClick(() => { + router.pushUrl({ + url: 'pages/bytestring' + }) + }) + Text('测试FileHandler') + .width('90%') + .height(50) + .backgroundColor(0xCCCCCC) + .borderRadius(15) + .fontSize(16) + .textAlign(TextAlign.Center) + .margin({ + top: 10 + }) + .onClick(() => { + router.pushUrl({ + url: 'pages/filehandler' + }) + }) + + } + .width('100%') + } + .height('100%') + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/buffer.ets b/entry/src/main/ets/pages/buffer.ets new file mode 100644 index 0000000000000000000000000000000000000000..d077c30ccdd0cd1a5b410f79020a088cbde0e45f --- /dev/null +++ b/entry/src/main/ets/pages/buffer.ets @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Okio } from '@ohos/okio'; +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct Buffer { + @State areaValue: string = ''; + @State rUtf8Value: string = ''; + @State rIntValue: string = ''; + @State rStringValue: string = ''; + @State rShortValue: string = ''; + @State rIntLeValue: string = ''; + @State rShortLeValue: string = ''; + @State rByteValue: string = ''; + @State rUtf8CodePointValue: string = ''; + @State rUtf8ByteCountValue: string = ''; + scroller: Scroller = new Scroller(); + controller: TextAreaController = new TextAreaController(); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + TextArea({ placeholder: '输入对应类型的数据,并点击按钮测试读取', controller: this.controller }) + .height(50) + .width('100%') + .margin(5) + .onChange((value: string) => { + this.areaValue = value; + this.controller.caretPosition(value.length); + }) + Text('测试readUTF8->' + this.rUtf8Value) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + if (this.areaValue != '' && typeof this.areaValue == 'string') { + buffer.writeUtf8(this.areaValue); + this.rUtf8Value = buffer.readUtf8(); + } else { + promptAction.showToast({ + message: 'No Null或者数据类型不对,需要类型string如:ate12fs', + bottom: '50%' + }) + } + }) + + Text('测试readInt->' + this.rIntValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeInt(this.areaValue); + this.rIntValue = buffer.readInt(); + }) + + Text('测试readString->' + this.rStringValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeString(this.areaValue); + this.rStringValue = buffer.readString(); + }) + Text('测试readShort->' + this.rShortValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeShort(this.areaValue); + this.rShortValue = buffer.readShort(); + }) + Text('测试readIntLe->' + this.rIntLeValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeIntLe(this.areaValue); + this.rIntLeValue = buffer.readIntLe(); + }) + Text('测试readShortLe->' + this.rShortLeValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeShortLe(this.areaValue); + this.rShortLeValue = buffer.readShortLe(); + }) + Text('测试readByte->' + this.rByteValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeUtf8CodePoint(this.areaValue); + this.rByteValue = buffer.readUtf8CodePoint(); + }) + Text('测试readUtf8ByteCodePoint->' + this.rUtf8CodePointValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeUtf8CodePoint(this.areaValue); + this.rUtf8CodePointValue = buffer.readUtf8CodePoint(buffer.size); + }) + Text('测试readUtf8ByteCount->' + this.rUtf8ByteCountValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + var buffer = new Okio.Buffer(); + buffer.writeUtf8(this.areaValue); + this.rUtf8ByteCountValue = buffer.readUtf8ByteCount(buffer.size); + }) + + }.width('100%') + }.scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(30) + + Button('全部重置显示', { type: ButtonType.Capsule, stateEffect: true }) + .backgroundColor(0x317aff) + .margin({ top: 200, left: 5 }) + .width(120) + .onClick(() => { + this.rUtf8Value = ''; + this.rIntValue = ''; + this.rStringValue = ''; + this.rShortValue = ''; + this.rIntLeValue = ''; + this.rShortLeValue = ''; + this.rByteValue = ''; + this.rUtf8CodePointValue = ''; + this.rUtf8ByteCountValue = ''; + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/bytestring.ets b/entry/src/main/ets/pages/bytestring.ets new file mode 100644 index 0000000000000000000000000000000000000000..05d38666c62a077afab72831f7178873ca4bdb89 --- /dev/null +++ b/entry/src/main/ets/pages/bytestring.ets @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ByteString } from '@ohos/okio'; +import promptAction from '@ohos.promptAction' + +const byteStringObj = new ByteString.ByteString('hello world') + +@Entry +@Component +struct Bytestring { + @State decodeBase64Value: string = ''; + @State decodeHexValue: string = ''; + @State encodeUtf8Value: string = ''; + @State ofOutPutValue: string = ''; + @State asciiLowercaseValue: string = ''; + @State asciiUppercaseValue: string = ''; + @State byteArrayValue: string = ''; + @State internalArrayValue: string = ''; + @State hashCodeValue: string = ''; + @State inputData: string = ''; + @State inputDataLength: string = ''; + @State compareToResult: string = ''; + @State encodeBase64Value: string = ''; + @State encodeHexValue: string = ''; + @State encodeMD5HexValue: string = ''; + scroller: Scroller = new Scroller(); + + build() { + Stack({ alignContent: Alignment.TopStart }) { + Scroll(this.scroller) { + Column() { + Text('测试decodeBase64->' + this.decodeBase64Value) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let decodeBase64 = byteStringObj.decodeBase64('SGVsbG8gd29ybGQ='); + this.decodeBase64Value = JSON.stringify(decodeBase64); + }) + + Text('测试decodeHex->' + this.decodeHexValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let decodeHex = byteStringObj.decodeHex('48656C6C6F20776F726C640D0A'); + this.decodeHexValue = JSON.stringify(decodeHex); + }) + + Text('测试encodeUtf8->' + this.encodeUtf8Value) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let encodeUtf8 = byteStringObj.encodeUtf8('Hello Word #4 ❤ (!!!∑(゚Д゚ノ)ノ) '); + this.encodeUtf8Value = JSON.stringify(encodeUtf8); + }) + Text('测试of->' + this.ofOutPutValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let ofData = byteStringObj.of(['hello', 'world']); + this.ofOutPutValue = JSON.stringify(ofData); + }) + Text('测试toAsciiLowercase->' + this.asciiLowercaseValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let toAsciiLowercase = byteStringObj.toAsciiLowercase(['HELLO WORLD']); + this.asciiLowercaseValue = JSON.stringify(toAsciiLowercase); + }) + Text('测试toAsciiUppercase->' + this.asciiUppercaseValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let toAsciiUppercase = byteStringObj.toAsciiUppercase(['hello world']); + this.asciiUppercaseValue = JSON.stringify(toAsciiUppercase); + }) + Text('测试toByteArray->' + this.byteArrayValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let toByteArray = byteStringObj.toByteArray(); + this.byteArrayValue = JSON.stringify(toByteArray); + }) + Text('测试internalArray->' + this.internalArrayValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let dataString = byteStringObj.internalArray(); + this.internalArrayValue = JSON.stringify(dataString); + }) + Text('测试hashCode->' + this.hashCodeValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let hashCode = byteStringObj.hashCode(); + this.hashCodeValue = JSON.stringify(hashCode); + }) + Text('测试compareToOther->' + this.compareToResult) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let byteA = new ByteString.ByteString('a'); + let byteB = new ByteString.ByteString('cadsd'); + this.compareToResult = byteA.compareToOther(byteB); + }) + Text('测试getLength->' + this.inputDataLength) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + this.inputData = 'abcdesgsd213' + if (this.inputData.length > 0) { + let byteObj = new ByteString.ByteString(this.inputData); + this.inputDataLength = byteObj.getSize(); + } + }) + + Text('测试encodeBase64->' + this.encodeBase64Value) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let encodeBase64 = byteStringObj.encodeUtf8('Hello World').Base64(); + this.encodeBase64Value = JSON.stringify(encodeBase64); + }) + + Text('测试encodeHex->' + this.encodeHexValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let encodeHex = byteStringObj.encodeUtf8('Hello World').Hex(); + this.encodeHexValue = JSON.stringify(encodeHex); + }) + + Text('测试encodeMD5Hex->' + this.encodeMD5HexValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + let encodeMD5Hex = byteStringObj.encodeUtf8('Hello World test test').md5().Hex(); + this.encodeMD5HexValue = JSON.stringify(encodeMD5Hex); + }) + + }.width('100%') + }.scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.On) + .scrollBarColor(Color.Gray) + .scrollBarWidth(30) + + Button('全部重置显示', { type: ButtonType.Capsule, stateEffect: true }) + .backgroundColor(0x317aff) + .margin({ top: 200, left: 5 }) + .width(120) + .onClick(() => { + this.decodeBase64Value = ''; + this.decodeHexValue = ''; + this.encodeUtf8Value = ''; + this.ofOutPutValue = ''; + this.asciiLowercaseValue = ''; + this.asciiUppercaseValue = ''; + this.byteArrayValue = ''; + this.internalArrayValue = ''; + this.hashCodeValue = ''; + this.inputData = ''; + this.inputDataLength = ''; + this.compareToResult = ''; + this.encodeBase64Value = ''; + this.encodeHexValue = ''; + this.encodeMD5HexValue = ''; + + }) + }.width('100%').height('100%').backgroundColor(0xDCDCDC) + } +} \ No newline at end of file diff --git a/entry/src/main/ets/pages/filehandler.ets b/entry/src/main/ets/pages/filehandler.ets new file mode 100644 index 0000000000000000000000000000000000000000..9a9410be11c8b55ac7f3e11c36214d46c8a54304 --- /dev/null +++ b/entry/src/main/ets/pages/filehandler.ets @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { Okio } from '@ohos/okio'; +import promptAction from '@ohos.promptAction' + +@Entry +@Component +struct Filehandler { + @State message: string = 'Hello World'; + @State areaValue: string = ''; + @State readValue: string = ''; + path: string = ''; + controller: TextAreaController = new TextAreaController(); + + aboutToAppear() { + this.path = globalThis.context.filesDir + '/testFile.txt'; + } + + writeData(path: string, content: string) { + var sink = new Okio.Sink(path); + sink.write(content, false); + } + + readeData(path: string) { + var source = new Okio.Source(path); + source.read().then((data) => { + if (data && typeof data === 'string') { + this.readValue = data; + } + }).catch((err) => { + promptAction.showToast({ + message: 'okio: readFileValue inside catch ' + err, + bottom: "50%" + }) + }); + } + + build() { + Row() { + Column() { + TextArea({ placeholder: '输入字符串可写入文件', controller: this.controller }) + .height(50) + .width('100%') + .margin(5) + .onChange((value: string) => { + this.areaValue = value; + this.controller.caretPosition(value.length); + }) + + Text('测试将字符串写入文件') + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + if (this.areaValue && this.areaValue.length > 0) { + this.writeData(this.path, this.areaValue); + promptAction.showToast({ + message: '写入完成~~~', + bottom: '50%' + }) + } else { + promptAction.showToast({ + message: '写入失败,内容不可以为空', + bottom: '50%' + }) + } + }) + Text('测试将字符串读出来') + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + this.readeData(this.path); + }) + + Text('测试读取的文件数据' + this.readValue) + .width('90%') + .height(50) + .backgroundColor(0xFFFFFF) + .borderRadius(15) + .fontSize(13) + .textAlign(TextAlign.Center) + .margin({ top: 10 }) + .onClick(() => { + + }) + } + .width('100%').backgroundColor(Color.White) + } + .height('100%') + } +} \ No newline at end of file diff --git a/entry/src/main/js/MainAbility/common/css/common.css b/entry/src/main/js/MainAbility/common/css/common.css deleted file mode 100644 index 84e03212ada04a6d9e85208b05498c942d254ca0..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/common/css/common.css +++ /dev/null @@ -1,19 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; - font-size: 40px; -} - -.nav-bar { - background-color: #1976D2; -} - -.btn { - width: 50%; - font-size: 16px; - radius: 60; - background-color: #1976D2; - text-color: white; - margin: 1%; -} \ No newline at end of file diff --git a/entry/src/main/js/MainAbility/common/images/Wallpaper.png b/entry/src/main/js/MainAbility/common/images/Wallpaper.png deleted file mode 100644 index 60d4841a80eb20c63de74306cb7f8350d6a85c48..0000000000000000000000000000000000000000 Binary files a/entry/src/main/js/MainAbility/common/images/Wallpaper.png and /dev/null differ diff --git a/entry/src/main/js/MainAbility/common/images/bg-tv.jpg b/entry/src/main/js/MainAbility/common/images/bg-tv.jpg deleted file mode 100644 index 86fc07358eea5c1474bc833fca07c6d4d8698a89..0000000000000000000000000000000000000000 Binary files a/entry/src/main/js/MainAbility/common/images/bg-tv.jpg and /dev/null differ diff --git a/entry/src/main/js/MainAbility/i18n/en-US.json b/entry/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/entry/src/main/js/MainAbility/i18n/zh-CN.json b/entry/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/entry/src/main/js/MainAbility/log/log.js b/entry/src/main/js/MainAbility/log/log.js deleted file mode 100644 index 350b766dce25b723226b953fef4585b8bb57bbff..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/log/log.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -const TAG = 'okhttp-'; -var logger = console; - -/** - * Basic log class - */ -export default class Log { - - /** - * print info level log - * - * @param {string} log - Log needs to be printed - */ - static showInfo(log, ...ms) { - logger.info(log,ms); - } - - /** - * print debug level log - * - * @param {string} log - Log needs to be printed - */ - static showDebug(log, ...ms) { - logger.debug(log,ms); - } - - /** - * print error level log - * - * @param {string} log - Log needs to be printed - */ - static showError(log, ...ms) { - logger.error(log,ms); - } - - /** - * print warn level log - * - * @param {string} log - Log needs to be printed - */ - static showWarn(log, ...ms) { - logger.warn(log,ms); - } - -} diff --git a/entry/src/main/js/MainAbility/pages/buffer/buffer.css b/entry/src/main/js/MainAbility/pages/buffer/buffer.css deleted file mode 100644 index 2cae9faef3f35090c60822e340eca6266ba78365..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/buffer/buffer.css +++ /dev/null @@ -1,65 +0,0 @@ -@import "../../common/css/common.css"; - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -.button-controller{ - align-items: center; - justify-content: center; - padding-top: 20px; - padding-bottom: 20px; -} - -.textfield{ - width: 30%; - font-size: 16px; -} - -.text{ - width: 25%; - font-size: 16px; - margin-left: 30px; - margin-bottom: 5px; -} diff --git a/entry/src/main/js/MainAbility/pages/buffer/buffer.hml b/entry/src/main/js/MainAbility/pages/buffer/buffer.hml deleted file mode 100644 index 72fc8ac70eaa519675186fe2ee8667438d9fdc52..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/buffer/buffer.hml +++ /dev/null @@ -1,92 +0,0 @@ -
-
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
- - - -
- -
diff --git a/entry/src/main/js/MainAbility/pages/buffer/buffer.js b/entry/src/main/js/MainAbility/pages/buffer/buffer.js deleted file mode 100644 index 01c37cd4a009ca3c5c9684a210f095009bb9ddff..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/buffer/buffer.js +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import okio from 'okio'; - -export default { - data: { - title: "", - writeUtfValue: "", - writeIntValue: "", - writeStringValue: "", - writeShortValue: "", - writeIntLeValue: "", - writeShortLeValue: "", - writeByteValue: "", - writeUtf8CodePointValue: "", - writeUtf8ByteCountValue: "", - writableSegmentValue: "", - readUtfValue: "", - readInt: "", - readString: "", - readIntLe: "", - readShortLe: "", - readShort: "", - readByte: "", - readUtf8CodePointValue: "", - readUtf8ByteCountValue: "" - }, - onInit() { - this.validateokio(); - }, - getStringUtfValue(e) { - this.writeUtfValue = e.text; - }, - getWriteIntValue(e) { - this.writeIntValue = e.text; - }, - getWriteStringValue(e) { - this.writeStringValue = e.text; - }, - getWriteShortValue(e) { - this.writeShortValue = e.text; - }, - getWriteIntLeValue(e) { - this.writeIntLeValue = e.text; - }, - getWriteShortLeValue(e) { - this.writeShortLeValue = e.text; - }, - getWriteByteValue(e) { - this.writeByteValue = e.text; - }, - getUtf8CodePointValue(e) { - this.writeUtf8CodePointValue = e.text; - }, - getWritableSegmentValue(e) { - this.writableSegmentValue = e.text; - }, - getUtf8ByteCountValue(e) { - this.writeUtf8ByteCountValue = e.text; - }, - performWriteUtf8() { - var buffer = new okio.Buffer(); - - buffer.writeUtf8(this.writeUtfValue); - this.readUtfValue = buffer.readUtf8(); - }, - performWriteInt() { - var buffer = new okio.Buffer(); - buffer.writeInt(this.writeIntValue); - this.readInt = buffer.readInt(); - }, - performWriteString() { - var buffer = new okio.Buffer(); - buffer.writeString(this.writeStringValue); - this.readString = buffer.readString(); - }, - performWriteIntLe() { - var buffer = new okio.Buffer(); - buffer.writeIntLe(this.writeIntLeValue); - this.readIntLe = buffer.readIntLe(); - }, - performWriteShortLe() { - var buffer = new okio.Buffer(); - buffer.writeShortLe(this.writeShortLeValue); - this.readShortLe = buffer.readShortLe(); - }, - performWriteShort() { - var buffer = new okio.Buffer(); - buffer.writeShort(this.writeShortValue); - this.readShort = buffer.readShort(); - }, - performWriteByte() { - var buffer = new okio.Buffer(); - buffer.writeByte(this.writeByteValue) - this.readByte = buffer.readByte(); - }, - performWriteUtf8CodePoint() { - var buffer = new okio.Buffer(); - buffer.writeUtf8CodePoint(this.writeUtf8CodePointValue); - this.readUtf8CodePointValue = buffer.readUtf8CodePoint(); - }, - performWriteUtf8ByteCount() { - var buffer = new okio.Buffer(); - - buffer.writeUtf8(this.writeUtf8ByteCountValue); - this.readUtf8ByteCountValue = buffer.readUtf8ByteCount(buffer.size); - }, - validateokio() { - var buffer = new okio.Buffer(); - - buffer.writeUtf8("test"); - - buffer.writeInt(10); - - buffer.writeString("Test"); - - buffer.writeIntLe(100); - - buffer.writeShortLe(100); - - buffer.writeShort(25); - - buffer.writeByte(9); - - buffer.writeUtf8CodePoint(99); - } -} diff --git a/entry/src/main/js/MainAbility/pages/bytestring/bytestring.css b/entry/src/main/js/MainAbility/pages/bytestring/bytestring.css deleted file mode 100644 index bab62848532cc9a473770fd50e96bbe85b703d61..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/bytestring/bytestring.css +++ /dev/null @@ -1,68 +0,0 @@ -@import "../../common/css/common.css"; - -.container { - flex-direction: column; - width: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -.button-controller { - width: 100%; - align-items: center; - justify-content: center; - padding-top: 20px; - padding-bottom: 20px; -} - -.row { - width: 100%; -} - -.textfield { - width: 45%; - font-size: 16px; -} - -.text { - width: 100%; - font-size: 16px; - margin: 1% -} diff --git a/entry/src/main/js/MainAbility/pages/bytestring/bytestring.hml b/entry/src/main/js/MainAbility/pages/bytestring/bytestring.hml deleted file mode 100644 index a41e140f30c63aa72e3203494e35343a4b6d4397..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/bytestring/bytestring.hml +++ /dev/null @@ -1,196 +0,0 @@ -
-
- - Hello world - -
- -
- - {{ encodeBase64Value }} - -
-
- - SGVsbG8gd29ybGQ= - -
- -
- - {{ decodeBase64Value }} - -
- -
- - Hello world - -
- -
- - {{ encodeHexValue }} - -
-
- - Hello world test test - -
- -
- - {{ encodemd5HexValue }} - -
-
- - 48656C6C6F20776F726C640D0A - -
- -
- - {{ decodeHexValue }} - -
- -
- - Hello world #4 ❤ ( ͡ㆆ ͜ʖ ͡ㆆ) - -
- -
- - {{ encodeUtf8Value }} - -
- -
- - Hello world - -
- -
- - {{ ofOutputValue }} - -
- -
- - HELLO WORLD - -
- -
- - {{ asciiLowercaseValue }} - -
- -
- - hello world - -
- -
- - {{ asciiUppercaseValue }} - -
- -
- - Hello world - -
- -
- - {{ byteArrayValue }} - -
- -
- - Hello world - -
-
- - {{ internalArrayValue }} - -
- -
- - Hello world - -
-
- - {{ hashCodeValue }} - -
-
- - - -
-
- Result of comparing with 10: {{ compareToResult }} -
- -
- - - -
- -
- getIndex Result for 'Hello world': {{ getIndexValue }} - -
-
- - - -
-
- Input size: {{ inputDataLength }} -
-
diff --git a/entry/src/main/js/MainAbility/pages/bytestring/bytestring.js b/entry/src/main/js/MainAbility/pages/bytestring/bytestring.js deleted file mode 100644 index af9d9d7a529fcfc7284b3e59d0d694f38002839f..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/bytestring/bytestring.js +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import okio from 'okio'; - -var byteStringObj = new okio.ByteString.ByteString('Hello world'); - -export default { - data: { - decodeBase64Value: "", - decodeHexValue: "", - encodeUtf8Value: "", - ofOutputValue: "", - asciiLowercaseValue: "", - asciiUppercaseValue: "", - byteArrayValue: "", - internalArrayValue: "", - hashCodeValue:"", - inputData:"", - inputDataLength:"", - compareToValue : "Hello world", - compareToResult :"", - inputGetIndex: '', - getIndexValue: "", - encodeBase64Value:"", - encodeHexValue:"", - encodemd5HexValue:"" - }, - onInit() { - this.byteString(); - }, - encodeBase64() { - let encodeBase64 = byteStringObj.encodeUtf8('Hello world').Base64(); - this.encodeBase64Value = JSON.stringify(encodeBase64); - }, - decodeBase64() { - let decodeBase64 = byteStringObj.decodeBase64('SGVsbG8gd29ybGQ='); - this.decodeBase64Value = JSON.stringify(decodeBase64); - }, - encodeHex() { - let encodeHex = byteStringObj.encodeUtf8('Hello world').Hex(); - this.encodeHexValue = JSON.stringify(encodeHex); - }, - encodeMD5Hex() { - let encodeHex = byteStringObj.encodeUtf8('Hello world test test').md5().Hex(); - this.encodemd5HexValue = JSON.stringify(encodeHex); - }, - decodeHex() { - let decodehex = byteStringObj.decodeHex('48656C6C6F20776F726C640D0A'); - this.decodeHexValue = JSON.stringify(decodehex); - }, - encodeUtf8() { - let encodeUtf8 = byteStringObj.encodeUtf8('Hello world #4 ❤ ( ͡ㆆ ͜ʖ ͡ㆆ)'); - this.encodeUtf8Value = JSON.stringify(encodeUtf8); - }, - ofValue() { - let ofData = byteStringObj.of(["Hello", "world"]); - this.ofOutputValue = JSON.stringify(ofData); - }, - toAsciiLowercaseValue() { - let toAsciiLowercase = byteStringObj.toAsciiLowercase('HELLO WORLD'); - this.asciiLowercaseValue = JSON.stringify(toAsciiLowercase); - }, - toAsciiUppercaseValue() { - let toAsciiUppercase = byteStringObj.toAsciiUppercase('hello world'); - this.asciiUppercaseValue = JSON.stringify(toAsciiUppercase); - }, - toByteArrayValue() { - let toByteArray = byteStringObj.toByteArray(); - this.byteArrayValue = JSON.stringify(toByteArray); - }, - internalArray() { - let dataString = byteStringObj.internalArray(); - this.internalArrayValue = JSON.stringify(dataString); - }, - hashCode() { - let hashcode = byteStringObj.hashCode(); - this.hashCodeValue = JSON.stringify(hashcode); - }, - compareInputChange(e) { - this.compareToValue = e.text; - }, - compareToByteData() { - var byteA = new okio.ByteString.ByteString('10'); - var byteB = new okio.ByteString.ByteString(this.compareToValue); - this.compareToResult = byteA.compareToOther(byteB); - }, - getIndexInputChange(e) { - this.inputGetIndex = e.text; - }, - getIndex() { - // pass index(buffer's string value) for which you want to retrieve value - this.getIndexValue = byteStringObj.getWithIndex(this.inputGetIndex); - }, - inputDataChange(e){ - this.inputData = e.text; - }, - getLength() { - if (this.inputData.length > 0) { - var byteStrObj = new okio.ByteString.ByteString(this.inputData); - this.inputDataLength = byteStrObj.getSize(); - return; - } - this.inputDataLength = 0; - }, - byteString() { - /// API Methods. - // 1. decodeBase64 - returns byte array. - let decodeBase64 = byteStringObj.decodeBase64('SGVsbG8gd29ybGQ='); - - // 2. decodeHex - let decodehex = byteStringObj.decodeHex('48656C6C6F20776F726C640D0A'); - - //3. encodeUtf8 - let encodeUtf8 = byteStringObj.encodeUtf8('Hello world #4 ❤ ( ͡ㆆ ͜ʖ ͡ㆆ)'); - - //4. of () - let ofData = byteStringObj.of(["Hello", "world"]); - - //5. toAsciiLowercaseValue() - let toAsciiLowercase = byteStringObj.toAsciiLowercase('HELLO WORLD'); - - //6. toAsciiUppercaseValue() - let toAsciiUppercase = byteStringObj.toAsciiUppercase('hello world'); - - //7. toByteArrayValue() - let toByteArray = byteStringObj.toByteArray(); - - // 8. internalArray - let dataString = byteStringObj.internalArray(); - - //9. HashCode - let hashcode = byteStringObj.hashCode(); - - // 10. compareTo - var byteA = new okio.ByteString.ByteString('10'); - var byteB = new okio.ByteString.ByteString('10'); - var result = byteA.compareToOther(byteB); - - // 11. getLength - var byteStrObj = new okio.ByteString.ByteString(this.inputData); - this.inputDataLength = byteStrObj.getSize(); - } -} diff --git a/entry/src/main/js/MainAbility/pages/filehandler/filehandler.css b/entry/src/main/js/MainAbility/pages/filehandler/filehandler.css deleted file mode 100644 index e37d91386492b086c7a1f970b1e1868f0f30eb07..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/filehandler/filehandler.css +++ /dev/null @@ -1,64 +0,0 @@ -@import "../../common/css/common.css"; - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -.button-controller{ - align-items: center; - justify-content: center; - padding-top: 20px; - padding-bottom: 20px; -} - -.textfield{ - font-size: 16px; -} - -.text{ - width: 30%; - font-size: 16px; - margin-left: 30px; - margin-bottom: 5px; -} diff --git a/entry/src/main/js/MainAbility/pages/filehandler/filehandler.hml b/entry/src/main/js/MainAbility/pages/filehandler/filehandler.hml deleted file mode 100644 index 81444912e1a983f73c12d6136c75d9061632255b..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/filehandler/filehandler.hml +++ /dev/null @@ -1,24 +0,0 @@ -
-
- - - -
- -
- -
-
- - - -
-
diff --git a/entry/src/main/js/MainAbility/pages/filehandler/filehandler.js b/entry/src/main/js/MainAbility/pages/filehandler/filehandler.js deleted file mode 100644 index 1467ab5d73b2998673c874c5ec01b1ed4b6d62d3..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/filehandler/filehandler.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import okio from 'okio'; -import Log from '../../log/log'; -import featureAbility from '@ohos.ability.featureAbility' - -export default { - data: { - title: "", - fileUri: '/data/data/com.openharmony.ohos.okioapplication/cache/test.txt', - writeInputValue: "", - readValue: "", - }, - onInit() { - }, - getWriteValue(e) { - this.writeInputValue = e.text; - }, - writeFile() { - var fileName = "/test.txt" - var that = this; - featureAbility.getContext().getFilesDir().then((data) => { - - that.fileUri=data+fileName; - Log.showInfo("okio: path: "+that.fileUri); - var sink = new okio.Sink(this.fileUri); - sink.write(that.writeInputValue,false); - - }).catch((err)=>{ - Log.showError("okio: path inside catch"+err); - }) - }, - readFileValue() { - try { - var that = this; - Log.showInfo("okio: path: " + that.fileUri); - var source = new okio.Source(that.fileUri); - - source.read().then(function (data) { - that.readValue = data; - }).catch(function (error) { - Log.showError("okio: readFileValue inside catch" + error); - }); - }catch(error){ - Log.showError("okio: readFileValue inside catch" + error); - } - }, - appendFileValue() { - var that = this; - Log.showInfo("okio: path: "+that.fileUri); - var sink = new okio.Sink(this.fileUri); - sink.write(that.writeInputValue,true); - } -} diff --git a/entry/src/main/js/MainAbility/pages/index/index.css b/entry/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index e37d91386492b086c7a1f970b1e1868f0f30eb07..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,64 +0,0 @@ -@import "../../common/css/common.css"; - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -.button-controller{ - align-items: center; - justify-content: center; - padding-top: 20px; - padding-bottom: 20px; -} - -.textfield{ - font-size: 16px; -} - -.text{ - width: 30%; - font-size: 16px; - margin-left: 30px; - margin-bottom: 5px; -} diff --git a/entry/src/main/js/MainAbility/pages/index/index.hml b/entry/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index a0ece836f6ae7c2ab169511c9909b74a09f7eda5..0000000000000000000000000000000000000000 --- a/entry/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,21 +0,0 @@ -
-
- -
- -
- -
- -
- -
- - -
diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f6353470a13a33b01f3f042e937af5730f0cd611 --- /dev/null +++ b/entry/src/main/module.json5 @@ -0,0 +1,43 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], + "abilities": [ + { + "name": "EntryAbility", + "srcEntrance": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", + "icon": "$media:icon", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index ad3d2fd0762f2c10b02bb91792088213cc5beaa1..80f8bcef34b9f352ca8463d78fb6f3d415e07e27 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -1,12 +1,16 @@ { "string": [ { - "name": "entry_MainAbility", - "value": "OKIO" + "name": "module_desc", + "value": "module description" }, { - "name": "mainability_description", - "value": "JS_Empty Ability" + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "okio" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..74d52c410ba77464cb1994b607e375ff88a8623a --- /dev/null +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,8 @@ +{ + "src": [ + "pages/Index", + "pages/buffer", + "pages/bytestring", + "pages/filehandler" + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..80f8bcef34b9f352ca8463d78fb6f3d415e07e27 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "okio" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/rawfile/test.txt b/entry/src/main/resources/rawfile/test.txt deleted file mode 100644 index cea8ca0d04dd6b1eebdf939c538277de84596d29..0000000000000000000000000000000000000000 --- a/entry/src/main/resources/rawfile/test.txt +++ /dev/null @@ -1 +0,0 @@ -Okio JS \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..b5c38da914456dc7e436867764a5803cb830e581 --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "okio" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/Ability.test.ets b/entry/src/ohosTest/ets/test/Ability.test.ets new file mode 100644 index 0000000000000000000000000000000000000000..7af7fc72c6024c2f5716f9a8ac0306ff0d7b214d --- /dev/null +++ b/entry/src/ohosTest/ets/test/Ability.test.ets @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium' + +export default function abilityTest() { + describe('ActsAbilityTest', function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(function () { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. + }) + beforeEach(function () { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(function () { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(function () { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain', 0, function () { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc' + let b = 'b' + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b) + expect(a).assertEqual(a) + }) + }) +} \ No newline at end of file diff --git a/entry/src/main/js/MainAbility/app.js b/entry/src/ohosTest/ets/test/List.test.ets similarity index 79% rename from entry/src/main/js/MainAbility/app.js rename to entry/src/ohosTest/ets/test/List.test.ets index 477fa22d3b2ef8e4958033a55193e5014805b85d..7637ba6c8c8cedf0f72d43a1aa16a6dd18e8bd77 100644 --- a/entry/src/main/js/MainAbility/app.js +++ b/entry/src/ohosTest/ets/test/List.test.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,8 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -export default { - onCreate() {}, - onDestroy() {} -}; + +import abilityTest from './Ability.test' + +export default function testsuite() { + abilityTest(); +} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testability/TestAbility.ets b/entry/src/ohosTest/ets/testability/TestAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..670095488d9c078ea059e39d1dfd6087c46d56f7 --- /dev/null +++ b/entry/src/ohosTest/ets/testability/TestAbility.ets @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; + +export default class TestAbility extends UIAbility { + onCreate(want, launchParam) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:' + JSON.stringify(launchParam) ?? ''); + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + onDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); + }); + } + + onWindowStageDestroy() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); + } + + onForeground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); + } + + onBackground() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground'); + } +} \ No newline at end of file diff --git a/entry/src/main/js/MainAbility/pages/index/index.js b/entry/src/ohosTest/ets/testability/pages/Index.ets similarity index 44% rename from entry/src/main/js/MainAbility/pages/index/index.js rename to entry/src/ohosTest/ets/testability/pages/Index.ets index 07bdb290024ad8c578a05e332b048abfc6ed21dd..61252fd6aa313e280032900aa8ddd519397ed1ac 100644 --- a/entry/src/main/js/MainAbility/pages/index/index.js +++ b/entry/src/ohosTest/ets/testability/pages/Index.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,28 +13,40 @@ * limitations under the License. */ -import router from '@system.router'; +import hilog from '@ohos.hilog'; -export default { - data: { - title: "", - fileUri: '/data/data/com.openharmony.ohos.okioapplication/cache/test.txt' - }, - onInit() { - }, - showBufferView() { - router.push({ - uri: 'pages/buffer/buffer' - }) - }, - showByteStringView() { - router.push({ - uri: 'pages/bytestring/bytestring' +@Entry +@Component +struct Index { + @State message: string = 'Hello World' + + aboutToAppear() { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); + } + + build() { + Row() { + Column() { + Text(this.message) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(20) + .fontWeight(FontWeight.Bold) + } + .type(ButtonType.Capsule) + .margin({ + top: 20 }) - }, - showFileHandlingView() { - router.push({ - uri: 'pages/filehandler/filehandler' + .backgroundColor('#0D9FFB') + .width('35%') + .height('5%') + .onClick(() => { }) + } + .width('100%') } -} + .height('100%') + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts b/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..47876af3a8fdbabb77cf0b9db27e2a1d9404ec29 --- /dev/null +++ b/entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +async function onAbilityCreateCallback() { + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); +} + +async function addAbilityMonitorCallback(err: any) { + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); + } + + async onRun() { + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + var debug = abilityDelegatorArguments.parameters['-D'] + if (debug == 'true') { + cmd += ' -D' + } + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd); + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); + }) + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/module.json5 b/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..476d15376f43323426498a79fb3d58a658a27a56 --- /dev/null +++ b/entry/src/ohosTest/module.json5 @@ -0,0 +1,37 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "description": "$string:module_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/testability/TestAbility.ets", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:start_window_background", + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/entry/src/ohosTest/resources/base/element/color.json b/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c --- /dev/null +++ b/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_test_desc", + "value": "test ability description" + }, + { + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/media/icon.png b/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/entry/src/ohosTest/resources/base/media/icon.png differ diff --git a/entry/src/ohosTest/resources/base/profile/test_pages.json b/entry/src/ohosTest/resources/base/profile/test_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..b7e7343cacb32ce982a45e76daad86e435e054fe --- /dev/null +++ b/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "testability/pages/Index" + ] +} diff --git a/hvigorfile.js b/hvigorfile.js deleted file mode 100644 index b8a72e6e306fdbf413970745ec5ba25364824968..0000000000000000000000000000000000000000 --- a/hvigorfile.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks \ No newline at end of file diff --git a/hvigorfile.ts b/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 --- /dev/null +++ b/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/okio/.gitignore b/okio/.gitignore index 4f9a973815d0b5e49bc8547681a6b4bc7a178d12..db260216fa9df50899751f1610564021c4cecc6d 100644 --- a/okio/.gitignore +++ b/okio/.gitignore @@ -1,3 +1,4 @@ /node_modules /.preview -/build \ No newline at end of file +/build +package-lock.json \ No newline at end of file diff --git a/okio/build-profile.json5 b/okio/build-profile.json5 index d5e58e894fd567c0252b3add4c36f08b27046902..35dff6d53cb3a241f8de4fb68bd01d38ade0f108 100644 --- a/okio/build-profile.json5 +++ b/okio/build-profile.json5 @@ -1,19 +1,5 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ { - "apiType": "faMode", + "apiType": "stageMode", "buildOption": { } } diff --git a/okio/hvigorfile.ts b/okio/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..47e6e1f81d365872f101585f5dbf816bcad65864 --- /dev/null +++ b/okio/hvigorfile.ts @@ -0,0 +1,2 @@ +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { harTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/okio/index.js b/okio/index.js deleted file mode 100644 index 4948124473c14bfc0837903f3481dd5911afc96c..0000000000000000000000000000000000000000 --- a/okio/index.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Buffer} from './src/main/js/core/Buffer.js'; -import {ByteString} from './src/main/js/core/ByteString.js'; -import Source from './src/main/js/filehandler/Source.js'; -import Sink from './src/main/js/filehandler/Sink.js' - -var okio = { - 'Buffer': Buffer, - 'ByteString': ByteString, - 'Source': Source, - 'Sink': Sink -} - -export default okio; \ No newline at end of file diff --git a/okio/hvigorfile.js b/okio/index.ts similarity index 49% rename from okio/hvigorfile.js rename to okio/index.ts index 4f2043e46e75c77d2aae64354a2a629a8da0055b..6caa251c39d1c53bfd42fcd4ccc88de552eae6aa 100644 --- a/okio/hvigorfile.js +++ b/okio/index.ts @@ -1,10 +1,10 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Copyright (C) 2022 Huawei Device Co., Ltd. + * Licensed under the MIT License, (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://opensource.org/licenses/MIT * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -12,5 +12,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -module.exports = require('@ohos/hvigor-ohos-plugin').legacyHarTasks +export { Buffer } from './src/main/ets/core/Buffer'; + +export { ByteString } from './src/main/ets/core/ByteString'; + +export { default as Source } from './src/main/ets/filehandler/Source'; + +export { default as Sink } from './src/main/ets/filehandler/Sink' + +export { default as Okio } from './src/main/ets/okio' \ No newline at end of file diff --git a/okio/package-lock.json b/okio/package-lock.json deleted file mode 100644 index 28740b94f918039975dadd5280349673b0854eae..0000000000000000000000000000000000000000 --- a/okio/package-lock.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "@ohos/okio", - "version": "1.0.0", - "lockfileVersion": 1 -} diff --git a/okio/package.json b/okio/package.json index 2bee84b738165df3698065c1d0a76b10270bfdaa..b205a6f6bff582ad5186d40098ae179bf74c6acc 100644 --- a/okio/package.json +++ b/okio/package.json @@ -1,19 +1,28 @@ { - "name": "@ohos/okio", - "version": "1.0.0", + "types": "", + "keywords": [ + "okio", + "OpenHarmony", + "HarmonyOS" + ], + "author": "ohos_tpc", "description": "Okio is a library that complements java.io and java.nio to make it much easier to access, store, and process your data", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, "ohos": { "org": "opensource" }, - "author": "ohos_tpc", - "license": "Apache License 2.0", + "main": "index.ts", "repository": "https://gitee.com/openharmony-tpc/okio", - "keywords": [ - "okio", - "OpenHarmony" - ] + "type": "module", + "version": "1.0.1", + "dependencies": {}, + "tags": [ + "Tool", + "FileData" + ], + "license": "Apache License 2.0", + "devDependencies": {}, + "name": "@ohos/okio", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + } } diff --git a/okio/src/main/config.json b/okio/src/main/config.json deleted file mode 100644 index 7331238a1f54261f834436992e15a777f3631fd8..0000000000000000000000000000000000000000 --- a/okio/src/main/config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "app": { - "bundleName": "cn.openharmony.okio.sample", - "vendor": "openharmony", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "cn.openharmony.okio", - "deviceType": [ - "phone", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "okio", - "moduleType": "har" - }, - "uiSyntax": "js" - } -} diff --git a/okio/src/main/ets/api/Buffer.d.ts b/okio/src/main/ets/api/Buffer.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b5c5b23b09ebebe8aa02dd96b4930247de36cadf --- /dev/null +++ b/okio/src/main/ets/api/Buffer.d.ts @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the Buffer Object + * @name Buffer + * @since 1.0.0 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + */ +declare namespace Buffer { + +/** + * write Utf8 data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be written in Buffer + * @return - Buffer + */ + function writeUtf8(data: string): Buffer; + + /** + * read Utf8 data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the Utf8 data + */ + function readUtf8(): string; + + /** + * write int data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: int data to be written in Buffer + * @return - Buffer + */ + function writeInt(data): Buffer; + + /** + * read int data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the int data + */ + function readInt(): var + + int; + + /** + * write string data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be written in Buffer + * @return Buffer + */ + function writeString(data: string): Buffer; + + /** + * read string data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the string data + */ + function readString(): string; + + /** + * write intLe data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: intLe data to be written in Buffer + * @return Buffer + */ + function writeIntLe(data): var + + Buffer; + + /** + * read intLe data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the intLe data + */ + function readIntLe(): var + + intLe; + + /** + * write shortLe data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: shortLe data to be written in Buffer + * @return Buffer + */ + function writeShortLe(data): var + + Buffer; + + /** + * read Utf8 shortLe. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the shortLe data + */ + function readShortLe(): var + + shortLe; + + /** + * write short data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: short data to be written in Buffer + * @return Buffer + */ + function writeShort(data): var + + Buffer; + + /** + * read short data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the short data + */ + function readShort(): var + + short; + + /** + * write byte data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: byte data to be written in Buffer + * @return Buffer + */ + function writeByte(data): var + + Buffer; + + /** + * read byte data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Returns the byte data + */ + function readByte(): var + + byte; + + /** + * write Utf8CodePoint data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: Utf8CodePoint data to be written in Buffer + * @return Buffer + */ + function writeUtf8CodePoint(data): var + + Buffer; + + /** + * read Utf8CodePoint data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return Utf8CodePoint data + */ + function readUtf8CodePoint(): var + + Utf8CodePoint; + + /** + * read Utf8ByteCount data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param byteCount: int byteCount to be written in integer + * @return Utf8ByteCount data + */ + function readUtf8ByteCount(byteCount): var + + string + + /** + * write sub string of string. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param string: The string to be written in string + * @param beginIndex: The beginIndex to be written in integer + * @param endIndex: The endIndex to be written in integer + * @return buffer data + */ + function writeSubString(string, beginIndex, endIndex): Buffer + + /** + * write Utf8 sub string of string. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param string: The string to be written in string + * @param beginIndex: The beginIndex to be written in integer + * @param endIndex: The endIndex to be written in integer + * @return buffer data + */ + function writeUtf8BeginEndIndex(string, beginIndex, endIndex): Buffer + + /** + * write string. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param pos: int pos to be written in integer + * @return string data + */ + function getCommonResult(pos): string; + + /** + * skip the bytes. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param bytecount: int bytecount to be written in integer + */ + function skipByteCount(bytecount) + + /** + * read byte array. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param byteCount: The bytecount to be written in integer + * @return string data + */ + function readByteArray(byteCount): string + + /** + * read data by given length. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param sink: int sink to be written in integer + * @return buffer data + */ + function readFully(sink): Buffer + + /** + * read data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param sink: The sink to be written in integer + * @param offset: The offset to be written in integer + * @param byteCount: The byteCount to be written in integer + * @return data length + */ + function read(sink, offset, byteCount): var + + int +} + +export default Buffer; \ No newline at end of file diff --git a/okio/src/main/ets/api/ByteString.d.ts b/okio/src/main/ets/api/ByteString.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31147c0e1738721d3dba681bf9c3593ea77bcb70 --- /dev/null +++ b/okio/src/main/ets/api/ByteString.d.ts @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * the ByteString Object + * @name ByteString + * @since 1.0.0 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + */ +declare namespace ByteString { + +/** + * Create ByteString instance. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: String data to be stored in Buffer + */ + function ByteString(data: buffer); + + /** + * write Base64String data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be decode + * @return - ByteString + */ + function decodeBase64(data: Base64String): ByteString; + + /** + * write HexString data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be decode + * @return - ByteString + */ + function decodeHex(data: HexString): ByteString; + + /** + * write string data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be decode + * @return - ByteString + */ + function encodeUtf8(data: string): ByteString; + + /** + * write array data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: array data + * @return - ByteString + */ + function of(data: array): ByteString; + + /** + * write string data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be string + * @return - ByteString + */ + function toAsciiLowercase(data: string): ByteString; + + /** + * write string data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: The data to be string + * @return - ByteString + */ + function toAsciiUppercase(data: string): ByteString; + + /** + * Return ByteString data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return - ByteString + */ + function toByteArray(): ByteString; + + /** + * write int data. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param index: The index to be integer + * @return - ByteValue + */ + function getWithIndex(index: int): ByteValue; + + /** + * Return data size. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return - DataLength + */ + function getSize(): var + + DataLength; + + /** + * Return byte array. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return - ByteArray + */ + function internalArray(): ByteArray; + + /** + * Return hash code. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return - Hashcode + */ + function hashCode(): Hashcode + + /** + * write byte array. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param other: The other to be buffer. + * @return - ByteValue + */ + function compareToOther(other: Buffer): ByteArray +} + +export default ByteString; \ No newline at end of file diff --git a/okio/src/main/js/api/Sink.d.ts b/okio/src/main/ets/api/Sink.d.ts similarity index 84% rename from okio/src/main/js/api/Sink.d.ts rename to okio/src/main/ets/api/Sink.d.ts index a05dddccf9523046e236ddc95f88c2d692536c43..206b3ee9003ad78d829376f1e8c3185890f94237 100644 --- a/okio/src/main/js/api/Sink.d.ts +++ b/okio/src/main/ets/api/Sink.d.ts @@ -23,14 +23,14 @@ */ declare namespace Sink { - /** - * Write content onto file. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: file path - */ +/** + * Write content onto file. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @param data: file path + */ function write(data: string, isAppend: boolean); } diff --git a/okio/src/main/js/api/Source.d.ts b/okio/src/main/ets/api/Source.d.ts similarity index 86% rename from okio/src/main/js/api/Source.d.ts rename to okio/src/main/ets/api/Source.d.ts index 384c0f7057cd3c46842dedcf15cc93cbb88a4726..14ba9458b6b9f49eeffe88432f3da2171ebea607 100644 --- a/okio/src/main/js/api/Source.d.ts +++ b/okio/src/main/ets/api/Source.d.ts @@ -23,14 +23,14 @@ */ declare namespace Source { - /** - * read file. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return - string; - */ +/** + * read file. + * + * @devices phone, tablet + * @since 1.0.0 + * @sysCap AAFwk + * @return - string; + */ function read(): read and returns content written on file; } diff --git a/okio/src/main/js/core/Buffer.js b/okio/src/main/ets/core/Buffer.ts similarity index 96% rename from okio/src/main/js/core/Buffer.js rename to okio/src/main/ets/core/Buffer.ts index 14341b6c7b1015865e3252b7db5678da4e8b18b9..8d0567c6155dd54e191333a00b9b0d78d9723ff7 100644 --- a/okio/src/main/js/core/Buffer.js +++ b/okio/src/main/ets/core/Buffer.ts @@ -14,8 +14,8 @@ */ import BufferUtil from '../utils/BufferUtil.js'; -import {util} from '../utils/Utilities.js'; -import {SegmentPool} from '../utils/SegmentPool.js'; +import { util } from '../utils/Utilities.js'; +import { SegmentPool } from '../utils/SegmentPool.js'; import Log from '../log.js'; var mIsInt = false; @@ -29,6 +29,7 @@ export function Buffer() { this.head = null; this.sizeDefault = util.Long.ZERO; } + Object.defineProperty(Buffer.prototype, 'size', { configurable: true, get: function () { @@ -51,7 +52,7 @@ function isInteger(value, type) { if (type == "intLe") mIsIntLe = true; else mIsInt = true; } else { - if (type == "intLe") mIsIntLe = false; + if (type == "intLe") mIsIntLe = false; else mIsInt = false; } } @@ -62,7 +63,7 @@ function isShort(value, type) { if (type == "shortLe") mIsShortLe = true; else mIsShort = true; } else { - if (type == "shortLe") mIsShortLe = false; + if (type == "shortLe") mIsShortLe = false; else mIsShort = false; } } @@ -70,9 +71,9 @@ function isShort(value, type) { function isByteValue(value) { var filter = /^(0|-?[1-9][0-9]*)$/.test(value); if (value >= -128 && value <= 127 && filter) - mIsByte = true; + mIsByte = true; else - mIsByte = false; + mIsByte = false; } Buffer.prototype.readShort = function () { @@ -83,7 +84,7 @@ Buffer.prototype.readShort = function () { commonReadShort$break: do { var tmp, tmp0; if (this.size.compareTo11rb$(L2) < 0) - return; + return; var segment = util.ensureNotNull(this.head); var pos = segment.pos; var limit = segment.limit; @@ -117,7 +118,7 @@ Buffer.prototype.readInt = function () { commonReadInt$break: do { var tmp, tmp0, tmp1, tmp2; if (this.size.compareTo11rb$(L4) < 0) - return; + return; var segment = util.ensureNotNull(this.head); var pos = segment.pos; var limit = segment.limit; @@ -175,7 +176,7 @@ Buffer.prototype.readUtf8ByteCount = function (byteCount) { return; } if (this.size.compareTo11rb$(byteCount) < 0) - return; + return; if (util.equals(byteCount, util.Long.ZERO)) { commonReadUtf8$result = ''; break commonReadUtf8$break; @@ -275,7 +276,7 @@ Buffer.prototype.writeUtf8BeginEndIndex = function (string, beginIndex, endIndex while (i < runLimit) { c = string.charCodeAt(i) | 0; if (c >= 128) - break; + break; data[segmentOffset + (tmp0 = i, i = tmp0 + 1 | 0, tmp0) | 0] = util.toByte(c); } var runSize = i + segmentOffset - tail.limit | 0; @@ -403,7 +404,7 @@ Buffer.prototype.writeByte = function (b) { Buffer.prototype.writeUtf8CodePoint = function (codePoint) { if (codePoint < 128) - this.writeByte(codePoint); + this.writeByte(codePoint); else if (codePoint < 2048) { var tail = this.writableSegment(2); var segment = util.ensureNotNull(this.head); @@ -412,7 +413,7 @@ Buffer.prototype.writeUtf8CodePoint = function (codePoint) { tail.limit = tail.limit + 2 | 0; this.size = this.size.add(util.Long.fromInt(2)); } else if (55296 <= codePoint && codePoint <= 57343) - this.writeByte(63); + this.writeByte(63); else if (codePoint < 65536) { var tail0 = this.writableSegment(3); tail0.data[tail0.limit] = util.toByte(codePoint >> 12 | 224); @@ -477,13 +478,13 @@ Buffer.prototype.readUtf8CodePoint = function () { } } if (codePoint > 1114111) - tmp0 = 65533; + tmp0 = 65533; else if (55296 <= codePoint && codePoint <= 57343) - tmp0 = 65533; + tmp0 = 65533; else if (codePoint < min) - tmp0 = 65533; + tmp0 = 65533; else - tmp0 = codePoint; + tmp0 = codePoint; commonReadUtf8CodePoint$result = tmp0; } while (false); @@ -512,26 +513,27 @@ Buffer.prototype.getCommonResult = function (pos) { } var s0 = s; var offset1 = offset0; - commonGet$result=util.ensureNotNull(s0).data[util.Long.fromInt(s0.pos).add(pos).subtract(offset1).toInt()]; + commonGet$result = util.ensureNotNull(s0).data[util.Long.fromInt(s0.pos).add(pos).subtract(offset1).toInt()]; } else { var offset2 = L0; while (true) { var nextOffset = offset2.add(util.Long.fromInt(s.limit - s.pos | 0)); if (nextOffset.compareTo11rb$(pos) > 0) - break; + break; s = util.ensureNotNull(s.next); offset2 = nextOffset; } var s1 = s; var offset3 = offset2; - commonGet$result=util.ensureNotNull(s1).data[util.Long.fromInt(s1.pos).add(pos).subtract(offset3).toInt()]; + commonGet$result = util.ensureNotNull(s1).data[util.Long.fromInt(s1.pos).add(pos).subtract(offset3).toInt()]; } } while (false); return commonGet$result; }; -function checkOffsetAndCount(size, offset, byteCount) {} +function checkOffsetAndCount(size, offset, byteCount) { +} Buffer.prototype.skipByteCount = function (byteCount) { var tmp; diff --git a/okio/src/main/js/core/ByteString.js b/okio/src/main/ets/core/ByteString.ts similarity index 85% rename from okio/src/main/js/core/ByteString.js rename to okio/src/main/ets/core/ByteString.ts index c295fd1257401c158194128ba2fab0ed2899431a..859f895a2ece997d172496b263ca05da93336996 100644 --- a/okio/src/main/js/core/ByteString.js +++ b/okio/src/main/ets/core/ByteString.ts @@ -15,11 +15,12 @@ import { util } from '../utils/Utilities.js'; import Log from '../log.js'; -import {hex} from '../utils/Hex.js' -import {Md5} from '../utils/MD5.js' +import { hex } from '../utils/Hex.js' +import { Md5 } from '../utils/MD5.js' + var byteString = {}; -var byteStringFunction = function(_, Util) { +var byteStringFunction = function (_, Util) { 'use strict'; var L6 = Util.Long.fromInt(6); @@ -64,6 +65,7 @@ var byteStringFunction = function(_, Util) { return base64; } + function decodeBase64ToArray($receiver) { var tmp, tmp0, tmp1, tmp2, tmp3, tmp4, tmp5; var limit = $receiver.length; @@ -75,7 +77,9 @@ var byteStringFunction = function(_, Util) { limit = limit - 1 | 0; } var out = new Int8Array(Util.Long.fromInt(limit).multiply(L6).div(L8).toInt()); - var outCount = 0; var inCount = 0; var word = 0; + var outCount = 0; + var inCount = 0; + var word = 0; tmp = limit; for (var pos = 0; pos < tmp; pos++) { var c0 = $receiver.charCodeAt(pos); @@ -120,30 +124,32 @@ var byteStringFunction = function(_, Util) { break; } if (outCount === out.length) - return out; + return out; return copyOf(out, outCount); } function decodeHexDigit(c) { var tmp; if ((new CharRange(48, 57)).containsmef7kx$(c)) - tmp = c - 48; + tmp = c - 48; else if ((new CharRange(97, 102)).containsmef7kx$(c)) - tmp = c - 97 + 10 | 0; + tmp = c - 97 + 10 | 0; else if ((new CharRange(65, 70)).containsmef7kx$(c)) - tmp = c - 65 + 10 | 0; + tmp = c - 65 + 10 | 0; else - throw illegalArgumentException('Unexpected hex digit: ' + String.fromCharCode(c)); + throw illegalArgumentException('Unexpected hex digit: ' + String.fromCharCode(c)); return tmp; } function asUtf8ToByteArray($receiver) { return commonAsUtf8ToByteArray($receiver); } + function ArrayIndexOutOfBoundsException(message) { IndexOutOfBoundsException.call(this, message); this.name = 'ArrayIndexOutOfBoundsException'; } + function commonAsUtf8ToByteArray($receiver) { var bytes = new Int8Array(4 * $receiver.length | 0); var tmp = $receiver.length; @@ -209,30 +215,33 @@ var byteStringFunction = function(_, Util) { } return copyOf(bytes, $receiver.length); } + var package$okio = _.okio || (_.okio = {}); REPLACEMENT_BYTE = toByte(63 | 0); Object.defineProperty(package$okio, 'REPLACEMENT_BYTE_8be2vx$', { - get: function() { + get: function () { return REPLACEMENT_BYTE; } }); - + function ByteString(data) { getByteStringCompanion(); this.data = data; this.hashValue = 0; } + Object.defineProperty(ByteString.prototype, 'hashCode8b', { configurable: true, - get: function() { + get: function () { return this.hashValue; }, - set: function(value) {} + set: function (value) { + } }); ByteString.prototype.toAsciiLowercase = function (data) { - if(data === undefined || data === null || data.length === 0) { + if (data === undefined || data === null || data.length === 0) { Log.showError('Invalid toAsciiLowercase input'); return; } @@ -246,7 +255,7 @@ var byteStringFunction = function(_, Util) { }; ByteString.prototype.toAsciiUppercase = function (data) { - if(data === undefined || data === null || data.length === 0) { + if (data === undefined || data === null || data.length === 0) { Log.showError('Invalid toAsciiUppercase input'); return; } @@ -258,48 +267,47 @@ var byteStringFunction = function(_, Util) { } return new ByteString(commonToAsciiUppercase$result); }; - ByteString.prototype.internalGet = function(pos) { - if (pos >= this.size || pos < 0) - { + ByteString.prototype.internalGet = function (pos) { + if (pos >= this.size || pos < 0) { Log.showError('ArrayIndexOutOfBoundsException size=' + this.size + ' pos=' + pos); } return this.data[pos]; - }; - ByteString.prototype.getWithIndex = function(index) { + }; + ByteString.prototype.getWithIndex = function (index) { return this.internalGet(index); }; Object.defineProperty(ByteString.prototype, 'size', { configurable: true, - get: function() { + get: function () { return this.getSize(); } }); - ByteString.prototype.getSize = function() { - if(this.data === undefined || this.data === null) { + ByteString.prototype.getSize = function () { + if (this.data === undefined || this.data === null) { Log.showError('Invalid getSize input'); return; } return this.data.length; }; - ByteString.prototype.toByteArray = function() { - if(this.data === undefined || this.data === null || this.data.length === 0) { + ByteString.prototype.toByteArray = function () { + if (this.data === undefined || this.data === null || this.data.length === 0) { Log.showError('Invalid toByteArray input'); return; } return this.data.slice(); }; - ByteString.prototype.internalArray = function() { - if(this.data === undefined || this.data === null || this.data.length === 0) { + ByteString.prototype.internalArray = function () { + if (this.data === undefined || this.data === null || this.data.length === 0) { Log.showError('Invalid toAsciiLowercase input'); return; } return this.data; }; - ByteString.prototype.hashCode = function() { + ByteString.prototype.hashCode = function () { var commonHashCode$result; commonHashCode$break: do { var result = this.hashCode8b; @@ -315,8 +323,8 @@ var byteStringFunction = function(_, Util) { return commonHashCode$result; }; - ByteString.prototype.compareToOther = function(other) { - if(other === undefined || other === null || other.length === 0) { + ByteString.prototype.compareToOther = function (other) { + if (other === undefined || other === null || other.length === 0) { Log.showError('Invalid compareToOther input'); return; } @@ -351,15 +359,15 @@ var byteStringFunction = function(_, Util) { this.EMPTY = new ByteString(new Int8Array([])); } - ByteString.prototype.of = function(data) { - if(data === undefined || data === null || data.length === 0) { + ByteString.prototype.of = function (data) { + if (data === undefined || data === null || data.length === 0) { Log.showError('Invalid of input'); return; } return new ByteString(data.slice()); }; - ByteString.prototype.encodeUtf8 = function($receiver) { - if($receiver === undefined || $receiver === null || $receiver.length === 0) { + ByteString.prototype.encodeUtf8 = function ($receiver) { + if ($receiver === undefined || $receiver === null || $receiver.length === 0) { Log.showError('Invalid encodeUtf8 input'); return; } @@ -367,42 +375,42 @@ var byteStringFunction = function(_, Util) { byteString.utf8 = $receiver; return byteString; }; - ByteString.prototype.decodeBase64 = function($receiver) { - if($receiver === undefined || $receiver === null || $receiver.length === 0) { + ByteString.prototype.decodeBase64 = function ($receiver) { + if ($receiver === undefined || $receiver === null || $receiver.length === 0) { Log.showError('Invalid decodeBase64 input'); return; } var decoded = decodeBase64ToArray($receiver); return decoded != null ? new ByteString(decoded) : null; }; - ByteString.prototype.Base64 = function() { - if(this.data === undefined || this.data === null || this.data.length === 0) { + ByteString.prototype.Base64 = function () { + if (this.data === undefined || this.data === null || this.data.length === 0) { Log.showError('Invalid encodeBase64 input'); return; } return encodeBase64(this.data); }; - ByteString.prototype.Hex = function() { - if(this.data === undefined || this.data === null || this.data.length === 0) { + ByteString.prototype.Hex = function () { + if (this.data === undefined || this.data === null || this.data.length === 0) { Log.showError('Invalid encode Hex input'); return; } let encoded = hex(this.data); return encoded; }; - ByteString.prototype.md5 = function() { - if(this.data === undefined || this.data === null || this.data.length === 0) { + ByteString.prototype.md5 = function () { + if (this.data === undefined || this.data === null || this.data.length === 0) { Log.showError('Invalid encode Hex input'); return; } let data = this.data var md = new Md5(); md.update(data, 0, data.length); - let encoded = md.digest(); + let encoded = md.digest(); return new ByteString(encoded); }; - ByteString.prototype.decodeHex = function($receiver) { - if($receiver === undefined || $receiver === null || $receiver.length === 0 || $receiver.length % 2 != 0) { + ByteString.prototype.decodeHex = function ($receiver) { + if ($receiver === undefined || $receiver === null || $receiver.length === 0 || $receiver.length % 2 != 0) { Log.showError('Invalid decodeHex input'); return; } @@ -434,6 +442,7 @@ var byteStringFunction = function(_, Util) { } return byteStringCompanion; } + ByteString.$metadata$ = { kind: kindClass, simpleName: 'ByteString', diff --git a/okio/src/main/js/filehandler/Sink.js b/okio/src/main/ets/filehandler/Sink.ts similarity index 91% rename from okio/src/main/js/filehandler/Sink.js rename to okio/src/main/ets/filehandler/Sink.ts index 5e0adde73075ac4334f95133de1adc6f37c5e8a4..01716dcf2ce305a7e5d2ae14f7a6ea927a98a0c4 100644 --- a/okio/src/main/js/filehandler/Sink.js +++ b/okio/src/main/ets/filehandler/Sink.ts @@ -22,6 +22,8 @@ var isFileAdded = false; let fileDescriptor = null; export default class Sink { + filePath: string = '' + constructor(filePath) { this.filePath = filePath; } @@ -30,10 +32,11 @@ export default class Sink { if (isAppend) { this.writeData(data); } else { - if(this.exist()) this.deleteFile(); + if (this.exist()) this.deleteFile(); this.writeFile(data); } } + writeFile(content) { try { let fd = fileio.openSync(this.filePath, 0o102, 0o666) @@ -45,6 +48,7 @@ export default class Sink { Log.showError("Sink write Error - " + e); } } + writeData(content) { try { let fd = fileio.openSync(this.filePath, 0o102, 0o666) @@ -57,13 +61,15 @@ export default class Sink { Log.showError("Sink writeData Error - " + e); } } + deleteFile() { fileio.unlinkSync(this.filePath); } - exist(){ + + exist() { try { - let stat = fileio.statSync(this.filePath) - return stat.isFile() + let stat = fileio.statSync(this.filePath) + return stat.isFile() } catch (e) { return false } diff --git a/okio/src/main/js/filehandler/Source.js b/okio/src/main/ets/filehandler/Source.ts similarity index 97% rename from okio/src/main/js/filehandler/Source.js rename to okio/src/main/ets/filehandler/Source.ts index 72463059ee58c9cb936e534a32dc22125321c7e4..a3235e855885d0572e5cd4aa2ddf065541cc13cd 100644 --- a/okio/src/main/js/filehandler/Source.js +++ b/okio/src/main/ets/filehandler/Source.ts @@ -21,6 +21,8 @@ var fileDescriptor = null; var buffer = null; export default class Source { + filePath: string = '' + constructor(filePath) { this.filePath = filePath; fileDescriptor = fileio.openSync(this.filePath, 0o102, 0o666); @@ -99,7 +101,7 @@ export default class Source { } return unicodeStr; } catch (error) { - Log.showError("Source read Error - " + error); + Log.showError("Source read Error - " + error); return null; } } diff --git a/okio/src/main/js/log.js b/okio/src/main/ets/log.js similarity index 92% rename from okio/src/main/js/log.js rename to okio/src/main/ets/log.js index 72b6d08683fe8f4d3c521a195f204130997cdf9d..ee7962584f99f623537acab8a4047dbb69eeb07d 100644 --- a/okio/src/main/js/log.js +++ b/okio/src/main/ets/log.js @@ -26,7 +26,7 @@ export default class Log { * @param {string} log - Log needs to be printed */ static showInfo(log, ...ms) { - console.info(log,ms); + console.info(log, ms); } /** @@ -35,7 +35,7 @@ export default class Log { * @param {string} log - Log needs to be printed */ static showDebug(log, ...ms) { - console.debug(log,ms); + console.debug(log, ms); } /** @@ -44,6 +44,6 @@ export default class Log { * @param {string} log - Log needs to be printed */ static showError(log, ...ms) { - console.error(log,ms); + console.error(log, ms); } } diff --git a/okio/src/main/ets/okio.ts b/okio/src/main/ets/okio.ts new file mode 100644 index 0000000000000000000000000000000000000000..9b22aa265526855a51450d42d096082acfe9a200 --- /dev/null +++ b/okio/src/main/ets/okio.ts @@ -0,0 +1,17 @@ +import { Buffer } from './core/Buffer'; + +import { ByteString } from './core/ByteString'; + +import { default as Source } from './filehandler/Source'; + +import { default as Sink } from './filehandler/Sink' + +const Okio = { + 'Buffer': Buffer, + 'ByteString': ByteString, + 'Source': Source, + 'Sink': Sink, + +} + +export default Okio; \ No newline at end of file diff --git a/okio/src/main/js/utils/BufferUtil.js b/okio/src/main/ets/utils/BufferUtil.js similarity index 97% rename from okio/src/main/js/utils/BufferUtil.js rename to okio/src/main/ets/utils/BufferUtil.js index fcb690c8971852731c2c241b895fbb149c6ead8f..2bca7624126414c320673fdc9a79c90ca49f42b2 100644 --- a/okio/src/main/js/utils/BufferUtil.js +++ b/okio/src/main/ets/utils/BufferUtil.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import {util} from "./Utilities.js"; +import { util } from './Utilities.js'; var BufferUtilInstance = null; diff --git a/okio/src/main/js/utils/Hex.js b/okio/src/main/ets/utils/Hex.js similarity index 98% rename from okio/src/main/js/utils/Hex.js rename to okio/src/main/ets/utils/Hex.js index 1aa51d2b7a57a16f624892ed2395e12e5c02461d..f437504b840425e67acb3c25f2ac94994aca5b18 100644 --- a/okio/src/main/js/utils/Hex.js +++ b/okio/src/main/ets/utils/Hex.js @@ -51,7 +51,7 @@ function toChar(a) { function unboxChar(a) { if (a == null) - return a; + return a; return toChar(a); } @@ -60,7 +60,7 @@ function charArray(size, init) { var result = new Uint16Array(size); result.$type$ = 'CharArray'; if (init == null || equals(init, true) || equals(init, false)) - tmp = result; + tmp = result; else { var tmp0; tmp0 = result.length - 1 | 0; diff --git a/okio/src/main/js/utils/MD5.js b/okio/src/main/ets/utils/MD5.js similarity index 89% rename from okio/src/main/js/utils/MD5.js rename to okio/src/main/ets/utils/MD5.js index 6ca84ce019efb23c19d5f69f62b0dfd7bb3a9100..9f0c5087a82a5605e966cd41656b768baf592381 100644 --- a/okio/src/main/js/utils/MD5.js +++ b/okio/src/main/ets/utils/MD5.js @@ -13,7 +13,7 @@ * limitations under the License. */ -import { util } from "./Utilities.js"; +import { util } from './Utilities.js'; import Log from '../log.js'; export function Md5() { @@ -176,19 +176,19 @@ Md5.prototype.digest = function () { function Md5$Companion() { md5CompanionInstance = this; this.s0 = new Int32Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, - 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, - 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, - 15, 21, 6, 10, 15, 21]); + 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, + 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, + 15, 21, 6, 10, 15, 21]); this.k0 = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, - -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, - 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, - 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, - -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, - -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, - -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, - 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, - -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, - -145523070, -1120210379, 718787259, -343485551]); + -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, + 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, + 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, + -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, + -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, + -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, + 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, + -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, + -145523070, -1120210379, 718787259, -343485551]); } var md5CompanionInstance = null; @@ -225,9 +225,9 @@ Md5.prototype.arrayCopy = function (source, destination, destinationOffset, star } Md5.prototype.fill = function ($receiver, element, fromIndex, toIndex) { if (fromIndex === void 0) - fromIndex = 0; + fromIndex = 0; if (toIndex === void 0) - toIndex = $receiver.length; + toIndex = $receiver.length; $receiver.fill(element, fromIndex, toIndex); } Md5.prototype.toByte = function (a) { diff --git a/okio/src/main/js/utils/Segment.js b/okio/src/main/ets/utils/Segment.js similarity index 96% rename from okio/src/main/js/utils/Segment.js rename to okio/src/main/ets/utils/Segment.js index 09cb40444852e30a3c9b7334ecbbf6db549f7330..a14afdd01edda091f89a75f3eb870ca06817c815 100644 --- a/okio/src/main/js/utils/Segment.js +++ b/okio/src/main/ets/utils/Segment.js @@ -72,13 +72,13 @@ Segment.prototype.compact = function () { throw util.illegalStateExceptionInit(message.toString()); } if (!util.ensureNotNull(this.prev).owner) - return; + return; var byteCount = this.limit - this.pos | 0; var availableByteCount = 8192 - util.ensureNotNull(this.prev).limit + (util.ensureNotNull(this.prev).shared ? 0 : util.ensureNotNull(this.prev).pos) | 0; if (byteCount > availableByteCount) - return; + return; this.writeTo(util.ensureNotNull(this.prev), byteCount); this.pop(); SegmentPool.segmentPoolGetInstance().recycle(this); @@ -91,9 +91,9 @@ Segment.prototype.writeTo = function (sink, byteCount) { } if ((sink.limit + byteCount | 0) > 8192) { if (sink.shared) - throw util.illegalArgumentExceptionInit0(); + throw util.illegalArgumentExceptionInit0(); if ((sink.limit + byteCount - sink.pos | 0) > 8192) - throw util.illegalArgumentExceptionInit0(); + throw util.illegalArgumentExceptionInit0(); arrayCopy(sink.data, sink.data, 0, sink.pos, sink.limit); sink.limit = sink.limit - sink.pos | 0; sink.pos = 0; diff --git a/okio/src/main/js/utils/SegmentPool.js b/okio/src/main/ets/utils/SegmentPool.js similarity index 100% rename from okio/src/main/js/utils/SegmentPool.js rename to okio/src/main/ets/utils/SegmentPool.js diff --git a/okio/src/main/js/utils/Utilities.js b/okio/src/main/ets/utils/Utilities.js similarity index 100% rename from okio/src/main/js/utils/Utilities.js rename to okio/src/main/ets/utils/Utilities.js diff --git a/okio/src/main/js/api/Buffer.d.ts b/okio/src/main/js/api/Buffer.d.ts deleted file mode 100644 index 96aa9bca5c71c0cd183b7b74f967b3ceb854b239..0000000000000000000000000000000000000000 --- a/okio/src/main/js/api/Buffer.d.ts +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * the Buffer Object - * @name Buffer - * @since 1.0.0 - * @sysCap AAFwk - * @devices phone, tablet - * @permission N/A - */ -declare namespace Buffer { - - /** - * write Utf8 data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be written in Buffer - * @return - Buffer - */ - function writeUtf8(data: string): Buffer; - - /** - * read Utf8 data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the Utf8 data - */ - function readUtf8(): string; - - /** - * write int data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: int data to be written in Buffer - * @return - Buffer - */ - function writeInt(data): Buffer; - - /** - * read int data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the int data - */ - function readInt(): var int; - - /** - * write string data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be written in Buffer - * @return Buffer - */ - function writeString(data: string): Buffer; - - /** - * read string data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the string data - */ - function readString(): string; - - /** - * write intLe data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: intLe data to be written in Buffer - * @return Buffer - */ - function writeIntLe(data): var Buffer; - - /** - * read intLe data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the intLe data - */ - function readIntLe(): var intLe; - - /** - * write shortLe data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: shortLe data to be written in Buffer - * @return Buffer - */ - function writeShortLe(data): var Buffer; - - /** - * read Utf8 shortLe. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the shortLe data - */ - function readShortLe(): var shortLe; - - /** - * write short data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: short data to be written in Buffer - * @return Buffer - */ - function writeShort(data): var Buffer; - - /** - * read short data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the short data - */ - function readShort(): var short; - - /** - * write byte data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: byte data to be written in Buffer - * @return Buffer - */ - function writeByte(data): var Buffer; - - /** - * read byte data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Returns the byte data - */ - function readByte(): var byte; - - /** - * write Utf8CodePoint data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: Utf8CodePoint data to be written in Buffer - * @return Buffer - */ - function writeUtf8CodePoint(data): var Buffer; - - /** - * read Utf8CodePoint data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return Utf8CodePoint data - */ - function readUtf8CodePoint(): var Utf8CodePoint; - - /** - * read Utf8ByteCount data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param byteCount: int byteCount to be written in integer - * @return Utf8ByteCount data - */ - function readUtf8ByteCount(byteCount): var string - - /** - * write sub string of string. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param string: The string to be written in string - * @param beginIndex: The beginIndex to be written in integer - * @param endIndex: The endIndex to be written in integer - * @return buffer data - */ - function writeSubString(string, beginIndex, endIndex): Buffer - - /** - * write Utf8 sub string of string. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param string: The string to be written in string - * @param beginIndex: The beginIndex to be written in integer - * @param endIndex: The endIndex to be written in integer - * @return buffer data - */ - function writeUtf8BeginEndIndex(string, beginIndex, endIndex): Buffer - - /** - * write string. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param pos: int pos to be written in integer - * @return string data - */ - function getCommonResult(pos): string; - - /** - * skip the bytes. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param bytecount: int bytecount to be written in integer - */ - function skipByteCount(bytecount) - - /** - * read byte array. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param byteCount: The bytecount to be written in integer - * @return string data - */ - function readByteArray(byteCount): string - - /** - * read data by given length. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param sink: int sink to be written in integer - * @return buffer data - */ - function readFully(sink): Buffer - - /** - * read data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param sink: The sink to be written in integer - * @param offset: The offset to be written in integer - * @param byteCount: The byteCount to be written in integer - * @return data length - */ - function read(sink, offset, byteCount): var int -} - -export default Buffer; \ No newline at end of file diff --git a/okio/src/main/js/api/ByteString.d.ts b/okio/src/main/js/api/ByteString.d.ts deleted file mode 100644 index ec6da4fc18f84887db0b678141362b68057ee601..0000000000000000000000000000000000000000 --- a/okio/src/main/js/api/ByteString.d.ts +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * the ByteString Object - * @name ByteString - * @since 1.0.0 - * @sysCap AAFwk - * @devices phone, tablet - * @permission N/A - */ -declare namespace ByteString { - - /** - * Create ByteString instance. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: String data to be stored in Buffer - */ - function ByteString(data: buffer); - - /** - * write Base64String data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be decode - * @return - ByteString - */ - function decodeBase64(data: Base64String): ByteString; - - /** - * write HexString data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be decode - * @return - ByteString - */ - function decodeHex(data: HexString): ByteString; - - /** - * write string data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be decode - * @return - ByteString - */ - function encodeUtf8(data: string): ByteString; - - /** - * write array data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: array data - * @return - ByteString - */ - function of(data: array): ByteString; - - /** - * write string data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be string - * @return - ByteString - */ - function toAsciiLowercase(data: string): ByteString; - - /** - * write string data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param data: The data to be string - * @return - ByteString - */ - function toAsciiUppercase(data: string): ByteString; - - /** - * Return ByteString data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return - ByteString - */ - function toByteArray(): ByteString; - - /** - * write int data. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param index: The index to be integer - * @return - ByteValue - */ - function getWithIndex(index: int):ByteValue; - - /** - * Return data size. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return - DataLength - */ - function getSize(): var DataLength; - - /** - * Return byte array. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return - ByteArray - */ - function internalArray():ByteArray; - - /** - * Return hash code. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @return - Hashcode - */ - function hashCode():Hashcode - - /** - * write byte array. - * - * @devices phone, tablet - * @since 1.0.0 - * @sysCap AAFwk - * @param other: The other to be buffer. - * @return - ByteValue - */ - function compareToOther(other: Buffer): ByteArray -} - -export default ByteString; \ No newline at end of file diff --git a/okio/src/main/module.json5 b/okio/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..78947fc9c8bfb444a0530c255e3462434ceb3328 --- /dev/null +++ b/okio/src/main/module.json5 @@ -0,0 +1,9 @@ +{ + "module": { + "name": "okio", + "type": "har", + "deviceTypes": [ + "default" + ] + } +} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 8fd77b1629dd128b1e82b5094fd92a1fd5e871b8..0000000000000000000000000000000000000000 --- a/package-lock.json +++ /dev/null @@ -1,1643 +0,0 @@ -{ - "name": "okio", - "version": "1.0.0", - "lockfileVersion": 1, - "requires": true, - "dependencies": { - "@ohos/hvigor": { - "version": "1.0.6", - "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hvigor/-/@ohos/hvigor-1.0.6.tgz", - "integrity": "sha512-jjp7vpvUOMW1Nf7TdyhOtonwWHoSyBJLUiZTQqIx/GJV4UJyIqsiURUOqFwncQ4L7PDdeHuWly4uEelknYeWhg==", - "requires": { - "@ohos/hvigor-base": "1.0.6", - "interpret": "1.4.0", - "liftoff": "4.0.0", - "mute-stdout": "1.0.0", - "pretty-hrtime": "1.0.0", - "v8flags": "3.2.0", - "yargs": "7.1.0" - } - }, - "@ohos/hvigor-base": { - "version": "1.0.6", - "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hvigor-base/-/@ohos/hvigor-base-1.0.6.tgz", - "integrity": "sha512-cRDnWICTxmpNiFb9clIioqP5Oik1seLCICztXVhZqultrHuxwTheCRUZrHwlpyWdkSB2Al+FFBqmSwzIgZX4IQ==", - "requires": { - "json5": "2.2.0", - "log4js": "6.4.1", - "undertaker": "1.2.1" - } - }, - "@ohos/hvigor-ohos-plugin": { - "version": "1.0.6", - "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/hvigor-ohos-plugin/-/@ohos/hvigor-ohos-plugin-1.0.6.tgz", - "integrity": "sha512-MAAi8uJxMzODUoSSNfBr+fU4HQ20dfQtkje9I+X4asc7qY2kAplW/q9f5XS8IOvv8zhC8OcSgsAXOAJuLMstOQ==", - "requires": { - "@ohos/hvigor-base": "1.0.6", - "@ohos/sdkmanager-common": "1.1.3", - "ajv": "8.10.0", - "archiver": "5.3.0", - "execa": "5.1.1", - "fs-extra": "10.0.0", - "glob": "7.2.0", - "iconv-lite": "0.6.3", - "json5": "2.2.0", - "lodash": "4.17.21", - "pretty-hrtime": "1.0.3", - "resolve-package-path": "4.0.3" - }, - "dependencies": { - "fs-extra": { - "version": "10.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/fs-extra/-/fs-extra-10.0.0.tgz", - "integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=" - } - } - }, - "@ohos/sdkmanager-common": { - "version": "1.1.3", - "resolved": "https://cmc.centralrepo.rnd.huawei.com/artifactory/api/npm/product_npm/@ohos/sdkmanager-common/-/@ohos/sdkmanager-common-1.1.3.tgz", - "integrity": "sha512-d2uhVauDDJZIUvyyaWWoavG4N/jLyfF5IH5kEXKV6R8HNf3606H1zDQzA+UZtOfwwJFXhD9djRjnVFNB8xc7aw==" - }, - "ajv": { - "version": "8.10.0", - "resolved": "http://mirrors.tools.huawei.com/npm/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", - "requires": { - "fast-deep-equal": "^3.1.1", - "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "archiver": { - "version": "5.3.0", - "resolved": "http://mirrors.tools.huawei.com/npm/archiver/-/archiver-5.3.0.tgz", - "integrity": "sha512-iUw+oDwK0fgNpvveEsdQ0Ase6IIKztBJU2U0E9MzszMfmVVUyv1QJhS2ITW9ZCqx8dktAxVAjWWkKehuZE8OPg==", - "requires": { - "archiver-utils": "^2.1.0", - "async": "^3.2.0", - "buffer-crc32": "^0.2.1", - "readable-stream": "^3.6.0", - "readdir-glob": "^1.0.0", - "tar-stream": "^2.2.0", - "zip-stream": "^4.1.0" - } - }, - "archiver-utils": { - "version": "2.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/archiver-utils/-/archiver-utils-2.1.0.tgz", - "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", - "requires": { - "glob": "^7.1.4", - "graceful-fs": "^4.2.0", - "lazystream": "^1.0.0", - "lodash.defaults": "^4.2.0", - "lodash.difference": "^4.5.0", - "lodash.flatten": "^4.4.0", - "lodash.isplainobject": "^4.0.6", - "lodash.union": "^4.6.0", - "normalize-path": "^3.0.0", - "readable-stream": "^2.0.0" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "http://mirrors.tools.huawei.com/npm/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - } - } - }, - "arr-filter": { - "version": "1.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/arr-filter/-/arr-filter-1.1.2.tgz", - "integrity": "sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4=", - "requires": { - "make-iterator": "^1.0.0" - } - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-map": { - "version": "2.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/arr-map/-/arr-map-2.0.2.tgz", - "integrity": "sha1-Onc0X/wc814qkYJWAfnljy4kysQ=", - "requires": { - "make-iterator": "^1.0.0" - } - }, - "array-each": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/array-each/-/array-each-1.0.1.tgz", - "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=" - }, - "array-initial": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/array-initial/-/array-initial-1.1.0.tgz", - "integrity": "sha1-L6dLJnOTccOUe9enrcc74zSz15U=", - "requires": { - "array-slice": "^1.0.0", - "is-number": "^4.0.0" - } - }, - "array-last": { - "version": "1.3.0", - "resolved": "http://mirrors.tools.huawei.com/npm/array-last/-/array-last-1.3.0.tgz", - "integrity": "sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg==", - "requires": { - "is-number": "^4.0.0" - } - }, - "array-slice": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/array-slice/-/array-slice-1.1.0.tgz", - "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==" - }, - "async": { - "version": "3.2.3", - "resolved": "http://mirrors.tools.huawei.com/npm/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, - "async-done": { - "version": "1.3.2", - "resolved": "http://mirrors.tools.huawei.com/npm/async-done/-/async-done-1.3.2.tgz", - "integrity": "sha512-uYkTP8dw2og1tu1nmza1n1CMW0qb8gWWlwqMmLb7MhBVs4BXrFziT6HXUd+/RlRA/i4H9AkofYloUbs1fwMqlw==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.2", - "process-nextick-args": "^2.0.0", - "stream-exhaust": "^1.0.1" - } - }, - "async-settle": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/async-settle/-/async-settle-1.0.0.tgz", - "integrity": "sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs=", - "requires": { - "async-done": "^1.2.2" - } - }, - "bach": { - "version": "1.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/bach/-/bach-1.2.0.tgz", - "integrity": "sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA=", - "requires": { - "arr-filter": "^1.1.1", - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "array-each": "^1.0.0", - "array-initial": "^1.0.0", - "array-last": "^1.1.1", - "async-done": "^1.2.2", - "async-settle": "^1.0.0", - "now-and-later": "^2.0.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "base64-js": { - "version": "1.5.1", - "resolved": "http://mirrors.tools.huawei.com/npm/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" - }, - "bl": { - "version": "4.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "requires": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "http://mirrors.tools.huawei.com/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "requires": { - "fill-range": "^7.0.1" - } - }, - "buffer": { - "version": "5.7.1", - "resolved": "http://mirrors.tools.huawei.com/npm/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "http://mirrors.tools.huawei.com/npm/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" - }, - "call-bind": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", - "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" - } - }, - "camelcase": { - "version": "3.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=" - }, - "cliui": { - "version": "3.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" - }, - "collection-map": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/collection-map/-/collection-map-1.0.0.tgz", - "integrity": "sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw=", - "requires": { - "arr-map": "^2.0.2", - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "compress-commons": { - "version": "4.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/compress-commons/-/compress-commons-4.1.1.tgz", - "integrity": "sha512-QLdDLCKNV2dtoTorqgxngQCMA+gWXkM/Nwu7FpeBhk/RdkzimqC3jueb/FDmaZeXh+uby1jkBqE3xArsLBE5wQ==", - "requires": { - "buffer-crc32": "^0.2.13", - "crc32-stream": "^4.0.2", - "normalize-path": "^3.0.0", - "readable-stream": "^3.6.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "core-util-is": { - "version": "1.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "crc-32": { - "version": "1.2.2", - "resolved": "http://mirrors.tools.huawei.com/npm/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==" - }, - "crc32-stream": { - "version": "4.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/crc32-stream/-/crc32-stream-4.0.2.tgz", - "integrity": "sha512-DxFZ/Hk473b/muq1VJ///PMNLj0ZMnzye9thBpmjpJKCc5eMgB95aK8zCGrGfQ90cWo561Te6HK9D+j4KPdM6w==", - "requires": { - "crc-32": "^1.2.0", - "readable-stream": "^3.4.0" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "dependencies": { - "which": { - "version": "2.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "requires": { - "isexe": "^2.0.0" - } - } - } - }, - "d": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "date-format": { - "version": "4.0.6", - "resolved": "http://mirrors.tools.huawei.com/npm/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==" - }, - "debug": { - "version": "4.3.4", - "resolved": "http://mirrors.tools.huawei.com/npm/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "requires": { - "ms": "2.1.2" - } - }, - "decamelize": { - "version": "1.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" - }, - "default-resolution": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/default-resolution/-/default-resolution-2.0.0.tgz", - "integrity": "sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ=" - }, - "define-properties": { - "version": "1.1.3", - "resolved": "http://mirrors.tools.huawei.com/npm/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", - "requires": { - "object-keys": "^1.0.12" - } - }, - "detect-file": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/detect-file/-/detect-file-1.0.0.tgz", - "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=" - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "http://mirrors.tools.huawei.com/npm/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" - } - }, - "error-ex": { - "version": "1.3.2", - "resolved": "http://mirrors.tools.huawei.com/npm/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "requires": { - "is-arrayish": "^0.2.1" - } - }, - "es5-ext": { - "version": "0.10.60", - "resolved": "http://mirrors.tools.huawei.com/npm/es5-ext/-/es5-ext-0.10.60.tgz", - "integrity": "sha512-jpKNXIt60htYG59/9FGf2PYT3pwMpnEbNKysU+k/4FGwyGtMotOvcZOuW+EmXXYASRqYSXQfGL5cVIthOTgbkg==", - "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "http://mirrors.tools.huawei.com/npm/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "es6-weak-map": { - "version": "2.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/es6-weak-map/-/es6-weak-map-2.0.3.tgz", - "integrity": "sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==", - "requires": { - "d": "1", - "es5-ext": "^0.10.46", - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.1" - } - }, - "execa": { - "version": "5.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", - "requires": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" - } - }, - "expand-tilde": { - "version": "2.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/expand-tilde/-/expand-tilde-2.0.2.tgz", - "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "ext": { - "version": "1.6.0", - "resolved": "http://mirrors.tools.huawei.com/npm/ext/-/ext-1.6.0.tgz", - "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", - "requires": { - "type": "^2.5.0" - }, - "dependencies": { - "type": { - "version": "2.6.0", - "resolved": "http://mirrors.tools.huawei.com/npm/type/-/type-2.6.0.tgz", - "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" - } - } - }, - "extend": { - "version": "3.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "http://mirrors.tools.huawei.com/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "fill-range": { - "version": "7.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "findup-sync": { - "version": "5.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/findup-sync/-/findup-sync-5.0.0.tgz", - "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", - "requires": { - "detect-file": "^1.0.0", - "is-glob": "^4.0.3", - "micromatch": "^4.0.4", - "resolve-dir": "^1.0.1" - } - }, - "fined": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/fined/-/fined-2.0.0.tgz", - "integrity": "sha512-OFRzsL6ZMHz5s0JrsEr+TpdGNCtrVtnuG3x1yzGNiQHT0yaDnXAj8V/lWcpJVrnoDpcwXcASxAZYbuXda2Y82A==", - "requires": { - "expand-tilde": "^2.0.2", - "is-plain-object": "^5.0.0", - "object.defaults": "^1.1.0", - "object.pick": "^1.3.0", - "parse-filepath": "^1.0.2" - } - }, - "flagged-respawn": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/flagged-respawn/-/flagged-respawn-2.0.0.tgz", - "integrity": "sha512-Gq/a6YCi8zexmGHMuJwahTGzXlAZAOsbCVKduWXC6TlLCjjFRlExMJc4GC2NYPYZ0r/brw9P7CpRgQmlPVeOoA==" - }, - "flatted": { - "version": "3.2.5", - "resolved": "http://mirrors.tools.huawei.com/npm/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==" - }, - "for-in": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "for-own": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/for-own/-/for-own-1.0.0.tgz", - "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", - "requires": { - "for-in": "^1.0.1" - } - }, - "fs-constants": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, - "fs-extra": { - "version": "10.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "function-bind": { - "version": "1.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" - }, - "get-intrinsic": { - "version": "1.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", - "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" - } - }, - "get-stream": { - "version": "6.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==" - }, - "glob": { - "version": "7.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "global-modules": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", - "requires": { - "global-prefix": "^1.0.1", - "is-windows": "^1.0.1", - "resolve-dir": "^1.0.0" - } - }, - "global-prefix": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/global-prefix/-/global-prefix-1.0.2.tgz", - "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", - "requires": { - "expand-tilde": "^2.0.2", - "homedir-polyfill": "^1.0.1", - "ini": "^1.3.4", - "is-windows": "^1.0.1", - "which": "^1.2.14" - } - }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "http://mirrors.tools.huawei.com/npm/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, - "has": { - "version": "1.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "requires": { - "function-bind": "^1.1.1" - } - }, - "has-symbols": { - "version": "1.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" - }, - "homedir-polyfill": { - "version": "1.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", - "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "requires": { - "parse-passwd": "^1.0.0" - } - }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "http://mirrors.tools.huawei.com/npm/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" - }, - "human-signals": { - "version": "2.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==" - }, - "hypium": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/hypium/-/hypium-1.0.0.tgz", - "integrity": "sha512-nl+RQVv2AU/5FvFRhsXyWO5wh+2huhdqRZ3bszBWZzW+kpNI3AT4ydvVRYIfaQbYwV4UlX/rSc7BtFjLAezhow==" - }, - "iconv-lite": { - "version": "0.6.3", - "resolved": "http://mirrors.tools.huawei.com/npm/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - } - }, - "ieee754": { - "version": "1.2.1", - "resolved": "http://mirrors.tools.huawei.com/npm/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" - }, - "inflight": { - "version": "1.0.6", - "resolved": "http://mirrors.tools.huawei.com/npm/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "http://mirrors.tools.huawei.com/npm/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "1.3.8", - "resolved": "http://mirrors.tools.huawei.com/npm/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "interpret": { - "version": "1.4.0", - "resolved": "http://mirrors.tools.huawei.com/npm/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==" - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - }, - "is-absolute": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-absolute/-/is-absolute-1.0.0.tgz", - "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", - "requires": { - "is-relative": "^1.0.0", - "is-windows": "^1.0.1" - } - }, - "is-arrayish": { - "version": "0.2.1", - "resolved": "http://mirrors.tools.huawei.com/npm/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" - }, - "is-core-module": { - "version": "2.8.1", - "resolved": "http://mirrors.tools.huawei.com/npm/is-core-module/-/is-core-module-2.8.1.tgz", - "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", - "requires": { - "has": "^1.0.3" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "is-glob": { - "version": "4.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "4.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "is-relative": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-relative/-/is-relative-1.0.0.tgz", - "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", - "requires": { - "is-unc-path": "^1.0.0" - } - }, - "is-stream": { - "version": "2.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" - }, - "is-unc-path": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-unc-path/-/is-unc-path-1.0.0.tgz", - "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", - "requires": { - "unc-path-regex": "^0.1.2" - } - }, - "is-utf8": { - "version": "0.2.1", - "resolved": "http://mirrors.tools.huawei.com/npm/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" - }, - "is-windows": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" - }, - "isarray": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isexe": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isobject": { - "version": "3.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, - "json-schema-traverse": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" - }, - "json5": { - "version": "2.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "requires": { - "minimist": "^1.2.5" - } - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "kind-of": { - "version": "6.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==" - }, - "last-run": { - "version": "1.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/last-run/-/last-run-1.1.1.tgz", - "integrity": "sha1-RblpQsF7HHnHchmCWbqUO+v4yls=", - "requires": { - "default-resolution": "^2.0.0", - "es6-weak-map": "^2.0.1" - } - }, - "lazystream": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/lazystream/-/lazystream-1.0.1.tgz", - "integrity": "sha512-b94GiNHQNy6JNTrt5w6zNyffMrNkXZb3KTkCZJb2V1xaEGCk093vkZ2jk3tpaeP33/OiXC+WvK9AxUebnf5nbw==", - "requires": { - "readable-stream": "^2.0.5" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "http://mirrors.tools.huawei.com/npm/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - } - } - }, - "lcid": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - } - }, - "liftoff": { - "version": "4.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/liftoff/-/liftoff-4.0.0.tgz", - "integrity": "sha512-rMGwYF8q7g2XhG2ulBmmJgWv25qBsqRbDn5gH0+wnuyeFt7QBJlHJmtg5qEdn4pN6WVAUMgXnIxytMFRX9c1aA==", - "requires": { - "extend": "^3.0.2", - "findup-sync": "^5.0.0", - "fined": "^2.0.0", - "flagged-respawn": "^2.0.0", - "is-plain-object": "^5.0.0", - "object.map": "^1.0.1", - "rechoir": "^0.8.0", - "resolve": "^1.20.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "http://mirrors.tools.huawei.com/npm/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lodash.defaults": { - "version": "4.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/lodash.defaults/-/lodash.defaults-4.2.0.tgz", - "integrity": "sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw=" - }, - "lodash.difference": { - "version": "4.5.0", - "resolved": "http://mirrors.tools.huawei.com/npm/lodash.difference/-/lodash.difference-4.5.0.tgz", - "integrity": "sha1-nMtOUF1Ia5FlE0V3KIWi3yf9AXw=" - }, - "lodash.flatten": { - "version": "4.4.0", - "resolved": "http://mirrors.tools.huawei.com/npm/lodash.flatten/-/lodash.flatten-4.4.0.tgz", - "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=" - }, - "lodash.isplainobject": { - "version": "4.0.6", - "resolved": "http://mirrors.tools.huawei.com/npm/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" - }, - "lodash.union": { - "version": "4.6.0", - "resolved": "http://mirrors.tools.huawei.com/npm/lodash.union/-/lodash.union-4.6.0.tgz", - "integrity": "sha1-SLtQiECfFvGCFmZkHETdGqrjzYg=" - }, - "log4js": { - "version": "6.4.1", - "resolved": "http://mirrors.tools.huawei.com/npm/log4js/-/log4js-6.4.1.tgz", - "integrity": "sha512-iUiYnXqAmNKiIZ1XSAitQ4TmNs8CdZYTAWINARF3LjnsLN8tY5m0vRwd6uuWj/yNY0YHxeZodnbmxKFUOM2rMg==", - "requires": { - "date-format": "^4.0.3", - "debug": "^4.3.3", - "flatted": "^3.2.4", - "rfdc": "^1.3.0", - "streamroller": "^3.0.2" - } - }, - "make-iterator": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/make-iterator/-/make-iterator-1.0.1.tgz", - "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", - "requires": { - "kind-of": "^6.0.2" - } - }, - "map-cache": { - "version": "0.2.2", - "resolved": "http://mirrors.tools.huawei.com/npm/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "merge-stream": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" - }, - "micromatch": { - "version": "4.0.5", - "resolved": "http://mirrors.tools.huawei.com/npm/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" - }, - "minimatch": { - "version": "3.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.6", - "resolved": "http://mirrors.tools.huawei.com/npm/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "ms": { - "version": "2.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "mute-stdout": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/mute-stdout/-/mute-stdout-1.0.0.tgz", - "integrity": "sha1-WzLqB+tDyd7WEwQ0z5JvRrKn/U0=" - }, - "next-tick": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "http://mirrors.tools.huawei.com/npm/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, - "now-and-later": { - "version": "2.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/now-and-later/-/now-and-later-2.0.1.tgz", - "integrity": "sha512-KGvQ0cB70AQfg107Xvs/Fbu+dGmZoTRJp2TaPwcwQm3/7PteUyN2BCgk8KBMPGBUXZdVwyWS8fDCGFygBm19UQ==", - "requires": { - "once": "^1.3.2" - } - }, - "npm-run-path": { - "version": "4.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/npm-run-path/-/npm-run-path-4.0.1.tgz", - "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", - "requires": { - "path-key": "^3.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" - }, - "object-keys": { - "version": "1.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" - }, - "object.assign": { - "version": "4.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", - "requires": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", - "object-keys": "^1.1.1" - } - }, - "object.defaults": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/object.defaults/-/object.defaults-1.1.0.tgz", - "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", - "requires": { - "array-each": "^1.0.1", - "array-slice": "^1.0.0", - "for-own": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "object.map": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/object.map/-/object.map-1.0.1.tgz", - "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "http://mirrors.tools.huawei.com/npm/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "^3.0.1" - } - }, - "object.reduce": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/object.reduce/-/object.reduce-1.0.1.tgz", - "integrity": "sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=", - "requires": { - "for-own": "^1.0.0", - "make-iterator": "^1.0.0" - } - }, - "once": { - "version": "1.4.0", - "resolved": "http://mirrors.tools.huawei.com/npm/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "onetime": { - "version": "5.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "os-locale": { - "version": "1.4.0", - "resolved": "http://mirrors.tools.huawei.com/npm/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - } - }, - "parse-filepath": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/parse-filepath/-/parse-filepath-1.0.2.tgz", - "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", - "requires": { - "is-absolute": "^1.0.0", - "map-cache": "^0.2.0", - "path-root": "^0.1.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", - "requires": { - "error-ex": "^1.2.0" - } - }, - "parse-passwd": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" - }, - "path-exists": { - "version": "2.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-key": { - "version": "3.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" - }, - "path-parse": { - "version": "1.0.7", - "resolved": "http://mirrors.tools.huawei.com/npm/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "path-root": { - "version": "0.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/path-root/-/path-root-0.1.1.tgz", - "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", - "requires": { - "path-root-regex": "^0.1.0" - } - }, - "path-root-regex": { - "version": "0.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/path-root-regex/-/path-root-regex-0.1.2.tgz", - "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=" - }, - "path-type": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "picomatch": { - "version": "2.3.1", - "resolved": "http://mirrors.tools.huawei.com/npm/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, - "pify": { - "version": "2.3.0", - "resolved": "http://mirrors.tools.huawei.com/npm/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=" - }, - "pinkie": { - "version": "2.0.4", - "resolved": "http://mirrors.tools.huawei.com/npm/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" - }, - "pinkie-promise": { - "version": "2.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "requires": { - "pinkie": "^2.0.0" - } - }, - "pretty-hrtime": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/pretty-hrtime/-/pretty-hrtime-1.0.0.tgz", - "integrity": "sha1-9ualItPmBwRSK/Db5oVu0g515Nw=" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "http://mirrors.tools.huawei.com/npm/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "readdir-glob": { - "version": "1.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/readdir-glob/-/readdir-glob-1.1.1.tgz", - "integrity": "sha512-91/k1EzZwDx6HbERR+zucygRFfiPl2zkIYZtv3Jjr6Mn7SkKcVct8aVO+sSRiGMc6fLf72du3d92/uY63YPdEA==", - "requires": { - "minimatch": "^3.0.4" - } - }, - "rechoir": { - "version": "0.8.0", - "resolved": "http://mirrors.tools.huawei.com/npm/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", - "requires": { - "resolve": "^1.20.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-from-string": { - "version": "2.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" - }, - "resolve": { - "version": "1.22.0", - "resolved": "http://mirrors.tools.huawei.com/npm/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", - "requires": { - "is-core-module": "^2.8.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - } - }, - "resolve-dir": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/resolve-dir/-/resolve-dir-1.0.1.tgz", - "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", - "requires": { - "expand-tilde": "^2.0.0", - "global-modules": "^1.0.0" - } - }, - "resolve-package-path": { - "version": "4.0.3", - "resolved": "http://mirrors.tools.huawei.com/npm/resolve-package-path/-/resolve-package-path-4.0.3.tgz", - "integrity": "sha512-SRpNAPW4kewOaNUt8VPqhJ0UMxawMwzJD8V7m1cJfdSTK9ieZwS6K7Dabsm4bmLFM96Z5Y/UznrpG5kt1im8yA==", - "requires": { - "path-root": "^0.1.1" - } - }, - "rfdc": { - "version": "1.3.0", - "resolved": "http://mirrors.tools.huawei.com/npm/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "semver": { - "version": "5.7.1", - "resolved": "http://mirrors.tools.huawei.com/npm/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" - }, - "signal-exit": { - "version": "3.0.7", - "resolved": "http://mirrors.tools.huawei.com/npm/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "spdx-correct": { - "version": "3.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "requires": { - "spdx-expression-parse": "^3.0.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-exceptions": { - "version": "2.3.0", - "resolved": "http://mirrors.tools.huawei.com/npm/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" - }, - "spdx-expression-parse": { - "version": "3.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "requires": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, - "spdx-license-ids": { - "version": "3.0.11", - "resolved": "http://mirrors.tools.huawei.com/npm/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz", - "integrity": "sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g==" - }, - "stream-exhaust": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/stream-exhaust/-/stream-exhaust-1.0.2.tgz", - "integrity": "sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw==" - }, - "streamroller": { - "version": "3.0.6", - "resolved": "http://mirrors.tools.huawei.com/npm/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", - "requires": { - "date-format": "^4.0.6", - "debug": "^4.3.4", - "fs-extra": "^10.0.1" - } - }, - "string-width": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "http://mirrors.tools.huawei.com/npm/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "strip-final-newline": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/strip-final-newline/-/strip-final-newline-2.0.0.tgz", - "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" - }, - "supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" - }, - "tar-stream": { - "version": "2.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/tar-stream/-/tar-stream-2.2.0.tgz", - "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "requires": { - "bl": "^4.0.3", - "end-of-stream": "^1.4.1", - "fs-constants": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^3.1.1" - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - }, - "dependencies": { - "is-number": { - "version": "7.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - } - } - }, - "type": { - "version": "1.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "unc-path-regex": { - "version": "0.1.2", - "resolved": "http://mirrors.tools.huawei.com/npm/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=" - }, - "undertaker": { - "version": "1.2.1", - "resolved": "http://mirrors.tools.huawei.com/npm/undertaker/-/undertaker-1.2.1.tgz", - "integrity": "sha512-71WxIzDkgYk9ZS+spIB8iZXchFhAdEo2YU8xYqBYJ39DIUIqziK78ftm26eecoIY49X0J2MLhG4hr18Yp6/CMA==", - "requires": { - "arr-flatten": "^1.0.1", - "arr-map": "^2.0.0", - "bach": "^1.0.0", - "collection-map": "^1.0.0", - "es6-weak-map": "^2.0.1", - "last-run": "^1.1.0", - "object.defaults": "^1.0.0", - "object.reduce": "^1.0.0", - "undertaker-registry": "^1.0.0" - } - }, - "undertaker-registry": { - "version": "1.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/undertaker-registry/-/undertaker-registry-1.0.1.tgz", - "integrity": "sha1-XkvaMI5KiirlhPm5pDWaSZglzFA=" - }, - "universalify": { - "version": "2.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "http://mirrors.tools.huawei.com/npm/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "requires": { - "punycode": "^2.1.0" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "v8flags": { - "version": "3.2.0", - "resolved": "http://mirrors.tools.huawei.com/npm/v8flags/-/v8flags-3.2.0.tgz", - "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", - "requires": { - "homedir-polyfill": "^1.0.1" - } - }, - "validate-npm-package-license": { - "version": "3.0.4", - "resolved": "http://mirrors.tools.huawei.com/npm/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "requires": { - "spdx-correct": "^3.0.0", - "spdx-expression-parse": "^3.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "http://mirrors.tools.huawei.com/npm/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } - }, - "which-module": { - "version": "1.0.0", - "resolved": "http://mirrors.tools.huawei.com/npm/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "http://mirrors.tools.huawei.com/npm/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "y18n": { - "version": "3.2.2", - "resolved": "http://mirrors.tools.huawei.com/npm/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" - }, - "yargs": { - "version": "7.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", - "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" - } - }, - "yargs-parser": { - "version": "5.0.1", - "resolved": "http://mirrors.tools.huawei.com/npm/yargs-parser/-/yargs-parser-5.0.1.tgz", - "integrity": "sha512-wpav5XYiddjXxirPoCTUPbqM0PXvJ9hiBMvuJgInvo4/lAOTZzUprArw17q2O1P2+GHhbBr18/iQwjL5Z9BqfA==", - "requires": { - "camelcase": "^3.0.0", - "object.assign": "^4.1.0" - } - }, - "zip-stream": { - "version": "4.1.0", - "resolved": "http://mirrors.tools.huawei.com/npm/zip-stream/-/zip-stream-4.1.0.tgz", - "integrity": "sha512-zshzwQW7gG7hjpBlgeQP9RuyPGNxvJdzR8SUM3QhxCnLjWN2E7j3dOvpeDcQoETfHx0urRS7EtmVToql7YpU4A==", - "requires": { - "archiver-utils": "^2.1.0", - "compress-commons": "^4.1.0", - "readable-stream": "^3.6.0" - } - } - } -} diff --git a/package.json b/package.json index 6773ec8ecb2926380b8118a0961a4f9c710dc03e..ed18c6b53d89808385a17cf2868a3d0adec4bb65 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,19 @@ { - "license":"ISC", - "devDependencies":{}, - "name":"okio", - "ohos":{ - "org":"huawei", - "directoryLevel":"project", - "buildTool":"hvigor" - }, - "description":"OpenHarmony library for okio", - "repository":{}, - "version":"1.0.0", - "dependencies":{ - "@ohos/hvigor-ohos-plugin":"1.0.6", - "hypium":"^1.0.0", - "@ohos/hvigor":"1.0.6" - } -} \ No newline at end of file + "license": "ISC", + "devDependencies": {}, + "name": "okio", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "OpenHarmony library for okio", + "repository": {}, + "version": "1.0.0", + "dependencies": { + "@ohos/hypium": "1.0.5", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "hypium": "^1.0.0", + "@ohos/hvigor": "1.4.0" + } +}