@util.js/strings 0.41.4 → 0.41.5

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/lib/Strings.js CHANGED
@@ -63,7 +63,7 @@ class Strings {
63
63
  z = z + "";
64
64
  if (z.length > 1)
65
65
  throw new Error(
66
- "The padding character must have a length of 1 but was " + z.length
66
+ "The padding character must have a length of 1 but was " + z.length,
67
67
  );
68
68
  n = n + "";
69
69
  return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
package/package.json CHANGED
@@ -34,6 +34,5 @@
34
34
  "type": "git",
35
35
  "url": "https://github.com/creemama/utiljs/tree/master/packages/utiljs-strings"
36
36
  },
37
- "version": "0.41.4",
38
- "gitHead": "2119863a175cf7095ca3a2417e61af32974add15"
37
+ "version": "0.41.5"
39
38
  }
@@ -8,18 +8,20 @@ describe("Strings", () => {
8
8
  it("should operate normally", () => {
9
9
  // From https://www.npmjs.com/package/base64url
10
10
  expect(
11
- strings.base64UrlEncode("ladies and gentlemen we are floating in space")
11
+ strings.base64UrlEncode(
12
+ "ladies and gentlemen we are floating in space",
13
+ ),
12
14
  ).to.equal(
13
- "bGFkaWVzIGFuZCBnZW50bGVtZW4gd2UgYXJlIGZsb2F0aW5nIGluIHNwYWNl"
15
+ "bGFkaWVzIGFuZCBnZW50bGVtZW4gd2UgYXJlIGZsb2F0aW5nIGluIHNwYWNl",
14
16
  );
15
17
  expect(
16
- strings.base64UrlDecode("cmlkZTogZHJlYW1zIGJ1cm4gZG93bg")
18
+ strings.base64UrlDecode("cmlkZTogZHJlYW1zIGJ1cm4gZG93bg"),
17
19
  ).to.equal("ride: dreams burn down");
18
20
  expect(
19
- strings.base64ToBase64Url("qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==")
21
+ strings.base64ToBase64Url("qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA=="),
20
22
  ).to.equal("qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA");
21
23
  expect(
22
- strings.base64UrlToBase64("qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA")
24
+ strings.base64UrlToBase64("qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA"),
23
25
  ).to.equal("qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==");
24
26
  const buf = Buffer.alloc(13);
25
27
  buf.writeUInt8(0x73, 0);
@@ -36,7 +38,7 @@ describe("Strings", () => {
36
38
  buf.writeUInt8(0x65, 11);
37
39
  buf.writeUInt8(0x64, 12);
38
40
  expect(
39
- strings.base64UrlToBuffer("c3Bpcml0dWFsaXplZA").toString()
41
+ strings.base64UrlToBuffer("c3Bpcml0dWFsaXplZA").toString(),
40
42
  ).to.equal(buf.toString());
41
43
  });
42
44
  });
@@ -86,7 +88,7 @@ describe("Strings", () => {
86
88
  expect(
87
89
  strings.isString(() => {
88
90
  return "";
89
- })
91
+ }),
90
92
  ).to.be.false;
91
93
  expect(strings.isString({})).to.be.false;
92
94
  });
@@ -135,7 +137,7 @@ describe("Strings", () => {
135
137
  it("should operate normally", () => {
136
138
  expect(strings.stripTags("frog")).to.equal("frog");
137
139
  expect(
138
- strings.stripTags('<html><>frog</html><span style=""> </span>')
140
+ strings.stripTags('<html><>frog</html><span style=""> </span>'),
139
141
  ).to.equal("<>frog ");
140
142
  });
141
143
  it("should throw an error if any argument is null", () => {