🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

universal-base64

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-base64 - npm Package Compare versions

Comparing version

to
2.0.0

4

dist/browser.d.ts

@@ -1,2 +0,2 @@

export declare const atob: (encodedString: string) => string;
export declare const btoa: (rawString: string) => string;
export declare const decode: (encodedString: string) => string;
export declare const encode: (rawString: string) => string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.atob = window.atob;
exports.btoa = window.btoa;
exports.decode = window.atob;
exports.encode = window.btoa;
//# sourceMappingURL=browser.js.map

@@ -6,8 +6,8 @@ "use strict";

it('should base64 encode', () => {
expect(browser_1.btoa('test')).toEqual('dGVzdA==');
expect(browser_1.encode('test')).toEqual('dGVzdA==');
});
it('should base64 decode', () => {
expect(browser_1.atob('dGVzdA==')).toEqual('test');
expect(browser_1.decode('dGVzdA==')).toEqual('test');
});
});
//# sourceMappingURL=browser.spec.js.map

@@ -1,2 +0,2 @@

export declare function atob(str: string): string;
export declare function btoa(str: string): string;
export declare function decode(str: string): string;
export declare function encode(str: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function atob(str) {
function decode(str) {
return Buffer.from(str, 'base64').toString('latin1');
}
exports.atob = atob;
function btoa(str) {
exports.decode = decode;
function encode(str) {
return Buffer.from(str, 'latin1').toString('base64');
}
exports.btoa = btoa;
exports.encode = encode;
//# sourceMappingURL=index.js.map

@@ -6,8 +6,8 @@ "use strict";

it('should base64 encode', () => {
expect(index_1.btoa('test')).toEqual('dGVzdA==');
expect(index_1.encode('test')).toEqual('dGVzdA==');
});
it('should base64 decode', () => {
expect(index_1.atob('dGVzdA==')).toEqual('test');
expect(index_1.decode('dGVzdA==')).toEqual('test');
});
});
//# sourceMappingURL=index.spec.js.map
{
"name": "universal-base64",
"version": "1.0.0",
"version": "2.0.0",
"description": "Small universal base64 functions for node.js and browsers",

@@ -60,12 +60,12 @@ "main": "dist/index.js",

"devDependencies": {
"@types/jest": "^22.2.2",
"@types/jest": "^23.3.3",
"@types/node": "^10.1.2",
"browserify": "^16.1.1",
"jest": "^22.4.3",
"jest": "^23.6.0",
"rimraf": "^2.6.2",
"ts-jest": "^22.4.2",
"ts-jest": "^23.10.4",
"tslint": "^5.9.1",
"tslint-config-standard": "^7.0.0",
"typescript": "^2.8.1"
"tslint-config-standard": "^8.0.1",
"typescript": "^3.1.1"
}
}

@@ -21,6 +21,6 @@ # Universal Base64

```js
import { atob, btoa } from 'universal-base64'
import { decode, encode } from 'universal-base64'
btoa('test') //=> "dGVzdA=="
atob('dGVzdA==') //=> "test"
encode('test') //=> "dGVzdA=="
decode('dGVzdA==') //=> "test"
```

@@ -27,0 +27,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet