Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit ffd83a6

Browse files
committed
Update README.md
1 parent d5987e2 commit ffd83a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ project. It provides a dynamic, but more succinct API than the above options.
154154
### JS Utils
155155

156156
ServiceStack.Text APIs for deserializing arbitrary JSON requires specifying the the Type to deserialize into. An alternative flexible approach to read any arbitrary JavaScript or JSON data structures is to use the high-performance and memory efficient JSON utils in
157-
[ServiceStack Templates](http://templates.servicestack.net) implementation of JavaScript.
157+
[#Script](https://sharpscript.net/) implementation of JavaScript.
158158

159159
```csharp
160160
JSON.parse("1") //= int 1
@@ -165,18 +165,18 @@ JSON.parse("{a:1}") //= new Dictionary<string, object> { {"a", 1 } }
165165

166166
#### Eval
167167

168-
Since JS Utils is an essential part of [ServiceStack Template language](http://templates.servicestack.net) it allows for advanced scenarios like implementing a text DSL or scripting language for executing custom logic or business rules you want to be able to change without having to compile or redeploy your App. It uses [Templates Sandbox](http://templates.servicestack.net/docs/sandbox) which lets you evaluate the script within a custom scope that defines what functions
168+
Since JS Utils is an essential part of [#Script](https://sharpscript.net/) it allows for advanced scenarios like implementing a text DSL or scripting language for executing custom logic or business rules you want to be able to change without having to compile or redeploy your App. It uses [#Script Context](https://sharpscript.net/docs/methods) which lets you evaluate the script within a custom scope that defines what functions
169169
and arguments it has access to, e.g:
170170

171171
```csharp
172-
public class CustomFilter : TemplateFilter
172+
public class CustomMethods : ScriptMethods
173173
{
174174
public string reverse(string text) => new string(text.Reverse().ToArray());
175175
}
176176

177177
var scope = JS.CreateScope(
178178
args: new Dictionary<string, object> { { "arg", "value"} },
179-
functions: new CustomFilter());
179+
functions: new CustomMethods());
180180

181181
JS.eval("arg", scope) //= "value"
182182
JS.eval("reverse(arg)", scope) //= "eulav"

0 commit comments

Comments
 (0)