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

morphling

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morphling - npm Package Compare versions

Comparing version 0.1.7 to 0.1.8

8

CONTRIBUTING.md

@@ -0,1 +1,9 @@

# CONTRIBUTING
All sorts of contributions are welcome. Please help me add more helpful filters for VueJs.
## Features
For *Enhancement* or *New feature*.
Make sure to follow the coding pattern. The contributor is also responsible for creating the docs in the README.md

25

morphs/sandwich/index.js

@@ -0,1 +1,13 @@

const corpus = {
'<': '>',
'>': '<',
'[': ']',
']': '[',
'(': ')',
')': '(',
'{': '}',
'}': '{',
};
const corpusRegex = /(<|>|\[|\]|\(|\)|\{|\})/g;
export default (Vue) => {

@@ -10,5 +22,16 @@ Vue.filter('morph-sandwich', (value, start, end) => {

function flip (str) {
return str.replace(corpusRegex, match => corpus[match])
.split('')
.reverse()
.join('');
}
function sandwich(value, start, end) {
start = start || '';
end = end || flip(start);
return `${ start }${ value }${ end }`;
}
};
};

2

package.json

@@ -6,3 +6,3 @@ {

"name": "morphling",
"version": "0.1.7",
"version": "0.1.8",
"description": "A collection of VueJs filters.",

@@ -9,0 +9,0 @@ "main": "index.js",

@@ -305,2 +305,5 @@ # Mophling

If only a single argument is given, it is used to surround the sandwiched
content by matching open brackets for closed brackets, and so on.
*Syntax*

@@ -313,7 +316,13 @@

<!-- In the end! -->
<p>{{{ 'Numb' | morph-sandwich('<<< ') }}}</p>
<!-- <<< Numb >>> -->
```
```javascript
const msg = this.$morphSandwich('the', 'In ', ' end!');
console.log(msg); // In the end!
const msg1 = this.$morphSandwich('the', 'In ', ' end!');
console.log(msg1); // In the end!
const msg2 = this.$morphSandwich('Numb', '<<< ');
console.log(msg2); // <<< Numb >>>
```

@@ -361,7 +370,8 @@

- Updated [morph-sandwich](#morph-sandwich) filter.
- Added [morph-replace](#morph-replace) filter.
- Added [morph-truncate](#morph-truncate) filter.
- Added [morph-placeholder](#morph-placeholder) filter.
- Added [morph-curreny](#morph-curreny) filter.
- Added [morph-placeholder](#morph-placeholder) filter.
- Added [morph-replace](#morph-replace) filter.
- Added [morph-sandwich](#morph-sandwich) filter.
- Added [morph-truncate](#morph-truncate) filter.

@@ -368,0 +378,0 @@ *"When my time comes,

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