mirror of
https://github.com/qntm/base65536
synced 2025-10-06 11:54:42 +02:00
Compare commits
No commits in common. "586b1310179d9bc7ab0cce9a25e8b98273934b26" and "ebd1b5e70693deffb8c448c723ec393ee919b3cd" have entirely different histories.
586b131017
...
ebd1b5e706
2
.github/workflows/workflow-1.yml
vendored
2
.github/workflows/workflow-1.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: ['20.x', '22.x', '24.x']
|
node-version: ['20.x', '22.x']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: 'actions/checkout@v2'
|
- uses: 'actions/checkout@v2'
|
||||||
|
11
cypress.config.js
Normal file
11
cypress.config.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from 'cypress'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
fixturesFolder: false,
|
||||||
|
screenshotOnRunFailure: false,
|
||||||
|
video: false,
|
||||||
|
e2e: {
|
||||||
|
setupNodeEvents (on, config) {},
|
||||||
|
supportFile: false
|
||||||
|
}
|
||||||
|
})
|
8
cypress/e2e/index.cy.js
Normal file
8
cypress/e2e/index.cy.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/* global describe, it, cy */
|
||||||
|
|
||||||
|
describe('base65536 in the browser', () => {
|
||||||
|
it('works', () => {
|
||||||
|
cy.visit('http://localhost:3000/server/index.html')
|
||||||
|
cy.contains('what the heck is up')
|
||||||
|
})
|
||||||
|
})
|
4065
package-lock.json
generated
4065
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,11 +11,12 @@
|
|||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"types": "typings/index.d.ts",
|
"types": "typings/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"cypress": "start-server-and-test \"node server/server.js\" http://localhost:3000/server/index.html \"cypress run\"",
|
||||||
"mocha": "c8 --100 mocha",
|
"mocha": "c8 --100 mocha",
|
||||||
"standard": "standard",
|
"standard": "standard",
|
||||||
"tag": "node -e \"require('child_process').spawn('git', ['tag', `v${require('./package.json').version}`], { stdio: 'inherit' })\"",
|
"tag": "node -e \"require('child_process').spawn('git', ['tag', `v${require('./package.json').version}`], { stdio: 'inherit' })\"",
|
||||||
"tag-and-publish": "npm run tag && git push --tags && npm publish && npm version patch --no-git-tag-version && git add . && git commit -m \"Bump patch\" && git push",
|
"tag-and-publish": "npm run tag && git push --tags && npm publish && npm version patch --no-git-tag-version && git add . && git commit -m \"Bump patch\" && git push",
|
||||||
"test": "npm run standard && npm run mocha"
|
"test": "npm run standard && npm run mocha && npm run cypress"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"base64",
|
"base64",
|
||||||
@ -30,10 +31,13 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"base65536-test": "^1.1.2",
|
"base65536-test": "^1.1.2",
|
||||||
"c8": "^10.1.2",
|
"c8": "^10.1.2",
|
||||||
|
"cypress": "^14.1.0",
|
||||||
|
"express": "^4.17.1",
|
||||||
"glob": "^11.0.2",
|
"glob": "^11.0.2",
|
||||||
"mocha": "^11.0.0",
|
"mocha": "^11.0.0",
|
||||||
"safe-code-point": "^3.0.2",
|
"safe-code-point": "^3.0.2",
|
||||||
"standard": "^17.0.0"
|
"standard": "^17.0.0",
|
||||||
|
"start-server-and-test": "^2.0.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"src",
|
"src",
|
||||||
|
18
server/index.html
Normal file
18
server/index.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Base65536</title>
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
import { encode, decode } from '../src/index.js'
|
||||||
|
const encoded = encode(new TextEncoder('utf-8').encode('what the heck is up'))
|
||||||
|
const uint8Array = new Uint8Array([119, 104, 97, 116, 32, 116, 104, 101, 32, 104, 101, 99, 107, 32, 105, 115, 32, 117, 112])
|
||||||
|
console.log(encode(uint8Array))
|
||||||
|
const decoded = new TextDecoder('utf-8').decode(decode(encoded))
|
||||||
|
document.querySelector('.root').appendChild(document.createTextNode(decoded))
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="root"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
7
server/server.js
Normal file
7
server/server.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import express from 'express'
|
||||||
|
|
||||||
|
const app = express()
|
||||||
|
app.use(express.static('.'))
|
||||||
|
app.listen(3000, () => {
|
||||||
|
console.log('listening')
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user