0.3.0 • Published 2 years ago

tdscore v0.3.0

Weekly downloads
393
License
MulanPSL-2.0
Repository
github
Last release
2 years ago

警告: 此库仍在开发中,请勿用于生产环境

npm.io

😊 TDSCore

2021年中国大学生计算机设计大赛一等奖作品

中文 | English

npm i tdscore

TypeScript实现的数据结构,算法,数学程式✨

Test Publish npm.io npm.io dependencies Status

NPM version npm.io npm.io

npm.io

介绍

TDSCore目前主要有两个设计用途:科研与应用。一方面,TDSCore中包含大量注释,并力求设计的易理解,以供所有人研习源码。另一方面,项目单元测试覆盖率超过80%,确保在常见与极端情况下的代码健壮性,可用性。

特点

  • 可读性高:开发的首要目标为研习🌌
  • IXA模块:JavaScript生态中的Linq
  • 到处运行:运行在任何ES6环境
  • 麻雀虽小:min+gzipped 30kB
  • 五脏俱全:数据结构与算法持续添加中
  • QJS支持:tdscore-app-template

已经实现

线性结构非线性结构算法数学迭代
DSArrayHashMaphash(∀)TrigonometricChain
ArrayList图结构定义BFScosappend
LinkedList树结构定义DFSMartix(OOP)contains
BitSpanAVLBSTMartix(Classic)filter
QueueBiTreeNodebubbleSort无限精度(DSNumber)defaultOrFirst
GListHashSetquickSortLinear transformationfilter
StackSetGraphshellSortComplexforEach
CQueueradixSortHamming CodeindexOf
insertionSortColorisEmpty
selectionSortfablast
heapSortreverse
seqSearchselectMany
binarySearchsize
primtoList/Map/Set
kruskalwhere
treeForEachmin/max

设计理念

  • 避免使用undefined
  • 尽可能使用异常而不是null
  • 函数式与面向对象API同步推进
  • 力求API高度抽象与推广
  • 系统自洽

安装

NPM🧡

npm install tdscore --save

浏览器🗺

<srcipt src="//cdn.jsdelivr.net/npm/tdscore/dist/tdscore.min.js"></script>

使用🎉

import { HashMap } from "tdscore"

let hashMap = new HashMap<string,number>();

hashMap.mapPut("a",1);
console.log(hashMap.mapGet("a")); // 1

TDSCore同时支持通过以下方式引入:

  • 浏览器全局变量 window.tdscore
  • CommonJS require("tdscore")

另外,在RunKit上在线试用,您不需要配置任何开发环境。

RunKit for TDSCore

文档 🍕

查看在线文档

加入开发🤝

热烈欢迎任何对数据结构感兴趣的朋友加入开发! 欢迎Pull Request!

克隆并且切换到dev分支

git clone https://github.com/zsh2401/tdscore.git
cd tdscore
git fetch origin dev
git checkout dev

安装依赖

yarn

构建与测试

# 打包为umd单文件模块,输出产物位于dist文件夹
yarn build:dist 

# 编译为es6代码,输出产物位于es文件夹
yarn build:es 

# 编译为ES5代码,输出产物位于lib文件夹
yarn build:lib 

# 同步执行上面全部任务
yarn build

单元测试

yarn test

注意:

  • 请在dev分支上进行开发

贡献者

所有代码贡献者头像会被展示在此:

协议

TDSCore以木兰宽松许可证第二版进行授权。

0.2.11

2 years ago

0.3.0

2 years ago

0.2.8

2 years ago

0.2.7

3 years ago

0.2.5

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.2.2

3 years ago

0.1.31

3 years ago

0.1.32

3 years ago

0.1.34

3 years ago

0.1.30

3 years ago

0.1.28

3 years ago

0.1.27

3 years ago

0.1.26

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.22

3 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.17

3 years ago

0.1.19

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.13

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.6

3 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago