libbase64 1.2.0 → 1.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.
@@ -0,0 +1,4 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [andris9] # enable once enrolled
4
+ custom: ['https://www.paypal.me/nodemailer']
@@ -0,0 +1,37 @@
1
+ on:
2
+ push:
3
+ branches:
4
+ - master
5
+
6
+ permissions:
7
+ contents: write
8
+ pull-requests: write
9
+ id-token: write
10
+
11
+ name: release
12
+ jobs:
13
+ release-please:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: google-github-actions/release-please-action@v3
17
+ id: release
18
+ with:
19
+ release-type: node
20
+ package-name: ${{vars.NPM_MODULE_NAME}}
21
+ pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
22
+ # The logic below handles the npm publication:
23
+ - uses: actions/checkout@v4
24
+ # these if statements ensure that a publication only occurs when
25
+ # a new release is created:
26
+ if: ${{ steps.release.outputs.release_created }}
27
+ - uses: actions/setup-node@v4
28
+ with:
29
+ node-version: 20
30
+ registry-url: 'https://registry.npmjs.org'
31
+ if: ${{ steps.release.outputs.release_created }}
32
+ - run: npm ci
33
+ if: ${{ steps.release.outputs.release_created }}
34
+ - run: npm publish --provenance --access public
35
+ env:
36
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
37
+ if: ${{ steps.release.outputs.release_created }}
@@ -0,0 +1,21 @@
1
+ name: Run tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ strategy:
10
+ matrix:
11
+ node: [16.x, 18.x, 20.x, 21.x]
12
+ os: [ubuntu-latest]
13
+ runs-on: ${{ matrix.os }}
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Use Node.js ${{ matrix.node }}
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: ${{ matrix.node }}
20
+ - run: npm install
21
+ - run: npm test
package/.ncurc.js ADDED
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ upgrade: true,
3
+ reject: [
4
+ // 5x is esm only
5
+ 'chai'
6
+ ]
7
+ };
package/.prettierrc.js CHANGED
@@ -1,5 +1,8 @@
1
1
  module.exports = {
2
2
  printWidth: 160,
3
3
  tabWidth: 4,
4
- singleQuote: true
4
+ singleQuote: true,
5
+ endOfLine: 'lf',
6
+ trailingComma: 'none',
7
+ arrowParens: 'avoid'
5
8
  };
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## [1.3.0](https://github.com/nodemailer/libbase64/compare/v1.2.1...v1.3.0) (2024-02-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **deploy:** Added autodeploy system ([f53cb2e](https://github.com/nodemailer/libbase64/commit/f53cb2e8ea3c4900288a96284914da2c35bffe9f))
package/lib/libbase64.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const stream = require('stream');
3
+ const { Buffer } = require('node:buffer');
4
+ const stream = require('node:stream');
4
5
  const Transform = stream.Transform;
5
6
 
6
7
  /**
@@ -113,15 +114,11 @@ class Encoder extends Transform {
113
114
  this.push(chunk);
114
115
  }
115
116
 
116
- _getWrapped(str) {
117
- let prefix = '';
118
-
117
+ _getWrapped(str, isFinal) {
119
118
  str = wrap(str, this.options.lineLength);
120
-
121
- if (prefix) {
122
- str = prefix + str;
119
+ if (!isFinal && str.length === this.options.lineLength) {
120
+ str += '\r\n';
123
121
  }
124
-
125
122
  return str;
126
123
  }
127
124
 
@@ -179,7 +176,7 @@ class Encoder extends Transform {
179
176
  }
180
177
 
181
178
  if (this._curLine) {
182
- this._curLine = this._getWrapped(this._curLine);
179
+ this._curLine = this._getWrapped(this._curLine, true);
183
180
  this._writeChunk(Buffer.from(this._curLine, 'ascii'), true);
184
181
  this._curLine = '';
185
182
  }
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "libbase64",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Encode and decode base64 encoded strings",
5
5
  "main": "lib/libbase64.js",
6
6
  "scripts": {
7
- "test": "grunt"
7
+ "test": "grunt",
8
+ "update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
8
9
  },
9
10
  "repository": {
10
11
  "type": "git",
@@ -21,14 +22,14 @@
21
22
  },
22
23
  "homepage": "https://github.com/nodemailer/libbase64",
23
24
  "devDependencies": {
24
- "chai": "4.2.0",
25
+ "chai": "4.4.1",
25
26
  "eslint-config-nodemailer": "1.2.0",
26
- "eslint-config-prettier": "6.0.0",
27
- "grunt": "1.0.4",
28
- "grunt-cli": "1.3.2",
29
- "grunt-eslint": "22.0.0",
27
+ "eslint-config-prettier": "9.1.0",
28
+ "grunt": "1.6.1",
29
+ "grunt-cli": "1.4.3",
30
+ "grunt-eslint": "24.3.0",
30
31
  "grunt-mocha-test": "0.13.3",
31
- "mocha": "6.2.0"
32
+ "mocha": "10.3.0"
32
33
  },
33
34
  "dependencies": {}
34
35
  }