New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ember-computed-template-string-parser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-computed-template-string-parser - npm Package Compare versions

Comparing version

to
0.1.0

.travis.yml

2

lib/parser.js

@@ -129,3 +129,3 @@ 'use strict';

value: function toJavaScript() {
var escaped = this.value.replace('"', '\\"');
var escaped = this.value.replace(/"/g, '\\"');
return '"' + escaped + '"';

@@ -132,0 +132,0 @@ }

{
"name": "ember-computed-template-string-parser",
"version": "0.0.3",
"version": "0.1.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/parser.js",

# ember-computed-template-string-parser
Readme coming soon...
[![Build Status](https://travis-ci.org/intercom/ember-computed-template-string-parser.svg?branch=master)](https://travis-ci.org/intercom/ember-computed-template-string-parser)
This simple package converts a string such as:
```
"hello ${name}!"
```
into:
```js
Ember.computed("name", function() {
return "hello " + this.get("name") + "!";
})
```
and is used in the [`ember-computed-template-string`](https://github.com/intercom/ember-computed-template-string) addon.

@@ -26,3 +26,3 @@ var assert = require('assert');

assertValidTemplate( //TODO: perhaps use brace expansion here?
assertValidTemplate(
"hello ${person.name} you are ${person.age} years old",

@@ -33,9 +33,9 @@ `Ember.computed("person.name", "person.age", function() { return "hello " + this.get("person.name") + " you are " + this.get("person.age") + " years old"; })`

assertValidTemplate(
"here is a single quote ${name} : '",
`Ember.computed("name", function() { return "here is a single quote " + this.get("name") + " : '"; })`
"here are some single quotes ${name} - 1:' 2:'",
`Ember.computed("name", function() { return "here are some single quotes " + this.get("name") + " - 1:' 2:'"; })`
);
assertValidTemplate(
'here is a double quote ${name} : "',
`Ember.computed("name", function() { return "here is a double quote " + this.get("name") + " : \\""; })`
'here are some double quotes ${name} - 1:" 2:"',
`Ember.computed("name", function() { return "here are some double quotes " + this.get("name") + " - 1:\\" 2:\\""; })`
);

@@ -42,0 +42,0 @@

Sorry, the diff of this file is not supported yet