Socket
Socket
Sign inDemoInstall

escape-code

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

26

index.js
'use strict';
module.exports = EscapeCode;
var Delegator = require('delegates');

@@ -9,9 +10,30 @@ function EscapeCode(str) {

String.call(this, str);
this._stringValue = str;
Object.defineProperty(this, '_stringValue', {
value: str
});
}
var ecp = EscapeCode.prototype = new String(); // jshint ignore:line
var ecp = EscapeCode.prototype;
ecp.isEscapeCode = true;
ecp.toString = ecp.valueOf = function() {
return this._stringValue;
};
new Delegator(ecp, '_stringValue')
.method('charAt')
.method('charCodeAt')
.method('concat')
.method('indexOf')
.method('lastIndexOf')
.method('match')
.method('replace')
.method('search')
.method('slice')
.method('split')
.method('substr')
.method('substring')
.method('toLowerCase')
.method('toUpperCase')
.method('trim');

12

package.json
{
"name": "escape-code",
"version": "0.0.1",
"description": "My ace module",
"version": "0.0.2",
"description": "ANSI Escape Code as an object",
"license": "MIT",

@@ -26,6 +26,6 @@ "repository": "jamestalmage/escape-code",

],
"keywords": [
""
],
"dependencies": {},
"keywords": [],
"dependencies": {
"delegates": "^0.1.0"
},
"devDependencies": {

@@ -32,0 +32,0 @@ "codeclimate-test-reporter": "^0.1.0",

# escape-code
Ansi Escape Code as an object
ANSI Escape Code as an object

@@ -27,6 +27,5 @@ [![Build Status](https://travis-ci.org/jamestalmage/escape-code.svg?branch=master)](https://travis-ci.org/jamestalmage/escape-code)

assert(code instanceof EscapeCode);
// or
assert(code.isEscapeCode); // boolean value === true
// it extends String
assert(code instanceof String);
// toString just returns what you put in.

@@ -45,5 +44,24 @@ assert.equal(code.toString(), '\u001b[32m');

Each instance has the following delegate methods that will be called on the
underlying String.
- charAt
- charCodeAt
- concat
- indexOf
- lastIndexOf
- match
- replace
- search
- slice
- split
- substr
- substring
- toLowerCase
- toUpperCase
- trim
## License
MIT © [James Talmage](http://github.com/jamestalmage)
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc