Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

as-uri-encode-decode

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-uri-encode-decode

AssemblyScript pollyfill for decodeURIComponent and encodeURIComponent

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

as-uri-encode-decode

Since decodeURIComponent and encodeURIComponent are not available yet: https://github.com/AssemblyScript/assemblyscript/wiki/Status-and-Roadmap#globals This module provides those functions written in AssemblyScript.

This implementation works for ISO-8859-1 but doesnt always deal with multi byte utf-8 decoding well, e.g. £ which is %C2%A3 in utf8, this would become in ISO-8859-1.

import {decodeURIComponent, encodeURIComponent} from "./urlencoder"


const input = "Hello! This is a test!?!?"

const output = encodeURIComponent(input)

// output = Hello%21%20This%20is%20a%20test%21%3F%21%3F

const result = decodeURIComponent(output)

// result = Hello! This is a test!?!?

Keywords

FAQs

Package last updated on 17 Mar 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc