Socket
Socket
Sign inDemoInstall

js-encoding-utils

Package Overview
Dependencies
0
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.5.6 to 0.6.0

dist/jseu.bundle.js

10

dist/encoder.d.ts
/**
* encoder.js
*/
/// <reference types="node" />
import TypedArray = NodeJS.TypedArray;
/**

@@ -9,3 +11,3 @@ * Encode ArrayBuffer or TypedArray To Base64

*/
export declare const encodeBase64: (data: string | ArrayBuffer | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array) => string;
export declare const encodeBase64: (data: string | ArrayBuffer | TypedArray) => string;
/**

@@ -16,3 +18,3 @@ * Decode Base64 to Uint8Array

*/
export declare const decodeBase64: (str: string) => string | Uint8Array;
export declare const decodeBase64: (str: string) => Uint8Array | string;
/**

@@ -35,3 +37,3 @@ * Encode ArrayBuffer or TypedArray to base64url string

*/
export declare const arrayBufferToHexString: (data: ArrayBuffer | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array) => string;
export declare const arrayBufferToHexString: (data: ArrayBuffer | TypedArray) => string;
/**

@@ -48,3 +50,3 @@ * Decode hex string to Uint8Array

*/
export declare const arrayBufferToString: (data: ArrayBuffer | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array) => string;
export declare const arrayBufferToString: (data: ArrayBuffer | TypedArray) => string;
/**

@@ -51,0 +53,0 @@ * Decode string with code (like output of legacy atob) to Uint8Array

17

dist/encoder.js

@@ -5,10 +5,23 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.stringToArrayBuffer = exports.arrayBufferToString = exports.hexStringToArrayBuffer = exports.arrayBufferToHexString = exports.decodeBase64Url = exports.encodeBase64Url = exports.decodeBase64 = exports.encodeBase64 = void 0;
var env = __importStar(require("./env"));

@@ -15,0 +28,0 @@ /**

@@ -5,3 +5,3 @@ /**

*/
export declare const getEnvBtoa: () => ((rawString: string) => string) & typeof btoa;
export declare const getEnvAtob: () => ((encodedString: string) => string) & typeof atob;
export declare const getEnvBtoa: () => (str: string) => string;
export declare const getEnvAtob: () => (str: string) => string;

@@ -7,2 +7,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getEnvAtob = exports.getEnvBtoa = void 0;
exports.getEnvBtoa = function () {

@@ -9,0 +10,0 @@ if (typeof window !== 'undefined')

/**
* formatter.js
*/
/// <reference types="node" />
import TypedArray = NodeJS.TypedArray;
declare type SupportedPemTypes = 'public' | 'private' | 'encryptedPrivate' | 'certificate' | 'certRequest';

@@ -10,3 +12,3 @@ /**

*/
export declare const pemToBin: (keydataB64Pem: string) => string | Uint8Array;
export declare const pemToBin: (keydataB64Pem: string) => Uint8Array | string;
/**

@@ -18,3 +20,3 @@ * Convert ArrayBuffer or TypedArray to PEM armored string with a specified type

*/
export declare const binToPem: (keydata: ArrayBuffer | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array, type: SupportedPemTypes) => string;
export declare const binToPem: (keydata: ArrayBuffer | TypedArray, type: SupportedPemTypes) => string;
export {};

@@ -5,10 +5,23 @@ "use strict";

*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.binToPem = exports.pemToBin = void 0;
var encoder = __importStar(require("./encoder"));

@@ -15,0 +28,0 @@ var PemArmorString = {

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatter = exports.encoder = void 0;
/**

@@ -11,0 +24,0 @@ * index.ts

{
"name": "js-encoding-utils",
"version": "0.5.6",
"version": "0.6.0",
"description": "Miscellaneous Encoding Utilities for Crypto-related Objects in JavaScript",

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

"release:push": "git push --all && git push origin v$npm_package_version",
"test": "nyc mocha --recursive $(find test -name '*.spec.ts')",
"test:bundle": "yarn webpack && cross-env TEST_ENV=bundle yarn test",
"karma": "cross-env TEST_ENV=source ./node_modules/.bin/karma start",
"karma:bundle": "yarn webpack && cross-env TEST_ENV=bundle karma start",
"test": "yarn jest:node",
"jest:node": "jest -c ./jest.config.node.js",
"jest:web": "jest -c ./jest.config.web.js",
"karma": "karma start",
"karma:window": "yarn webpack && cross-env TEST_ENV=window karma start",
"tsc": "tsc --build ./tsconfig.json",
"html": "yarn webpack && yarn html:source && yarn html:bundle && yarn html:window",
"html:source": "cross-env TEST_ENV=source NODE_ENV=html yarn webpack",
"html:bundle": "cross-env TEST_ENV=bundle NODE_ENV=html yarn webpack",
"html:window": "cross-env TEST_ENV=window NODE_ENV=html yarn webpack",
"webpack": "webpack --mode development --config webpack.dev.js",
"webpack:prod": "cross-env NODE_ENV=production webpack --optimize-minimize --mode production --config webpack.prod.js",
"build": "rm -rf ./dist && cross-env NODE_ENV=production yarn tsc && yarn webpack:prod",
"analyze": "cross-env NODE_ENV=production webpack --mode production --optimize-minimize --json --config webpack.prod.js | webpack-bundle-size-analyzer",
"cleanup": "rm -rf ./dist coverage .nyc_output ./node_modules ./test/html/*.bundle.js ./test/html/test.html"
"webpack": "webpack --mode development --config webpack.config.js",
"webpack:prod": "webpack --mode production --config webpack.config.js",
"build": "rm -rf ./dist && yarn tsc && yarn webpack:prod",
"cleanup": "rm -rf ./dist coverage ./node_modules"
},

@@ -46,33 +41,22 @@ "author": "Jun Kurihara",

"devDependencies": {
"@types/chai": "4.2.5",
"@types/mocha": "5.2.7",
"@types/node": "10.17.5",
"@typescript-eslint/eslint-plugin": "2.8.0",
"@typescript-eslint/parser": "2.8.0",
"@types/jest": "26.0.14",
"@types/node": "14.11.8",
"@typescript-eslint/eslint-plugin": "4.4.1",
"@typescript-eslint/parser": "4.4.1",
"can-npm-publish": "1.3.2",
"chai": "4.2.0",
"cross-env": "6.0.3",
"eslint": "6.6.0",
"istanbul-instrumenter-loader": "3.0.1",
"jsdom": "15.2.1",
"karma": "4.4.1",
"cross-env": "7.0.2",
"eslint": "7.11.0",
"jasmine-core": "3.6.0",
"jest": "26.5.3",
"karma": "5.2.3",
"karma-chrome-launcher": "3.1.0",
"karma-cli": "2.0.0",
"karma-coverage-istanbul-reporter": "2.1.0",
"karma-mocha": "1.3.0",
"karma-mocha-reporter": "2.2.5",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "4.0.2",
"mocha": "6.2.2",
"mocha-sinon": "2.1.0",
"nyc": "14.1.1",
"ts-loader": "6.2.1",
"ts-node": "8.5.2",
"tsc": "1.20150623.0",
"typescript": "3.7.2",
"webpack": "4.41.2",
"webpack-cli": "3.3.10",
"webpack-common-shake": "2.1.0",
"webpack-merge": "4.2.2"
}
"karma-jasmine": "4.0.1",
"karma-typescript": "5.2.0",
"ts-jest": "26.4.1",
"ts-loader": "8.0.5",
"typescript": "4.0.3",
"webpack": "5.1.2",
"webpack-cli": "4.0.0"
},
"dependencies": {}
}

@@ -57,3 +57,3 @@ {

"node",
"mocha"
"jest"
], /* Type declaration files to be included in compilation. */

@@ -60,0 +60,0 @@ // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc