@guanghechen/filepart 1.0.0-alpha.2 → 1.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.3](https://github.com/guanghechen/sora/compare/@guanghechen/filepart@1.0.0-alpha.2...@guanghechen/filepart@1.0.0-alpha.3) (2024-01-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * 🐛 partSize could be POSITIVE_INFINITY ([e7bd085](https://github.com/guanghechen/sora/commit/e7bd085968177e312a4c4c12739096626f5e8832))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.0.0-alpha.2](https://github.com/guanghechen/sora/compare/@guanghechen/filepart@1.0.0-alpha.1...@guanghechen/filepart@1.0.0-alpha.2) (2024-01-02)
7
18
 
8
19
  **Note:** Version bump only for package @guanghechen/filepart
package/lib/cjs/index.cjs CHANGED
@@ -15,7 +15,6 @@ function invariant(condition, message) {
15
15
  }
16
16
 
17
17
  function* calcFilePartItemsBySize(fileSize, partSize) {
18
- invariant(partSize >= 1 && Number.isInteger(partSize), 'Part size should be a positive integer!');
19
18
  if (fileSize <= 0) {
20
19
  yield { sid: 1, start: 0, end: 0 };
21
20
  return;
@@ -24,6 +23,7 @@ function* calcFilePartItemsBySize(fileSize, partSize) {
24
23
  yield { sid: 1, start: 0, end: fileSize };
25
24
  return;
26
25
  }
26
+ invariant(partSize >= 1 && Number.isInteger(partSize), 'Part size should be a positive integer!');
27
27
  const partTotal = Math.ceil(fileSize / partSize);
28
28
  invariant(partTotal > 0, 'Part size is too small!');
29
29
  for (let i = 0; i < partTotal; ++i) {
package/lib/esm/index.mjs CHANGED
@@ -14,7 +14,6 @@ function invariant(condition, message) {
14
14
  }
15
15
 
16
16
  function* calcFilePartItemsBySize(fileSize, partSize) {
17
- invariant(partSize >= 1 && Number.isInteger(partSize), 'Part size should be a positive integer!');
18
17
  if (fileSize <= 0) {
19
18
  yield { sid: 1, start: 0, end: 0 };
20
19
  return;
@@ -23,6 +22,7 @@ function* calcFilePartItemsBySize(fileSize, partSize) {
23
22
  yield { sid: 1, start: 0, end: fileSize };
24
23
  return;
25
24
  }
25
+ invariant(partSize >= 1 && Number.isInteger(partSize), 'Part size should be a positive integer!');
26
26
  const partTotal = Math.ceil(fileSize / partSize);
27
27
  invariant(partTotal > 0, 'Part size is too small!');
28
28
  for (let i = 0; i < partTotal; ++i) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guanghechen/filepart",
3
- "version": "1.0.0-alpha.2",
3
+ "version": "1.0.0-alpha.3",
4
4
  "description": "File helper",
5
5
  "author": {
6
6
  "name": "guanghechen",
@@ -8,10 +8,10 @@
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",
11
- "url": "https://github.com/guanghechen/sora/tree/@guanghechen/filepart@1.0.0-alpha.1",
11
+ "url": "https://github.com/guanghechen/sora/tree/@guanghechen/filepart@1.0.0-alpha.2",
12
12
  "directory": "packages/filepart"
13
13
  },
14
- "homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/filepart@1.0.0-alpha.1/packages/filepart#readme",
14
+ "homepage": "https://github.com/guanghechen/sora/tree/@guanghechen/filepart@1.0.0-alpha.2/packages/filepart#readme",
15
15
  "keywords": [
16
16
  "file helper",
17
17
  "split file",
@@ -50,5 +50,5 @@
50
50
  "devDependencies": {
51
51
  "@guanghechen/internal": "^1.0.0-alpha.0"
52
52
  },
53
- "gitHead": "0632489b361b9fa783de73b3b31eec8f10227e89"
53
+ "gitHead": "2c2033cf65c38740cfa836a80bbc775b2acd30bd"
54
54
  }