From e1219b3ac9bd2bc44865aeffcce658037a179b3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=89=E5=A4=B4=E5=90=9B?= Date: Fri, 2 Feb 2024 09:39:27 +0800 Subject: [PATCH] =?UTF-8?q?[Issues:=20#I90D94]=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=88=B00130=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1224/lodash.md | 175 ------------------ {1224 => zh-cn}/htmlparser2.md | 16 +- {1224 => zh-cn}/i18next.md | 18 +- .../jeanregisser-react-native-slider.md | 20 +- {1224 => zh-cn}/js-beautify.md | 17 +- zh-cn/lodash.md | 41 ++-- 6 files changed, 61 insertions(+), 226 deletions(-) delete mode 100644 1224/lodash.md rename {1224 => zh-cn}/htmlparser2.md (93%) rename {1224 => zh-cn}/i18next.md (95%) rename {1224 => zh-cn}/jeanregisser-react-native-slider.md (94%) rename {1224 => zh-cn}/js-beautify.md (98%) diff --git a/1224/lodash.md b/1224/lodash.md deleted file mode 100644 index 8f20d5df..00000000 --- a/1224/lodash.md +++ /dev/null @@ -1,175 +0,0 @@ -> 模板版本:v0.1.2 - -

-

lodash

-

-

- - License - -

- -> [!tip] [Github 地址](https://github.com/lodash/lodash/tree/4.17.21) - -## 安装与使用 - -#### **yarn** - -```bash -yarn add lodash@^4.17.21 -``` - -#### **npm** -```bash -npm install lodash@4.17.21 -``` - - -下面的代码展示了这个库的基本使用场景: - -```js -// findLastIndex 为例 -import lodashStable from "lodash"; - -var users = [ - { 'user': 'barney', 'active': true }, - { 'user': 'fred', 'active': false }, - { 'user': 'pebbles', 'active': false } -]; - -lodashStable.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); -// => 2 - -// The `_.matches` iteratee shorthand. -lodashStable.findLastIndex(users, { 'user': 'barney', 'active': true }); -// => 0 - -// The `_.matchesProperty` iteratee shorthand. -lodashStable.findLastIndex(users, ['active', false]); -// => 2 - -// The `_.property` iteratee shorthand. -lodashStable.findLastIndex(users, 'active'); -// => 0 - -``` -### 兼容性 - -在下述版本验证通过: - 1. IDE:Deveco Studio 4.1.3.412; - SDK: OpenHarmony (Api11) 4.1.0.53; - 测试设备: Mate40 Pro (NOH-AN00); - ROM: 2.0.0.52 (SP22C00E52R1P17log); - RNOH: 0.72.11。 - -## 静态方法 - -详情查看[lodash官方文档](https://lodash.com/docs/4.17.15) - -如下是已验证接口展示: - - #### **Collection** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| find | Iterates over elements of collection, returning the first element predicate returns truthy for | function | NO | yes | -| findLast | Iterates over elements of collection from right to left, returning the first element | function | NO | yes | -| size | Gets the size of collection | function | NO | yes | -| map | Creates an array of values by running each element in collection thru iteratee | function | NO | yes | -| includes | Checks if value is in collection. If collection is a string, it's checked for a substring of value, otherwise SameValueZero is used for equality comparisons | function | NO | yes | -| filter | Iterates over elements of collection, returning an array of all elements predicate returns truthy for | function | NO | yes | -| uniq | Creates a duplicate-free version of an array, using SameValueZero for equality comparisons, in which only the first occurrence of each element is kept | function | NO | yes | -| uniqBy | This method is like _.uniq except that it accepts iteratee which is invoked for each element in array to generate the criterion by which uniqueness is computed | function | NO | yes | -| chunk | Creates an array of elements split into groups the length of size. If array can't be split evenly, the final chunk will be the remaining elements | function | NO | yes | -| slice | Creates a slice of array from start up to, but not including, end | function | NO | yes | -| compact | Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are falsey | function | NO | yes | - -#### **Array** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| findIndex | This method is like _.find except that it returns the index of the first element predicate returns truthy for instead of the element itself | function | NO | yes | -| findLastIndex | This method is like _.findIndex except that it iterates over elements of collection from right to left | function | NO | yes | -| head | Gets the first element of array | function | NO | yes | -| flattenDeep | Recursively flattens array | function | NO | yes | -| remove | emoves all elements from array that predicate returns truthy for and returns an array of the removed elements | function | NO | yes | -| nth | Gets the element at index n of array. If n is negative, the nth element from the end is returned | function | NO | yes | -| jion | Converts all elements in array into a string separated by separator | function | NO | yes | - -#### **String** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| camelCase | Converts string to camel case | function | NO | yes | -| repeat | Repeats the given string n times | function | NO | yes | -| truncate | | function | NO | yes | -| toUpper | Converts string, as a whole, to upper case just like String#toUpperCase. | function | NO | yes | - -#### **Math** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| ceil | Computes number rounded up to precision | function | NO | yes | -| divide | Divide two numbers. | function | NO | yes | Math | -| round | Computes number rounded to precision. | function | NO | yes | -| floor | Computes number rounded down to precision | function | NO | yes | -| sum | Computes the sum of the values in array | function | NO | yes | - -#### **Object** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| findKey | This method is like _.find, returns the key of the first element | function | NO | yes | -| findLastKey | This method is like _.findKey it iterates over elements of a collection in the opposite order | function | NO | yes | -| get | Gets the value at path of object. If the resolved value is undefined, the defaultValue is returned in its place | function | NO | yes | -| values | Creates an array of the own enumerable string keyed property values of object | function | NO | yes | -| keys | Creates an array of the own enumerable property names of object | function | NO | yes | -| merge | This method is like _.assign except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination object | function | NO | yes | - -#### **Util** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| range | Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end | function | NO | yes | -| toPath | Converts value to a property path array | function | NO | yes | -| times | Invokes the iteratee n times, returning an array of the results of each invocation | function | NO | yes | - -#### **Lang** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| isEmpty | Checks if value is an empty object, collection, map, or set | function | NO | yes | -| isEqual | Performs a deep comparison between two values to determine if they are equivalent | function | NO | yes | -| isNumber | Checks if value is classified as a Number primitive or object | function | NO | yes | -| cloneDeep | This method is like _.clone except that it recursively clones value | function | NO | yes | -| isNaN | Checks if value is NaN | function | NO | yes | -| isString | Checks if value is classified as a String primitive or object | function | NO | yes | - -#### **Function** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| debounce | Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked | function | NO | yes | -| throttle | Creates a throttled function that only invokes func at most once per every wait milliseconds | function | NO | yes | - -#### **Number** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| clamp | Clamps number within the inclusive lower and upper bounds | function | NO | yes | -| random | Produces a random number between the inclusive lower and upper bounds | function | NO | yes | -| inRange | Checks if n is between start and up to, but not including, end | function | NO | yes | - -#### **Seq** - -| Name | Description | Type | Required | HarmonyOS Support | -| ---- | ---- | ---- | -------- | -------- | -| chain | Creates a lodash wrapper instance that wraps value with explicit method chain sequences enabled | function | NO | yes | - -## 遗留问题 - -## 其他 - -## 开源协议 - -本项目基于 [The MIT License (MIT)](https://github.com/lodash/lodash/blob/4.17.21/LICENSE) ,请自由地享受和参与开源。 diff --git a/1224/htmlparser2.md b/zh-cn/htmlparser2.md similarity index 93% rename from 1224/htmlparser2.md rename to zh-cn/htmlparser2.md index d24ed916..a576cb26 100644 --- a/1224/htmlparser2.md +++ b/zh-cn/htmlparser2.md @@ -1,4 +1,4 @@ -> 模板版本:v0.1.2 +> 模板版本:v0.1.3

htmlparser2

@@ -20,22 +20,21 @@ 进入到工程目录并输入以下命令: - -**yarn** +#### **npm** ```bash -yarn add htmlparser2@9.1.0 +npm install htmlparser2@9.1.0 ``` -#### **npm** +**yarn** ```bash -npm install htmlparser2@9.1.0 +yarn add htmlparser2@9.1.0 ``` -下面的代码展示了这个库的基本使用场景: +快速使用: ```js import * as htmlparser2 from "htmlparser2"; @@ -84,7 +83,8 @@ parser.end(); 在下述版本验证通过: -1. IDE:4.1.3.500; SDK:HarmonyOS NEXT Devloper Preview1; 测试设备:Mate60 (BAR-AL00); Rom:204.1.0.59(SP2DEVC00E60R4P1); RNOH:0.72.13。 +1. RNOH:0.72.11; SDK:OpenHarmony(api11) 4.1.0.53; IDE:DevEco Studio 4.1.3.412; ROM:2.0.0.52; +2. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.58; ## 生态系统 diff --git a/1224/i18next.md b/zh-cn/i18next.md similarity index 95% rename from 1224/i18next.md rename to zh-cn/i18next.md index 0ede9ec0..9d4f9621 100644 --- a/1224/i18next.md +++ b/zh-cn/i18next.md @@ -1,4 +1,4 @@ -> 模板版本:v0.1.2 +> 模板版本:v0.1.3

i18next

@@ -16,11 +16,6 @@ 进入到工程目录并输入以下命令: -#### **yarn** - -```bash -yarn add i18next@^23.7.16 -``` #### **npm** @@ -29,9 +24,15 @@ yarn add i18next@^23.7.16 npm install i18next@^23.7.16 --save ``` +#### **yarn** + +```bash +yarn add i18next@^23.7.16 +``` + -下面的代码展示了这个库的基本使用场景: +快速使用: ```js import i18next from 'i18next' @@ -64,7 +65,8 @@ i18next 在下述版本验证通过: - 1. IDE:DevEco Studio 4.1.3.313;SDK:OpenHarmony(api11) 4.1.0.52;测试设备:Mate40 Pro(NOH-AN00);ROM:2.0.0.52(SP22C00E52R1P17log);RNOH:0.72.11 +1. RNOH:0.72.11; SDK:OpenHarmony(api11) 4.1.0.53; IDE:DevEco Studio 4.1.3.412; ROM:2.0.0.52; +2. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.58; ## API diff --git a/1224/jeanregisser-react-native-slider.md b/zh-cn/jeanregisser-react-native-slider.md similarity index 94% rename from 1224/jeanregisser-react-native-slider.md rename to zh-cn/jeanregisser-react-native-slider.md index 8481c063..701b1c5b 100644 --- a/1224/jeanregisser-react-native-slider.md +++ b/zh-cn/jeanregisser-react-native-slider.md @@ -1,4 +1,4 @@ -> 模板版本:v0.1.2 +> 模板版本:v0.1.3

jeanregisser-react-native-slider

@@ -14,23 +14,31 @@ ## 安装与使用 +请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/jeanregisser-react-native-slider Releases](https://github.com/react-native-oh-library/jeanregisser-react-native-slider/releases),并下载适用版本的 tgz 包 + 进入到工程目录并输入以下命令: -#### **yarn** +>[!TIP] # 处替换为 tgz 包的路径 + +#### **npm** ```bash -yarn add @react-native-oh-tpl/react-native-slider +npm i @react-native-oh-tpl/react-native-slider@file:# ``` -#### **npm** +#### **yarn** + ```bash -npm i @react-native-oh-tpl/react-native-slider +yarn add @react-native-oh-tpl/react-native-slider@file:# ``` + -下面的代码展示了这个库的基本使用场景: +快速使用: + +>[!WARNING] 使用时 import 的库名不变。 ```js import React, { useState} from 'react'; diff --git a/1224/js-beautify.md b/zh-cn/js-beautify.md similarity index 98% rename from 1224/js-beautify.md rename to zh-cn/js-beautify.md index 12233556..3d1ef10a 100644 --- a/1224/js-beautify.md +++ b/zh-cn/js-beautify.md @@ -1,4 +1,4 @@ -> 模板版本:v0.1.2 +> 模板版本:v0.1.3

js-beautify

@@ -18,21 +18,21 @@ -#### **yarn** +#### **npm** ```bash -yarn add js-beautify@^1.14.9 +npm install js-beautify@^1.14.9 ``` -#### **npm** +#### **yarn** ```bash -npm install js-beautify@^1.14.9 +yarn add js-beautify@^1.14.9 ``` -下面的代码展示了这个库的基本使用场景: +快速使用: ```typescript import React from 'react'; @@ -76,8 +76,9 @@ css_beautify(data,options) 在下述版本验证通过: -1. IDE: DevEco Studio 4.1.3.401; SDK: Openharmony ( API 11) 4.1.0.52; 测试设备: Mate40 pro (NOH-AN00); ROM: 2.0.0.52(SP22C00E52R1P17log); RNOH: 0.72.12。 - +1. RNOH:0.72.11; SDK:OpenHarmony(api11) 4.1.0.53; IDE:DevEco Studio 4.1.3.412; ROM:2.0.0.52; +2. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.58; + ## API列表 #### js_beautify diff --git a/zh-cn/lodash.md b/zh-cn/lodash.md index 9dcc9f69..dbbded3c 100644 --- a/zh-cn/lodash.md +++ b/zh-cn/lodash.md @@ -1,4 +1,4 @@ -> 模板版本:v0.1.2 +> 模板版本:v0.1.3

lodash

@@ -13,19 +13,21 @@ ## 安装与使用 -#### **yarn** +#### **npm** ```bash -yarn add lodash +npm install lodash@4.17.21 ``` -#### **npm** +#### **yarn** + ```bash -npm install lodash +yarn add lodash@^4.17.21 ``` + -下面的代码展示了这个库的基本使用场景: +直接使用: ```js // findLastIndex 为例 @@ -56,11 +58,8 @@ lodashStable.findLastIndex(users, 'active'); ### 兼容性 在下述版本验证通过: - 1. IDE:Deveco Studio 4.1.3.412; - SDK: OpenHarmony (Api11) 4.1.0.53; - 测试设备: Mate40 Pro (NOH-AN00); - ROM: 2.0.0.52 (SP22C00E52R1P17log); - RNOH: 0.72.11。 +1. RNOH:0.72.11; SDK:OpenHarmony(api11) 4.1.0.53; IDE:DevEco Studio 4.1.3.412; ROM:2.0.0.52; +2. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.58; ## 静态方法 @@ -70,7 +69,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Collection** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | find | Iterates over elements of collection, returning the first element predicate returns truthy for | function | NO | yes | | findLast | Iterates over elements of collection from right to left, returning the first element | function | NO | yes | @@ -86,7 +85,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Array** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | findIndex | This method is like _.find except that it returns the index of the first element predicate returns truthy for instead of the element itself | function | NO | yes | | findLastIndex | This method is like _.findIndex except that it iterates over elements of collection from right to left | function | NO | yes | @@ -98,7 +97,7 @@ lodashStable.findLastIndex(users, 'active'); #### **String** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | camelCase | Converts string to camel case | function | NO | yes | | repeat | Repeats the given string n times | function | NO | yes | @@ -107,7 +106,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Math** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | ceil | Computes number rounded up to precision | function | NO | yes | | divide | Divide two numbers. | function | NO | yes | Math | @@ -117,7 +116,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Object** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | findKey | This method is like _.find, returns the key of the first element | function | NO | yes | | findLastKey | This method is like _.findKey it iterates over elements of a collection in the opposite order | function | NO | yes | @@ -128,7 +127,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Util** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | range | Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end | function | NO | yes | | toPath | Converts value to a property path array | function | NO | yes | @@ -136,7 +135,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Lang** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | isEmpty | Checks if value is an empty object, collection, map, or set | function | NO | yes | | isEqual | Performs a deep comparison between two values to determine if they are equivalent | function | NO | yes | @@ -147,14 +146,14 @@ lodashStable.findLastIndex(users, 'active'); #### **Function** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | debounce | Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since the last time the debounced function was invoked | function | NO | yes | | throttle | Creates a throttled function that only invokes func at most once per every wait milliseconds | function | NO | yes | #### **Number** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | clamp | Clamps number within the inclusive lower and upper bounds | function | NO | yes | | random | Produces a random number between the inclusive lower and upper bounds | function | NO | yes | @@ -162,7 +161,7 @@ lodashStable.findLastIndex(users, 'active'); #### **Seq** -| 名称 | 说明 | 类型 | 是否必填 | 鸿蒙支持 | +| Name | Description | Type | Required | HarmonyOS Support | | ---- | ---- | ---- | -------- | -------- | | chain | Creates a lodash wrapper instance that wraps value with explicit method chain sequences enabled | function | NO | yes | -- Gitee