js-encoding-utils
Advanced tools
Comparing version 0.6.6 to 0.7.0
@@ -1,1 +0,1 @@ | ||
!function(r,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.jseu=e():r.jseu=e()}(this,(function(){return(()=>{"use strict";var r={d:(e,n)=>{for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},e={};r.r(e),r.d(e,{default:()=>h,encoder:()=>n,formatter:()=>t});var n,t,o=function(r){if("undefined"==typeof Buffer)throw new Error("UnsupportedEnvironment");return Buffer.from(r.toString(),"binary").toString("base64")},f=function(r){if("undefined"==typeof Buffer)throw new Error("UnsupportedEnvironment");return Buffer.from(r,"base64").toString("binary")},i=function(r){var e;return e="string"==typeof r?r:g(r),("undefined"!=typeof window?window.btoa:o)(e)},u=function(r){var e=("undefined"!=typeof window?window.atob:f)(r),n=y(e);return c(n)},a=function(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)&&void 0!==r.buffer?new Uint8Array(r.buffer):new Uint8Array(r)},c=function(r){for(var e=!0,n=0;n<r.length;n++)if(r[n]>126||r[n]<32&&13!==r[n]&&10!==r[n]){e=!1;break}var t=null;if(e)for(t="",n=0;n<r.length;n++)t+=String.fromCharCode(r[n]);else t=r;return t},d=function(r){return i(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},p=function(r){return r=r.replace(/-/g,"+").replace(/_/g,"/"),u(r)},l=function(r){for(var e=a(r),n="",t=0;t<e.length;t++){var o=(255&e[t]).toString(16);n+=o=1===o.length?"0"+o:o}return n},s=function(r){for(var e=[],n=r.length,t=0;t<n;t+=2)e.push(parseInt(r.substr(t,2),16));return new Uint8Array(e)},g=function(r){var e=a(r),n=new Array(e.length);return e.forEach((function(r,e){n[e]=r})),String.fromCharCode.apply(null,n)},y=function(r){return new Uint8Array(r.length).map((function(e,n){return r.charCodeAt(n)}))},E={public:"PUBLIC KEY",private:"PRIVATE KEY",encryptedPrivate:"ENCRYPTED PRIVATE KEY",certificate:"CERTIFICATE",certRequest:"CERTIFICATE REQUEST"},b=function(r){var e=w(r);return u(e)},v=function(r,e){var n=i(r);return m(n,e)},m=function(r,e){for(var n=E[e],t="-----BEGIN "+n+"-----\n";r.length>0;)t+=r.substring(0,64)+"\n",r=r.substring(64);return t+"-----END "+n+"-----"},w=function(r){var e=RegExp("^-----[s]*BEGIN[^-]*-----$","gm"),n=RegExp("^-----[s]*END[^-]*-----$","gm");try{var t=r.split(e)[1].split(n)[0];return t.replace(/\r?\n/g,"")}catch(r){throw new Error("Invalid format as PEM")}};!function(r){r.encodeBase64=i,r.decodeBase64=u,r.encodeBase64Url=d,r.decodeBase64Url=p,r.arrayBufferToHexString=l,r.hexStringToArrayBuffer=s,r.stringToArrayBuffer=y,r.arrayBufferToString=g}(n||(n={})),function(r){r.binToPem=v,r.pemToBin=b}(t||(t={}));const h={encoder:n,formatter:t};return e})()})); | ||
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.jseu=r():e.jseu=r()}(this,(function(){return(()=>{"use strict";var e={d:(r,t)=>{for(var n in t)e.o(t,n)&&!e.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r={};e.r(r),e.d(r,{default:()=>B,encoder:()=>w,formatter:()=>h});const t=e=>{if("undefined"==typeof Buffer)throw new Error("UnsupportedEnvironment");return Buffer.from(e.toString(),"binary").toString("base64")},n=e=>{if("undefined"==typeof Buffer)throw new Error("UnsupportedEnvironment");return Buffer.from(e,"base64").toString("binary")},o=e=>{let r="";return r="string"==typeof e?e:d(e),("undefined"!=typeof window?window.btoa:t)(r)},f=e=>{const r=("undefined"!=typeof window?window.atob:n)(e),t=p(r);return a(t)},i=e=>e instanceof Uint8Array?e:ArrayBuffer.isView(e)&&void 0!==e.buffer?new Uint8Array(e.buffer):new Uint8Array(e),a=e=>{let r=!0;for(let t=0;t<e.length;t++)if(e[t]>126||e[t]<32&&13!==e[t]&&10!==e[t]){r=!1;break}let t=null;if(r){t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r])}else t=e;return t},u=e=>o(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),l=e=>(e=e.replace(/-/g,"+").replace(/_/g,"/"),f(e)),s=e=>{const r=i(e);let t="";for(let e=0;e<r.length;e++){let n=(255&r[e]).toString(16);n=1===n.length?`0${n}`:n,t+=n}return t},c=e=>{const r=[],t=e.length;for(let n=0;n<t;n+=2)r.push(parseInt(e.substr(n,2),16));return new Uint8Array(r)},d=e=>{const r=i(e),t=new Array(r.length);return r.forEach(((e,r)=>{t[r]=e})),String.fromCharCode.apply(null,t)},p=e=>new Uint8Array(e.length).map(((r,t)=>e.charCodeAt(t))),g={public:"PUBLIC KEY",private:"PRIVATE KEY",encryptedPrivate:"ENCRYPTED PRIVATE KEY",certificate:"CERTIFICATE",certRequest:"CERTIFICATE REQUEST"},y=e=>{const r=m(e);return f(r)},E=(e,r)=>{const t=o(e);return b(t,r)},b=(e,r)=>{const t=g[r];let n=`-----BEGIN ${t}-----\n`;for(;e.length>0;)n+=`${e.substring(0,64)}\n`,e=e.substring(64);return n=`${n}-----END ${t}-----`,n},m=e=>{const r=RegExp("^-----[s]*BEGIN[^-]*-----$","gm"),t=RegExp("^-----[s]*END[^-]*-----$","gm");try{let n=e.split(r)[1].split(t)[0];return n=n.replace(/\r?\n/g,""),n}catch(e){throw new Error("Invalid format as PEM")}};var w,h;!function(e){e.encodeBase64=o,e.decodeBase64=f,e.encodeBase64Url=u,e.decodeBase64Url=l,e.arrayBufferToHexString=s,e.hexStringToArrayBuffer=c,e.stringToArrayBuffer=p,e.arrayBufferToString=d}(w||(w={})),function(e){e.binToPem=E,e.pemToBin=y}(h||(h={}));const B={encoder:w,formatter:h};return r})()})); |
{ | ||
"name": "js-encoding-utils", | ||
"version": "0.6.6", | ||
"version": "0.7.0", | ||
"description": "Miscellaneous Encoding Utilities for Crypto-related Objects in JavaScript", | ||
"main": "dist/index.js", | ||
"main": "dist/src/index.js", | ||
"module": "dist/src/index.js", | ||
"exports": { | ||
".": "./dist/src/index.js" | ||
}, | ||
"scripts": { | ||
@@ -11,12 +15,9 @@ "flow:version": "npm version --no-git-tag-version", | ||
"release:push": "git push --all && git push origin v$npm_package_version", | ||
"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", | ||
"analyze": "cem analyze --litelement", | ||
"build": "rm -rf dist && tsc && yarn webpack:prod && npm run analyze -- --exclude dist", | ||
"test": "nyc mocha \"test/**/*.ts\"", | ||
"test:web": "tsc -p ./tsconfig.wtr.json && wtr --coverage", | ||
"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" | ||
"cleanup": "rm -rf ./dist coverage ./node_modules .nyc_output" | ||
}, | ||
@@ -41,22 +42,43 @@ "author": "Jun Kurihara", | ||
"devDependencies": { | ||
"@types/jest": "27.0.3", | ||
"@types/node": "16.11.9", | ||
"@typescript-eslint/eslint-plugin": "5.4.0", | ||
"@typescript-eslint/parser": "5.4.0", | ||
"can-npm-publish": "1.3.6", | ||
"cross-env": "7.0.3", | ||
"eslint": "8.3.0", | ||
"jasmine-core": "3.10.1", | ||
"jest": "27.3.1", | ||
"karma": "6.3.9", | ||
"karma-chrome-launcher": "3.1.0", | ||
"karma-jasmine": "4.0.1", | ||
"karma-typescript": "5.5.2", | ||
"ts-jest": "27.0.7", | ||
"@custom-elements-manifest/analyzer": "0.5.7", | ||
"@open-wc/testing": "next", | ||
"@types/chai": "4.2.22", | ||
"@types/mocha": "9.0.0", | ||
"@typescript-eslint/eslint-plugin": "5.6.0", | ||
"@typescript-eslint/parser": "5.6.0", | ||
"@web/test-runner": "next", | ||
"chai": "4.3.4", | ||
"eslint": "8.4.1", | ||
"mocha": "9.1.3", | ||
"nyc": "15.1.0", | ||
"ts-loader": "9.2.6", | ||
"typescript": "4.4.4", | ||
"webpack": "5.64.2", | ||
"webpack-cli": "4.9.1" | ||
"ts-node": "10.4.0", | ||
"typescript": "4.5.2", | ||
"webpack": "5.65.0", | ||
"webpack-cli": "4.9.1", | ||
"can-npm-publish": "1.3.6" | ||
}, | ||
"dependencies": {} | ||
"dependencies": {}, | ||
"nyc": { | ||
"include": [ | ||
"src/**/*.ts" | ||
], | ||
"exclude": [ | ||
"test/**/*.*" | ||
], | ||
"extension": [ | ||
".ts" | ||
], | ||
"require": [ | ||
"ts-node/register" | ||
], | ||
"reporter": [ | ||
"text", | ||
"lcov", | ||
"html" | ||
], | ||
"sourceMap": true, | ||
"report-dir": "coverage/nyc" | ||
}, | ||
"customElements": "custom-elements.json" | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
40668
17
16
1011
1