Skip to content

Commit 06beadb

Browse files
authored
Merge pull request #4 from JOU-amjs/feature-1.0.x
refactor: change name sdm to sdm2
2 parents b59163b + d4a416f commit 06beadb

File tree

8 files changed

+53
-51
lines changed

8 files changed

+53
-51
lines changed

.github/ISSUE_TEMPLATE/BUG_REPORT_en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
- type: input
1515
id: version
1616
attributes:
17-
label: sdm Version
17+
label: sdm2 Version
1818
description: Please fill in the version actually installed in node_modules/@alova/adapter-uniapp/package.json
1919
placeholder: E.g. 1.4.0
2020
validations:

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 sdmjs
3+
Copyright (c) 2023 sdm2js
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# [sdm](https://github.com/JOU-amjs/msd)
1+
# [sdm2](https://github.com/JOU-amjs/msd)
22

3-
[![npm](https://img.shields.io/npm/v/sdm)](https://www.npmjs.com/package/sdm)
4-
![size](https://img.shields.io/bundlephobia/min/sdm)
5-
[![Coverage Status](https://coveralls.io/repos/github/JOU-amjs/sdm/badge.svg)](https://coveralls.io/github/JOU-amjs/sdm)
3+
[![npm](https://img.shields.io/npm/v/sdm2)](https://www.npmjs.com/package/sdm2)
4+
![size](https://img.shields.io/bundlephobia/min/sdm2)
5+
[![Coverage Status](https://coveralls.io/repos/github/JOU-amjs/sdm2/badge.svg)](https://coveralls.io/github/JOU-amjs/sdm2)
66
![typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label)
77
![license](https://img.shields.io/badge/license-MIT-blue.svg)
88

@@ -20,26 +20,26 @@
2020

2121
```bash
2222
# via npm
23-
npm install sdm
23+
npm install sdm2
2424

2525
#via yarn
26-
yarn add sdm
26+
yarn add sdm2
2727
```
2828

2929
Introduced in `Node.js`, `esModule`, `Browser`
3030

3131
```javascript
3232
// commonjs(Node.js)
33-
var { match, filterMap } = require('sdm').default;
33+
var { match, filterMap } = require('sdm2').default;
3434

3535
// esModule
36-
import { match, filterMap } from 'sdm';
36+
import { match, filterMap } from 'sdm2';
3737
```
3838

3939
Browser
4040

4141
```html
42-
<script src="https://unpkg.com/sdm"></script>
42+
<script src="https://unpkg.com/sdm2"></script>
4343
```
4444

4545
## **Usage**
@@ -97,7 +97,7 @@ const ret = match({ name: 'src/views/home.jsx' }, 'shojsx', {
9797
When we search for key characters, we always want to highlight the matching key characters, so we also provide a helper function to help you do it.
9898
9999
```javascript
100-
import { match } from 'sdm';
100+
import { match } from 'sdm2';
101101
const ret = match('src/views/home.jsx', 'shojsx', {
102102
onMatched: (matchedStr, originStr) => `<span class="highlight">${matchedStr}</span>`
103103
});
@@ -115,7 +115,7 @@ const ret = match('src/views/home.jsx', 'shojsx', {
115115
If it is an array of strings, we can use `filterMap` to filter and convert strings at the same time.
116116
117117
```javascript
118-
import { filterMap } from 'sdm';
118+
import { filterMap } from 'sdm2';
119119

120120
const matchedStrings = ['src/views/home.jsx', 'src/views/about.jsx', 'src/views/ad.jsx'];
121121
const ret = filterMap(matchedStrings, 'shojsx', (matchedInfo, index) => matchedInfo.str, {
@@ -143,7 +143,7 @@ The key string is a 50-digit random string
143143
144144
## **SUBMIT A QUESTION**
145145
146-
- [Click here to submit](https://github.com/JOU-amjs/sdm/issues)
146+
- [Click here to submit](https://github.com/JOU-amjs/sdm2/issues)
147147
148148
## LICENSE MIT
149149

README.zh-CN.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# [sdm](https://github.com/JOU-amjs/msd)
1+
# [sdm2](https://github.com/JOU-amjs/msd)
22

3-
[![npm](https://img.shields.io/npm/v/sdm)](https://www.npmjs.com/package/sdm)
4-
![size](https://img.shields.io/bundlephobia/min/sdm)
5-
[![Coverage Status](https://coveralls.io/repos/github/JOU-amjs/sdm/badge.svg)](https://coveralls.io/github/JOU-amjs/sdm)
3+
[![npm](https://img.shields.io/npm/v/sdm2)](https://www.npmjs.com/package/sdm2)
4+
![size](https://img.shields.io/bundlephobia/min/sdm2)
5+
[![Coverage Status](https://coveralls.io/repos/github/JOU-amjs/sdm2/badge.svg)](https://coveralls.io/github/JOU-amjs/sdm2)
66
![typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label)
77
![license](https://img.shields.io/badge/license-MIT-blue.svg)
88

@@ -20,26 +20,26 @@
2020

2121
```bash
2222
# via npm
23-
npm install sdm
23+
npm install sdm2
2424

2525
# via yarn
26-
yarn add sdm
26+
yarn add sdm2
2727
```
2828

2929
`Node.js`, `esModule`, `Browser`引入
3030

3131
```javascript
3232
// commonjs(Node.js)
33-
var { match, filterMap } = require('sdm').default;
33+
var { match, filterMap } = require('sdm2').default;
3434

3535
// esModule
36-
import { match, filterMap } from 'sdm';
36+
import { match, filterMap } from 'sdm2';
3737
```
3838

3939
Browser
4040

4141
```html
42-
<script src="https://unpkg.com/sdm"></script>
42+
<script src="https://unpkg.com/sdm2"></script>
4343
```
4444

4545
## **用法**
@@ -97,7 +97,7 @@ const ret = match({ name: 'src/views/home.jsx' }, 'shojsx', {
9797
我们在搜索关键字符时,总是希望高亮匹配到的关键字符,因此我们还提供了一个辅助函数帮助你完成它。
9898
9999
```javascript
100-
import { match } from 'sdm';
100+
import { match } from 'sdm2';
101101
const ret = match('src/views/home.jsx', 'shojsx', {
102102
onMatched: (matchedStr, originStr) => `<span class="highlight">${matchedStr}</span>`
103103
});
@@ -115,7 +115,7 @@ const ret = match('src/views/home.jsx', 'shojsx', {
115115
如果对于字符串数组,我们可以使用`filterMap`同时进行过滤和转换字符串。
116116
117117
```javascript
118-
import { filterMap } from 'sdm';
118+
import { filterMap } from 'sdm2';
119119

120120
const matchedStrings = ['src/views/home.jsx', 'src/views/about.jsx', 'src/views/ad.jsx'];
121121
const ret = filterMap(matchedStrings, 'shojsx', (matchedInfo, index) => matchedInfo.str, {
@@ -147,4 +147,4 @@ Copyright (c) 2021 JOU. Copyright of the Typescript bindings are respective of e
147147
148148
### **提交一个问题**
149149
150-
- [点此提交](https://github.com/JOU-amjs/sdm/issues)
150+
- [点此提交](https://github.com/JOU-amjs/sdm2/issues)

SECURITY.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Security report
22

3-
Your reviews and reports on the security of `sdm` are very welcome.
3+
Your reviews and reports on the security of `sdm2` are very welcome.
44

5-
- Find existing security reports: Search existing security reports in [Github security channel](https://github.com/JOU-amjs/sdm/discussions/categories/security) to avoid duplicating work.
6-
- Reporting Security Issues: If you find a vulnerability, please report it in [Github security channel](https://github.com/JOU-amjs/sdm/discussions/categories/security). Our team of maintainers will respond and resolve it as quickly as possible.
5+
- Find existing security reports: Search existing security reports in [Github security channel](https://github.com/JOU-amjs/sdm2/discussions/categories/security) to avoid duplicating work.
6+
- Reporting Security Issues: If you find a vulnerability, please report it in [Github security channel](https://github.com/JOU-amjs/sdm2/discussions/categories/security). Our team of maintainers will respond and resolve it as quickly as possible.
77

88
- Avoid Disclosing Sensitive Information: When reporting a security issue, make sure not to disclose any sensitive information in public, such as passwords, API keys, or personally identifiable information.
99
Test environment: When testing, make sure you don't have any impact on the production environment.
1010

1111
- Respect and Preserve the Community: Our community is built on mutual respect and cooperation. Please ensure that your actions comply with the community guidelines and ethical standards.
1212

13-
We greatly appreciate your interest and contributions to the security of `sdm`. Your help will help us create a safer and healthier open source ecosystem.
13+
We greatly appreciate your interest and contributions to the security of `sdm2`. Your help will help us create a safer and healthier open source ecosystem.

commitlint.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional']
2+
extends: ['@commitlint/config-conventional']
33
};

config/rollup.cjs

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*/
66
var typescript = require('rollup-plugin-typescript2');
77
const getCompiler = (
8-
opt = {
9-
// objectHashIgnoreUnknownHack: true,
10-
// clean: true,
11-
tsconfigOverride: {
12-
compilerOptions: {
13-
module: 'ES2015'
14-
}
15-
}
16-
}
8+
opt = {
9+
// objectHashIgnoreUnknownHack: true,
10+
// clean: true,
11+
tsconfigOverride: {
12+
compilerOptions: {
13+
module: 'ES2015'
14+
}
15+
}
16+
}
1717
) => typescript(opt);
1818
exports.getCompiler = getCompiler;
1919

@@ -29,8 +29,8 @@ exports.banner = `/**
2929
`;
3030

3131
const compilePath = (exports.compilePath = {
32-
packageName: 'sdm',
33-
input: 'src/index.ts',
34-
output: suffix => `dist/sdm.${suffix}.js`
32+
packageName: 'sdm2',
33+
input: 'src/index.ts',
34+
output: suffix => `dist/sdm2.${suffix}.js`
3535
});
3636
exports.external = compilePath.external || [];

package.json

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "sdm",
2+
"name": "sdm2",
33
"version": "1.0.0",
44
"description": "A high performance librray to match discontinuous strings",
5-
"main": "dist/sdm.js",
5+
"main": "dist/sdm2.js",
66
"types": "typings/index.d.ts",
7-
"module": "dist/sdm.esm.js",
8-
"unpkg": "dist/sdm.umd.js",
9-
"jsdelivr": "dist/sdm.umd.js",
7+
"module": "dist/sdm2.esm.js",
8+
"unpkg": "dist/sdm2.umd.js",
9+
"jsdelivr": "dist/sdm2.umd.js",
1010
"type": "module",
1111
"scripts": {
1212
"clean": "rimraf ./dist",
@@ -21,17 +21,18 @@
2121
"build": "npm run clean && npm run build:esm && npm run build:umd && npm run build:umd.min",
2222
"coveralls": "npm run test:coverage && coveralls < coverage/lcov.info",
2323
"generate": "node generate-test-data.js 1000",
24+
"aa": "cross-env VERSION=1.1.2 npm run build",
2425
"commit": "git-cz && git push"
2526
},
2627
"author": "JOU-amjs",
2728
"license": "MIT",
28-
"homepage": "https://github.com/JOU-amjs/sdm#readme",
29+
"homepage": "https://github.com/JOU-amjs/sdm2#readme",
2930
"repository": {
3031
"type": "git",
31-
"url": "git://github.com/JOU-amjs/sdm.git"
32+
"url": "git://github.com/JOU-amjs/sdm2.git"
3233
},
3334
"bugs": {
34-
"url": "https://github.com/JOU-amjs/sdm/issues"
35+
"url": "https://github.com/JOU-amjs/sdm2/issues"
3536
},
3637
"files": [
3738
"/dist",
@@ -42,6 +43,7 @@
4243
"match",
4344
"strings search",
4445
"string match",
46+
"string discontinuous match",
4547
"discontinuous match",
4648
"search",
4749
"discontinuous search"

0 commit comments

Comments
 (0)