@altronix/webtobin 0.2.0 → 0.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@altronix/webtobin",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "./webtobin.mjs",
package/webtobin.d.ts CHANGED
@@ -2,5 +2,5 @@ export default class {
2
2
  constructor();
3
3
  static from(bin: Uint8Array): this;
4
4
  append(path: string, data: string | Uint8Array): this;
5
- finish(): Uint8Array;
5
+ print(): Uint8Array;
6
6
  }
package/webtobin.mjs CHANGED
@@ -46,11 +46,21 @@ export default class Webtobin {
46
46
  return this;
47
47
  }
48
48
 
49
+ /**
50
+ * Remove a file from the bin
51
+ * @param {string} path the file location to remove
52
+ * @return {Webtobin}
53
+ */
54
+ remove(path) {
55
+ this.items = this.items.filter((a) => !(a.path === path));
56
+ return this;
57
+ }
58
+
49
59
  /**
50
60
  * Sort and build binary
51
61
  * @return {Uint8Array}
52
62
  */
53
- finish() {
63
+ print() {
54
64
  this.items.sort((a, b) => a.path.localeCompare(b.path));
55
65
  let arr;
56
66
  for (const item of this.items) {