
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
some-javascript-kit
Advanced tools
base64ToBlob.js: those files from online,it change the base64 to blob.
git clone https://github.com/xyydd/some-javascript-kit.git
or
npm i -S some-javascript-kit
<script type="text/javascript" src="./some-javascript-kit/index.js"></script>
import { isType } from './some-javascript-kit/index.js'
// There are several methods in index.js that can be accessed from outside
isType // Judgment type
deecopy // from https://github.com/ConardLi/ConardLi.github.io/blob/master/demo/deepClone/src/clone_6.js
session // Browser local session
storage // Browser local storage
dataURLtoBlob // base64 to Blob
getBase64Image // image to base64
trim// remove spaces before and after sentences
search// search some object from array
unitConversion// Conversion unit.support b-yb and time.
download// to download file use form
getRandomStr// get random character, you can set the character length
This method now supports judging array, string, object, number
const arr = []
isType(arr, 'array') // true
const obj = []
isType(obj, 'array') // false
let copyData = deecopy(data)
session.save('dataName', data)
session.fetch('dataName')
session.clear('dataName')
storage.save('dataName', data)
storage.fetch('dataName')
storage.clear('dataName')
const blob = dataURLtoBlob(base64)
const img = new Image()
let base64
img.src = 'http://XXXXXX'
img.onload = function () {
base64 = getBase64Image(img)
}
let str = ' demo '
str = trim(str) // 'demo'
let data = [{
name: 'nathan'
}, {
name: 'eric'
}]
const res = search(data, {name: 'nathan'})
let value = 1024
const unit = 'b'
const conversion = unitConversion(value, unit)
const url = 'http://XXXXX'
download('.json', url)
const _id = getRandomStr(32)
Make the portrait on the canvas always center
const CanvasDraw = require('./CanvasDraw.js')
const canvasDraw = new CanvasDraw(ctx, canvasWidth, canvasHeight)
const img = new Image()
img.src = 'http://....'
img.onload = function () {
canvasDraw.handleDraw(img, imgWidth, imgHeight)
}
Avoid websites being embedded in iframes
Copy the code to the top level of your project
FAQs
base64ToBlob.js: those files from online,it change the base64 to blob.
We found that some-javascript-kit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.