@limitless.claver/stringify
Advanced tools
Comparing version 1.2.6 to 1.2.7
## [1.2.7](https://github.com/limitless-kode/stringify/compare/v1.2.6...v1.2.7) (2023-03-27) | ||
## [1.2.6](https://github.com/limitless-kode/stringify/compare/v1.2.5...v1.2.6) (2023-03-27) | ||
@@ -4,0 +6,0 @@ |
@@ -26,22 +26,21 @@ "use strict"; | ||
}); | ||
// describe('toEncryptedString and toDecryptedString', () => { | ||
// test('encrypts and decrypts a string', () => { | ||
// const plaintext = 'my secret message'; | ||
// const encrypted = Stringify.toEncryptedString(plaintext); | ||
// const decrypted = Stringify.toDecryptedString(encrypted); | ||
// expect(decrypted).toEqual(plaintext); | ||
// }); | ||
// | ||
// test('throws an error when passed an invalid encrypted string', () => { | ||
// const encrypted = 'not a valid encrypted string'; | ||
// expect(() => Stringify.toDecryptedString(encrypted)).toThrow(); | ||
// }); | ||
// }); | ||
// describe('toDecryptedJSON', () => { | ||
// test('decrypts an encrypted JSON string to a JSON object', () => { | ||
// const encrypted = Stringify.toEncryptedString({ name: 'John', age: 30, city: 'New York' }); | ||
// const jsonObject = Stringify.toDecryptedJSON(encrypted); | ||
// expect(jsonObject).toEqual({ name: 'John', age: 30, city: 'New York' }); | ||
// }); | ||
// }); | ||
describe('toEncryptedString and toDecryptedString', () => { | ||
test('encrypts and decrypts a string', () => { | ||
const plaintext = 'my secret message'; | ||
const encrypted = stringify_1.default.toEncryptedString(plaintext); | ||
const decrypted = stringify_1.default.toDecryptedString(encrypted); | ||
expect(decrypted).toEqual(plaintext); | ||
}); | ||
test('throws an error when passed an invalid encrypted string', () => { | ||
const encrypted = 'not a valid encrypted string'; | ||
expect(() => stringify_1.default.toDecryptedString(encrypted)).toThrow(); | ||
}); | ||
}); | ||
describe('toDecryptedJSON', () => { | ||
test('decrypts an encrypted JSON string to a JSON object', () => { | ||
const encrypted = stringify_1.default.toEncryptedString({ name: 'John', age: 30, city: 'New York' }); | ||
const jsonObject = stringify_1.default.toDecryptedJSON(encrypted); | ||
expect(jsonObject).toEqual({ name: 'John', age: 30, city: 'New York' }); | ||
}); | ||
}); | ||
describe('toCamelCase', () => { | ||
@@ -48,0 +47,0 @@ test('converts a string to camel case', () => { |
@@ -7,3 +7,3 @@ { | ||
}, | ||
"version": "1.2.6", | ||
"version": "1.2.7", | ||
"description": "String helper method for all string and JSON manipulations", | ||
@@ -39,3 +39,3 @@ "main": "./dist/index.js", | ||
"@types/jsdom": "^21.1.1", | ||
"@types/node": "^18.15.8", | ||
"@types/node": "^18.15.10", | ||
"@types/xmldom": "^0.1.31", | ||
@@ -42,0 +42,0 @@ "husky": "^8.0.3", |
@@ -25,24 +25,24 @@ import Stringify from '../stringify'; | ||
// describe('toEncryptedString and toDecryptedString', () => { | ||
// test('encrypts and decrypts a string', () => { | ||
// const plaintext = 'my secret message'; | ||
// const encrypted = Stringify.toEncryptedString(plaintext); | ||
// const decrypted = Stringify.toDecryptedString(encrypted); | ||
// expect(decrypted).toEqual(plaintext); | ||
// }); | ||
// | ||
// test('throws an error when passed an invalid encrypted string', () => { | ||
// const encrypted = 'not a valid encrypted string'; | ||
// expect(() => Stringify.toDecryptedString(encrypted)).toThrow(); | ||
// }); | ||
// }); | ||
describe('toEncryptedString and toDecryptedString', () => { | ||
test('encrypts and decrypts a string', () => { | ||
const plaintext = 'my secret message'; | ||
const encrypted = Stringify.toEncryptedString(plaintext); | ||
const decrypted = Stringify.toDecryptedString(encrypted); | ||
expect(decrypted).toEqual(plaintext); | ||
}); | ||
// describe('toDecryptedJSON', () => { | ||
// test('decrypts an encrypted JSON string to a JSON object', () => { | ||
// const encrypted = Stringify.toEncryptedString({ name: 'John', age: 30, city: 'New York' }); | ||
// const jsonObject = Stringify.toDecryptedJSON(encrypted); | ||
// expect(jsonObject).toEqual({ name: 'John', age: 30, city: 'New York' }); | ||
// }); | ||
// }); | ||
test('throws an error when passed an invalid encrypted string', () => { | ||
const encrypted = 'not a valid encrypted string'; | ||
expect(() => Stringify.toDecryptedString(encrypted)).toThrow(); | ||
}); | ||
}); | ||
describe('toDecryptedJSON', () => { | ||
test('decrypts an encrypted JSON string to a JSON object', () => { | ||
const encrypted = Stringify.toEncryptedString({ name: 'John', age: 30, city: 'New York' }); | ||
const jsonObject = Stringify.toDecryptedJSON(encrypted); | ||
expect(jsonObject).toEqual({ name: 'John', age: 30, city: 'New York' }); | ||
}); | ||
}); | ||
describe('toCamelCase', () => { | ||
@@ -49,0 +49,0 @@ test('converts a string to camel case', () => { |
@@ -15,6 +15,2 @@ import Ncrypt from './ncrypt'; | ||
constructor(key?: string) { | ||
if (process.env.NODE_ENV === 'test') { | ||
key = '6bef904c684547d18f15a47e09efdbc3'; | ||
} | ||
super(process.env.ENCRYPTION_KEY || (key as string)); | ||
@@ -21,0 +17,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112211
2013