1loc 中文文档教程

发布于 3年前 浏览 21 项目主页 更新于 3年前

1Loc Lib

Commitizen friendly

机智的 Javascript 单行函数库。 1loc.dev 网站有一组有用的 Javascript 单行代码,现在您可以在 Javascript 项目中使用它们。

One Liners 很棒,但您团队的其他成员会更清楚一点,因此我们为您抽象了它们,作为可读的函数名称,这样您和您的团队成员就可以专注于重要的事情。

TOC

Coverage

File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files99.1275.6898.61100
array.ts10087.51001008,183,214
dom.ts94.4453.8588.8910016-61

Getting Started

安装 1Loc 库

yarn add 1loc

使用 yarnnpm或使用 npm

npm i 1loc --save

Import Any One-liner and use

import { cloneArray } from '1loc'

const myArray = [{ name: 'me', age: 2}]
const arrayClone = cloneArray(myArray) // [{ name: 'me', age: 2}]

More Examples

import { arrayHasSameValues } from '1loc'

const hasSameValues = arrayHasSameValues([1, 2, 4], [4, 1, 2])

console.log(hasSameValues) // true

Explore a list of possible One-liners

此处的文档

您还可以在此处访问原始的 1loc 网站。

One Liners

这是函数定义及其作用的集合。

1Loc Lib

Commitizen friendly

A library of witty Javascript one-liner functions. The 1loc.dev website has a collection of useful Javascript one-liners, now you get to use them in your Javascript projects.

One Liners are great, but the rest of your team would appreciate a little more clarity, So we've abstracted them for you, as readeable function names, so you and your teammates can focus on important stuff.

TOC

Coverage

File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files99.1275.6898.61100
array.ts10087.51001008,183,214
dom.ts94.4453.8588.8910016-61

Getting Started

Install the 1Loc library using yarn or npm

yarn add 1loc

or using npm

npm i 1loc --save

Import Any One-liner and use

import { cloneArray } from '1loc'

const myArray = [{ name: 'me', age: 2}]
const arrayClone = cloneArray(myArray) // [{ name: 'me', age: 2}]

More Examples

import { arrayHasSameValues } from '1loc'

const hasSameValues = arrayHasSameValues([1, 2, 4], [4, 1, 2])

console.log(hasSameValues) // true

Explore a list of possible One-liners

Documentation Here

You can also visit the original 1loc website here.

One Liners

Here's a collection of function definitions and what they do.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文