
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
angular-full-width-to-half-width
Advanced tools
Full-width to half-width characters service and filters for AngularJS
Full-width to half-width character service and filters for AngularJS
This is a service for AngularJS that converts full-width Unicode characters to their half-width counterparts. This service can be used as is, or through the filter fullWidthToHalfWidth
.
At the moment the service only converts the characters in the Unicode range 0xFF00 - 0xFF5E. I am planning on adding the ability to convert the rest of the characters in the U+FF00 - U+FFEF block, but this will take time.
npm install --save angular-full-width-to-half-width
angular-full-width-to-half-width
to your application's module dependencies.<script src="node_modules/angular-full-width-to-half-width/dist/angular-full-width-to-half-width.min.js"></script>
<script src="YOUR_PATH/angular-full-width-to-half-width.min.js"></script>
fullWidthToHalfWidth
, or use the angular service fullWidthToHalfWidthService
.Converts the full-width characters in a string to half-width counterparts.
@param {string} value
The string containing characters to convert to half-width.@return {string}
A string containing half-width characters converted from the original value.Converts the full-width characters in a string to half-width counterparts.
@param {string} input
The string containing characters to convert to half-width.@return {string}
A string containing half-width characters converted from the original value.HTML
<p>
{{"hえllo world!" | fullWidthToHalfWidth }} : hえllo world!
</p>
<p>
{{"What, is this?" | fullWidthToHalfWidth}} : What, is this?
</p>
Result:
<p>
hえllo world! : hえllo world!
</p>
<p>
What, is this? : What, is this?
</p>
Javascript:
angular.module('app', ['angular-full-width-to-half-width']);
angular.module('app')
.controller('appController', function ($scope, $filter) {
$scope.javascriptTest = $filter('fullWidthToHalfWidth')("Hello world!");
$scope.javascriptExample = $filter('fullWidthToHalfWidth')("hえllo world!");
});
Result:
<p>
Hello world! : $scope.javascriptTest Hello world!
</p>
<p>
hえllo world! : $scope.javascriptString hえllo world!
</p>
MIT
FAQs
Full-width to half-width characters service and filters for AngularJS
We found that angular-full-width-to-half-width 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.