id
stringlengths
34
124
type
stringclasses
4 values
prompt
stringlengths
0
4.95k
response
stringlengths
21
4.89k
source_lang
stringclasses
3 values
target_lang
stringclasses
2 values
repo
stringclasses
75 values
path
stringlengths
10
88
license
stringclasses
1 value
commit
stringlengths
40
40
stars
int64
431
18.7k
source_url
stringlengths
86
176
line_start
int64
1
214
line_end
int64
3
253
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:raw_corpus
raw_corpus
sizes: -> return [] if not @engineData? and not @styles().FontSize? @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Proper...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
c4147283b54186aa133bd08677da52e5481b0566
2,846
https://github.com/meltingice/psd.js/blob/c4147283b54186aa133bd08677da52e5481b0566/lib/psd/layer_info/typetool.coffee
56
105
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript sizes: -> return [] if not @engineData? and not @styles().FontSize? @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> ...
var hasProp = {}.hasOwnProperty; ({ sizes: function() { if ((this.engineData == null) && (this.styles().FontSize == null)) { return []; } return this.styles().FontSize; }, alignment: function() { var alignments; if (this.engineData == null) { return []; } alignments = ['le...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
c4147283b54186aa133bd08677da52e5481b0566
2,846
https://github.com/meltingice/psd.js/blob/c4147283b54186aa133bd08677da52e5481b0566/lib/psd/layer_info/typetool.coffee
56
105
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var hasProp = {}.hasOwnProperty; ({ sizes: function() { if ((this.engineData == null) && (this.styles().FontSize == null)) { return []; } return this.styles().FontSize; }, alignment: function() { var alignments; if (this.engineData ...
sizes: -> return [] if not @engineData? and not @styles().FontSize? @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Proper...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
c4147283b54186aa133bd08677da52e5481b0566
2,846
https://github.com/meltingice/psd.js/blob/c4147283b54186aa133bd08677da52e5481b0566/lib/psd/layer_info/typetool.coffee
56
105
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:completion
completion
sizes: -> return [] if not @engineData? and not @styles().FontSize? @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Proper...
data = @engineData.EngineDict.StyleRun.RunArray.map (r) -> r.StyleSheet.StyleSheetData @_styles = _.reduce(data, (m, o) -> for own k, v of o m[k] or= [] m[k].push v m , {}) # Creates the CSS string and returns it. Each property is newline separated # and not all propertie...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
c4147283b54186aa133bd08677da52e5481b0566
2,846
https://github.com/meltingice/psd.js/blob/c4147283b54186aa133bd08677da52e5481b0566/lib/psd/layer_info/typetool.coffee
56
105
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:raw_corpus
raw_corpus
css.push "#{k}: #{v};" css.join("\n") export: -> value: @textValue font: name: @fonts()[0] sizes: @sizes() colors: @colors() alignment: @alignment() left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
c4147283b54186aa133bd08677da52e5481b0566
2,846
https://github.com/meltingice/psd.js/blob/c4147283b54186aa133bd08677da52e5481b0566/lib/psd/layer_info/typetool.coffee
106
121
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:completion
completion
css.push "#{k}: #{v};" css.join("\n") export: -> value: @textValue font: name: @fonts()[0]
sizes: @sizes() colors: @colors() alignment: @alignment() left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
c4147283b54186aa133bd08677da52e5481b0566
2,846
https://github.com/meltingice/psd.js/blob/c4147283b54186aa133bd08677da52e5481b0566/lib/psd/layer_info/typetool.coffee
106
121
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:raw_corpus
raw_corpus
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8560364d7fc7df297564c685d9e54b87f1635342
2,846
https://github.com/meltingice/psd.js/blob/8560364d7fc7df297564c685d9e54b87f1635342/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) ...
var TextElements; module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerInfo { static shouldParse(key) { return key === 'TySh'; } constructor(layer, length) { super(layer, length); this.version = null; this.transform =...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8560364d7fc7df297564c685d9e54b87f1635342
2,846
https://github.com/meltingice/psd.js/blob/8560364d7fc7df297564c685d9e54b87f1635342/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var TextElements; module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerInfo { static shouldParse(key) { return key === 'TySh'; } constructor(layer, length) { super(layer, len...
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8560364d7fc7df297564c685d9e54b87f1635342
2,846
https://github.com/meltingice/psd.js/blob/8560364d7fc7df297564c685d9e54b87f1635342/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:completion
completion
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
@parseTransformInfo() @textVersion = @file.readShort() @descriptorVersion = @file.readInt() @textData = new Descriptor(@file).parse() @textValue = @textData['Txt '] @engineData = parseEngineData(@textData.EngineData) @warpVersion = @file.readShort() @descriptorVersion = @file.readInt() ...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8560364d7fc7df297564c685d9e54b87f1635342
2,846
https://github.com/meltingice/psd.js/blob/8560364d7fc7df297564c685d9e54b87f1635342/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:raw_corpus
raw_corpus
css.push "#{k}: #{v};" css.join("\n") export: -> value: @textValue font: @fonts()[0] left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8560364d7fc7df297564c685d9e54b87f1635342
2,846
https://github.com/meltingice/psd.js/blob/8560364d7fc7df297564c685d9e54b87f1635342/lib/psd/layer_info/typetool.coffee
106
117
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:completion
completion
css.push "#{k}: #{v};" css.join("\n") export: -> value: @textValue
font: @fonts()[0] left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8560364d7fc7df297564c685d9e54b87f1635342
2,846
https://github.com/meltingice/psd.js/blob/8560364d7fc7df297564c685d9e54b87f1635342/lib/psd/layer_info/typetool.coffee
106
117
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:raw_corpus
raw_corpus
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) ...
var TextElements; module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerInfo { static shouldParse(key) { return key === 'TySh'; } constructor(layer, length) { super(layer, length); this.version = null; this.transform =...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var TextElements; module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerInfo { static shouldParse(key) { return key === 'TySh'; } constructor(layer, length) { super(layer, len...
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:completion
completion
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
@transform[name] = @file.readDouble() @textVersion = @file.readShort() @descriptorVersion = @file.readInt() @textData = new Descriptor(@file).parse() @textValue = @textData['Txt '] @engineData = parseEngineData(@textData.EngineData) @warpVersion = @file.readShort() @descriptorVersion = @...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:raw_corpus
raw_corpus
export: -> value: @textValue font: @fonts()[0] left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
106
114
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript export: -> value: @textValue font: @fonts()[0] left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform ```
({ export: function() { return { value: this.textValue, font: this.fonts()[0], left: this.coords.left, top: this.coords.top, right: this.coords.right, bottom: this.coords.bottom, transform: this.transform }; } });
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
106
114
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ export: function() { return { value: this.textValue, font: this.fonts()[0], left: this.coords.left, top: this.coords.top, right: this.coords.right, bottom: this.coords.bottom, transform: this.transform }; } }...
export: -> value: @textValue font: @fonts()[0] left: @coords.left top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
106
114
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:3:completion
completion
export: -> value: @textValue font: @fonts()[0] left: @coords.left
top: @coords.top right: @coords.right bottom: @coords.bottom transform: @transform
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
2ac22aefd944f446b492a47b032a4209a0166473
2,846
https://github.com/meltingice/psd.js/blob/2ac22aefd944f446b492a47b032a4209a0166473/lib/psd/layer_info/typetool.coffee
106
114
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:raw_corpus
raw_corpus
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) ...
var TextElements; module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerInfo { static shouldParse(key) { return key === 'TySh'; } constructor(layer, length) { super(layer, length); this.version = null; this.transform =...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var TextElements; module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerInfo { static shouldParse(key) { return key === 'TySh'; } constructor(layer, length) { super(layer, len...
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:completion
completion
module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'right', 'bottom'] constructor: (layer, length) -> super(layer, length) @version = null @transform = {} @textVersion...
@transform[name] = @file.readDouble() @textVersion = @file.readShort() @descriptorVersion = @file.readInt() @textData = new Descriptor(@file).parse() @textValue = @textData['Txt '] @engineData = parseEngineData(@textData.EngineData) @warpVersion = @file.readShort() @descriptorVersion = @...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
6
55
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:raw_corpus
raw_corpus
alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Properties.Justification, 10), 3)] # Return all colors used for text in this layer. The colors are re...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
56
86
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Properties.Justification, 10), 3)] # Return ...
var hasProp = {}.hasOwnProperty; ({ alignment: function() { var alignments; if (this.engineData == null) { return []; } alignments = ['left', 'right', 'center', 'justify']; return this.engineData.EngineDict.ParagraphRun.RunArray.map(function(s) { return alignments[Math.min(parseInt(s....
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
56
86
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var hasProp = {}.hasOwnProperty; ({ alignment: function() { var alignments; if (this.engineData == null) { return []; } alignments = ['left', 'right', 'center', 'justify']; return this.engineData.EngineDict.ParagraphRun.RunArray.map(fun...
alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Properties.Justification, 10), 3)] # Return all colors used for text in this layer. The colors are re...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
56
86
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:completion
completion
alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) -> alignments[Math.min(parseInt(s.ParagraphSheet.Properties.Justification, 10), 3)] # Return all colors used for text in this layer. The colors are re...
values styles: -> return {} unless @engineData? return @_styles if @_styles? data = @engineData.EngineDict.StyleRun.RunArray.map (r) -> r.StyleSheet.StyleSheetData @_styles = _.reduce(data, (m, o) -> for own k, v of o m[k] or= [] m[k].push v m , {})
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
a27023a9fbdf78e62addf56dd09db387a12030e9
2,846
https://github.com/meltingice/psd.js/blob/a27023a9fbdf78e62addf56dd09db387a12030e9/lib/psd/layer_info/typetool.coffee
56
86
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:raw_corpus
raw_corpus
_ = require 'lodash' parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript _ = require 'lodash' parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VA...
var Descriptor, LayerInfo, TextElements, _, parseEngineData; _ = require('lodash'); parseEngineData = require('parse-engine-data'); LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class ...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Descriptor, LayerInfo, TextElements, _, parseEngineData; _ = require('lodash'); parseEngineData = require('parse-engine-data'); LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = TextElements = (func...
_ = require 'lodash' parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:completion
completion
_ = require 'lodash' parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE...
parse: -> @version = @file.readShort() for name, index in TRANSFORM_VALUE @transform[name] = @file.readDouble() @textVersion = @file.readShort() @descriptorVersion = @file.readInt() @textData = new Descriptor(@file).parse() @textValue = @textData['Txt '] @engineData = parseEngineDat...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:raw_corpus
raw_corpus
@engineData.ResourceDict.FontSet.map (f) -> f.Name sizes: -> return [] if not @engineData? and not @styles().FontSize? _.uniq @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) ...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
51
75
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript @engineData.ResourceDict.FontSet.map (f) -> f.Name sizes: -> return [] if not @engineData? and not @styles().FontSize? _.uniq @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] ...
var hasProp = {}.hasOwnProperty; this.engineData.ResourceDict.FontSet.map(function(f) { return f.Name({ sizes: function() { if ((this.engineData == null) && (this.styles().FontSize == null)) { return []; } return _.uniq(this.styles().FontSize); }, alignment: function() { v...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
51
75
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var hasProp = {}.hasOwnProperty; this.engineData.ResourceDict.FontSet.map(function(f) { return f.Name({ sizes: function() { if ((this.engineData == null) && (this.styles().FontSize == null)) { return []; } return _.uniq(this.styles(...
@engineData.ResourceDict.FontSet.map (f) -> f.Name sizes: -> return [] if not @engineData? and not @styles().FontSize? _.uniq @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) ...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
51
75
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:2:completion
completion
@engineData.ResourceDict.FontSet.map (f) -> f.Name sizes: -> return [] if not @engineData? and not @styles().FontSize? _.uniq @styles().FontSize alignment: -> return [] unless @engineData? alignments = ['left', 'right', 'center', 'justify'] @engineData.EngineDict.ParagraphRun.RunArray.map (s) ...
styles: -> return {} unless @engineData? return @_styles if @_styles? data = @engineData.EngineDict.StyleRun.RunArray.map (r) -> r.StyleSheet.StyleSheetData @_styles = _.reduce(data, (m, o) -> for own k, v of o m[k] or= [] m[k].push v m , {})
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
eff5abdfc80ff82a75d381ff8ecb3be45a6e3492
2,846
https://github.com/meltingice/psd.js/blob/eff5abdfc80ff82a75d381ff8ecb3be45a6e3492/lib/psd/layer_info/typetool.coffee
51
75
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:raw_corpus
raw_corpus
parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'r...
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8be456c864d82116a05e3cc1cebf25d7a8ba2726
2,846
https://github.com/meltingice/psd.js/blob/8be456c864d82116a05e3cc1cebf25d7a8ba2726/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'y...
var Descriptor, LayerInfo, TextElements, parseEngineData; parseEngineData = require('parse-engine-data'); LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = TextElements = (function() { var COORDS_VALUE, TRANSFORM_VALUE; class TextElements extends LayerI...
CoffeeScript
JavaScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8be456c864d82116a05e3cc1cebf25d7a8ba2726
2,846
https://github.com/meltingice/psd.js/blob/8be456c864d82116a05e3cc1cebf25d7a8ba2726/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var Descriptor, LayerInfo, TextElements, parseEngineData; parseEngineData = require('parse-engine-data'); LayerInfo = require('../layer_info.coffee'); Descriptor = require('../descriptor.coffee'); module.exports = TextElements = (function() { var COORDS_VALUE...
parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'r...
JavaScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8be456c864d82116a05e3cc1cebf25d7a8ba2726
2,846
https://github.com/meltingice/psd.js/blob/8be456c864d82116a05e3cc1cebf25d7a8ba2726/lib/psd/layer_info/typetool.coffee
1
50
meltingice/psd.js:lib/psd/layer_info/typetool.coffee:1:completion
completion
parseEngineData = require 'parse-engine-data' LayerInfo = require '../layer_info.coffee' Descriptor = require '../descriptor.coffee' module.exports = class TextElements extends LayerInfo @shouldParse: (key) -> key is 'TySh' TRANSFORM_VALUE = ['xx', 'xy', 'yx', 'yy', 'tx', 'ty'] COORDS_VALUE = ['left', 'top', 'r...
parse: -> @version = @file.readShort() for name, index in TRANSFORM_VALUE @transform[name] = @file.readDouble() @textVersion = @file.readShort() @descriptorVersion = @file.readInt() @textData = new Descriptor(@file).parse() @textValue = @textData['Txt '] @engineData = parseEngineDat...
CoffeeScript
CoffeeScript
meltingice/psd.js
lib/psd/layer_info/typetool.coffee
MIT
8be456c864d82116a05e3cc1cebf25d7a8ba2726
2,846
https://github.com/meltingice/psd.js/blob/8be456c864d82116a05e3cc1cebf25d7a8ba2726/lib/psd/layer_info/typetool.coffee
1
50
oozcitak/xmlbuilder-js:test/issues/171.coffee:1:raw_corpus
raw_corpus
suite 'Tests specific to issues:', -> test 'Inline elements within Text Decorator throws error. Issue 171', -> obj = { pc: { '#text': [ 'Hello ', { mrk: { '#text': 'World', '@id': 'm1', '@type': 'term' } }, '!', ], '@id': 1, }, } eq( ...
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/171.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/171.coffee
1
44
oozcitak/xmlbuilder-js:test/issues/171.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript suite 'Tests specific to issues:', -> test 'Inline elements within Text Decorator throws error. Issue 171', -> obj = { pc: { '#text': [ 'Hello ', { mrk: { '#text': 'World', '@id': 'm1', '@type': 'term' } }, '!', ...
suite('Tests specific to issues:', function() { test('Inline elements within Text Decorator throws error. Issue 171', function() { var obj; obj = { pc: { '#text': [ 'Hello ', { mrk: { '#text': 'World', '@id': 'm1', '@type'...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
test/issues/171.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/171.coffee
1
44
oozcitak/xmlbuilder-js:test/issues/171.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript suite('Tests specific to issues:', function() { test('Inline elements within Text Decorator throws error. Issue 171', function() { var obj; obj = { pc: { '#text': [ 'Hello ', { mrk: { '#text': 'W...
suite 'Tests specific to issues:', -> test 'Inline elements within Text Decorator throws error. Issue 171', -> obj = { pc: { '#text': [ 'Hello ', { mrk: { '#text': 'World', '@id': 'm1', '@type': 'term' } }, '!', ], '@id': 1, }, } eq( ...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/171.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/171.coffee
1
44
oozcitak/xmlbuilder-js:test/issues/171.coffee:1:completion
completion
suite 'Tests specific to issues:', -> test 'Inline elements within Text Decorator throws error. Issue 171', -> obj = { pc: { '#text': [ 'Hello ', { mrk: { '#text': 'World', '@id': 'm1', '@type': 'term' } }, '!', ], '@id': 1, }, } eq( ...
test 'Nested mixed-content', -> obj = { pc: { '#text': [ 'Hello ', { nested: { nestedagain: { '#text': 'World' }, '#text': '!' } } '!', ], '@id': 1, }, } eq( xml(obj, { headless: true }).end() '<pc id="1">' + 'Hello ' + ...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
test/issues/171.coffee
MIT
ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1
926
https://github.com/oozcitak/xmlbuilder-js/blob/ce625aeb9f52d1f75d5d94260794d3b5fd74a8b1/test/issues/171.coffee
1
44
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus
raw_corpus
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded:...
var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.version` The version number string of the XML spec to validate against, e.g. 1.0 // `options.noDoubleEncoding` whether existing html entities ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.version` The version number string of the XML spec to validate against, e.g. 1.0 // `op...
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion
completion
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions...
if @options.noEscaping then return val val = '' + val or '' val = val.replace(']]>', ']]]]><![CDATA[>') @assertLegalChar val comment: (val) -> if @options.noEscaping then return val val = '' + val or '' if val.match /--/ throw new Error "Comment text cannot contain double-hypen: " + val ...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus
raw_corpus
xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /^[A-Za-z](?:[A-Za-z0-...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '...
({ xmlVersion: function(val) { if (this.options.noEscaping) { return val; } val = '' + val || ''; if (!val.match(/1\.[0-9]+/)) { throw new Error("Invalid version number: " + val); } return val; }, xmlEncoding: function(val) { if (this.options.noEscaping) { return val;...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ xmlVersion: function(val) { if (this.options.noEscaping) { return val; } val = '' + val || ''; if (!val.match(/1\.[0-9]+/)) { throw new Error("Invalid version number: " + val); } return val; }, xmlEncoding: function(val)...
xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /^[A-Za-z](?:[A-Za-z0-...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion
completion
xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /^[A-Za-z](?:[A-Za-z0-...
if @options.noEscaping then return val @assertLegalChar '' + val or '' dtdAttDefault: (val) -> if @options.noEscaping then return val @assertLegalChar '' + val or '' dtdEntityValue: (val) -> if @options.noEscaping then return val @assertLegalChar '' + val or '' dtdNData: (val) -> if @optio...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus
raw_corpus
assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. ...
({ assertLegalChar: (str) => { var regex, res; if (this.options.noEscaping) { return str; } regex = ''; if (this.options.version === '1.0') { // Valid characters from https://www.w3.org/TR/xml/#charsets // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ assertLegalChar: (str) => { var regex, res; if (this.options.noEscaping) { return str; } regex = ''; if (this.options.version === '1.0') { // Valid characters from https://www.w3.org/TR/xml/#charsets // any Unicode charact...
assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion
completion
assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]...
# .addRange(0xD800, 0xDFFF) # .addRange(0xFFFE, 0xFFFF) regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/ if res = str.match(regex) throw new Error "Invalid character in string: #{str} at index #{res.index}" return str # Escapes...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:4:raw_corpus
raw_corpus
# `str` the string to escape attEscape: (str) -> if @options.noEscaping then return str ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/"/g, '&quot;') .replace(/\t/g, '&#x9;') .replace(/\n/g, '...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
152
161
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:4:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript # `str` the string to escape attEscape: (str) -> if @options.noEscaping then return str ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/"/g, '&quot;')...
// `str` the string to escape ({ attEscape: function(str) { var ampregex; if (this.options.noEscaping) { return str; } ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/"/g, '&quot;').replace(/\t/g, '&#x9;')....
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
152
161
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:4:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript // `str` the string to escape ({ attEscape: function(str) { var ampregex; if (this.options.noEscaping) { return str; } ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; return str.replace(ampregex, '&amp;').replace(/</g, '...
# `str` the string to escape attEscape: (str) -> if @options.noEscaping then return str ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/"/g, '&quot;') .replace(/\t/g, '&#x9;') .replace(/\n/g, '...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
152
161
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:4:completion
completion
# `str` the string to escape attEscape: (str) -> if @options.noEscaping then return str ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;')
.replace(/</g, '&lt;') .replace(/"/g, '&quot;') .replace(/\t/g, '&#x9;') .replace(/\n/g, '&#xA;') .replace(/\r/g, '&#xD;')
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
7d2f527f2926d31cdc8fbccc27af80b583e05253
926
https://github.com/oozcitak/xmlbuilder-js/blob/7d2f527f2926d31cdc8fbccc27af80b583e05253/src/XMLStringifier.coffee
152
161
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus
raw_corpus
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded:...
var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.version` The version number string of the XML spec to validate against, e.g. 1.0 // `options.noDoubleEncoding` whether existing html entities ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.version` The version number string of the XML spec to validate against, e.g. 1.0 // `op...
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion
completion
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.version` The version number string of the XML spec to validate against, e.g. 1.0 # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions...
if @options.noEscaping then return val val = '' + val or '' val = val.replace(']]>', ']]]]><![CDATA[>') @assertLegalChar val comment: (val) -> if @options.noEscaping then return val val = '' + val or '' if val.match /--/ throw new Error "Comment text cannot contain double-hypen: " + val ...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus
raw_corpus
assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. ...
({ assertLegalChar: (str) => { var regex, res; if (this.options.noEscaping) { return str; } regex = ''; if (this.options.version === '1.0') { // Valid characters from https://www.w3.org/TR/xml/#charsets // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript ({ assertLegalChar: (str) => { var regex, res; if (this.options.noEscaping) { return str; } regex = ''; if (this.options.version === '1.0') { // Valid characters from https://www.w3.org/TR/xml/#charsets // any Unicode charact...
assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion
completion
assertLegalChar: (str) => if @options.noEscaping then return str regex = '' if @options.version is '1.0' # Valid characters from https://www.w3.org/TR/xml/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]...
# .addRange(0xD800, 0xDFFF) # .addRange(0xFFFE, 0xFFFF) regex = /[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/ if res = str.match(regex) throw new Error "Invalid character in string: #{str} at index #{res.index}" return str # Escapes...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
83b747fd14400a741510f32b640ec9183883400d
926
https://github.com/oozcitak/xmlbuilder-js/blob/83b747fd14400a741510f32b640ec9183883400d/src/XMLStringifier.coffee
102
151
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus
raw_corpus
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings # `options.noEscaping` whether values will be escap...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to stri...
var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.noDoubleEncoding` whether existing html entities are encoded: true or false // `options.stringify` a set of functions to use for converting va...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.noDoubleEncoding` whether existing html entities are encoded: true or false // `options...
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings # `options.noEscaping` whether values will be escap...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion
completion
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings # `options.noEscaping` whether values will be escap...
if @options.noEscaping then return val val = '' + val or '' val = val.replace(']]>', ']]]]><![CDATA[>') @assertLegalChar val comment: (val) -> if @options.noEscaping then return val val = '' + val or '' if val.match /--/ throw new Error "Comment text cannot contain double-hypen: " + val ...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus
raw_corpus
val xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /^[A-Za-z](?:[A-...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript val xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val v...
val({ xmlVersion: function(val) { if (this.options.noEscaping) { return val; } val = '' + val || ''; if (!val.match(/1\.[0-9]+/)) { throw new Error("Invalid version number: " + val); } return val; }, xmlEncoding: function(val) { if (this.options.noEscaping) { return v...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript val({ xmlVersion: function(val) { if (this.options.noEscaping) { return val; } val = '' + val || ''; if (!val.match(/1\.[0-9]+/)) { throw new Error("Invalid version number: " + val); } return val; }, xmlEncoding: function(v...
val xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /^[A-Za-z](?:[A-...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion
completion
val xmlVersion: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /1\.[0-9]+/ throw new Error "Invalid version number: " + val val xmlEncoding: (val) -> if @options.noEscaping then return val val = '' + val or '' if not val.match /^[A-Za-z](?:[A-...
dtdAttType: (val) -> if @options.noEscaping then return val '' + val or '' dtdAttDefault: (val) -> if @options.noEscaping then return val if val? then '' + val or '' else val dtdEntityValue: (val) -> if @options.noEscaping then return val '' + val or '' dtdNData: (val) -> if @options.n...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus
raw_corpus
# `str` the string to check assertLegalChar: (str) => if @options.noEscaping then return str # Valid characters from https://www.w3.org/TR/xml11/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] # This complex E...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
102
142
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript # `str` the string to check assertLegalChar: (str) => if @options.noEscaping then return str # Valid characters from https://www.w3.org/TR/xml11/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # [#x1-#xD7FF] | ...
// `str` the string to check ({ assertLegalChar: (str) => { var res; if (this.options.noEscaping) { return str; } // Valid characters from https://www.w3.org/TR/xml11/#charsets // any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. // [#x1-#xD7FF] | [#xE000-#xFFFD] | [...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
102
142
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript // `str` the string to check ({ assertLegalChar: (str) => { var res; if (this.options.noEscaping) { return str; } // Valid characters from https://www.w3.org/TR/xml11/#charsets // any Unicode character, excluding the surrogate blocks, FF...
# `str` the string to check assertLegalChar: (str) => if @options.noEscaping then return str # Valid characters from https://www.w3.org/TR/xml11/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] # This complex E...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
102
142
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion
completion
# `str` the string to check assertLegalChar: (str) => if @options.noEscaping then return str # Valid characters from https://www.w3.org/TR/xml11/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. # [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] # This complex E...
if @options.noEscaping then return str ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes special characters in attribute values # # See http://www.w3.org...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
3ea28fa414af4cf62b9583bb975ad1f1fb194372
926
https://github.com/oozcitak/xmlbuilder-js/blob/3ea28fa414af4cf62b9583bb975ad1f1fb194372/src/XMLStringifier.coffee
102
142
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus
raw_corpus
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @o...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e
926
https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion
completion
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @o...
comment: (val) -> val = '' + val or '' if val.match /--/ throw new Error "Comment text cannot contain double-hypen: " + val @assertLegalChar val raw: (val) -> '' + val or '' attValue: (val) -> val = '' + val or '' @attEscape val insTarget: (val) -> '' + val or '' insValue: (val...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e
926
https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus
raw_corpus
throw new Error "Invalid encoding: " + val val xmlStandalone: (val) -> if val then "yes" else "no" dtdPubID: (val) -> '' + val or '' dtdSysID: (val) -> '' + val or '' dtdElementValue: (val) -> '' + val or '' dtdAttType: (val) -> '' + val or '' dtdAttDefault: (val) -> if val? then...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e
926
https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion
completion
throw new Error "Invalid encoding: " + val val xmlStandalone: (val) -> if val then "yes" else "no" dtdPubID: (val) -> '' + val or '' dtdSysID: (val) -> '' + val or '' dtdElementValue: (val) -> '' + val or '' dtdAttType: (val) -> '' + val or '' dtdAttDefault: (val) -> if val? then...
convertRawKey: '#raw' # Checks whether the given string contains legal characters # Fails with an exception on error # # `str` the string to check assertLegalChar: (str) => # Valid characters from https://www.w3.org/TR/xml11/#charsets # any Unicode character, excluding the surrogate blocks, FFFE, an...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e
926
https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus
raw_corpus
ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes special characters in attribute values # # See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charesca...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e
926
https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLStringifier.coffee
102
120
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion
completion
ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes special characters in attribute values # # See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charesca...
# # `str` the string to escape attEscape: (str) -> ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/"/g, '&quot;') .replace(/\t/g, '&#x9;') .replace(/\n/g, '&#xA;') .replace(/\r/g, '&#xD;')
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e
926
https://github.com/oozcitak/xmlbuilder-js/blob/b38e655b1c8b3f940de5f764029d4cb6c4bc5d9e/src/XMLStringifier.coffee
102
120
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus
raw_corpus
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @o...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to stri...
var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.noDoubleEncoding` whether existing html entities are encoded: true or false // `options.stringify` a set of functions to use for converting va...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.noDoubleEncoding` whether existing html entities are encoded: true or false // `options...
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @o...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion
completion
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @o...
comment: (val) -> val = '' + val or '' if val.match /--/ throw new Error "Comment text cannot contain double-hypen: " + val @assertLegalChar val raw: (val) -> '' + val or '' attName: (val) -> val = '' + val or '' attValue: (val) -> val = '' + val or '' @attEscape val insTarget:...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:raw_corpus
raw_corpus
val = '' + val or '' if not val.match /^[A-Za-z](?:[A-Za-z0-9._-])*$/ throw new Error "Invalid encoding: " + val val xmlStandalone: (val) -> if val then "yes" else "no" dtdPubID: (val) -> '' + val or '' dtdSysID: (val) -> '' + val or '' dtdElementValue: (val) -> '' + val or '' dt...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:2:completion
completion
val = '' + val or '' if not val.match /^[A-Za-z](?:[A-Za-z0-9._-])*$/ throw new Error "Invalid encoding: " + val val xmlStandalone: (val) -> if val then "yes" else "no" dtdPubID: (val) -> '' + val or '' dtdSysID: (val) -> '' + val or '' dtdElementValue: (val) -> '' + val or '' dt...
convertCDataKey: '#cdata' convertCommentKey: '#comment' convertRawKey: '#raw' # Checks whether the given string contains legal characters # Fails with an exception on error # # `str` the string to check assertLegalChar: (str) => # Valid characters from https://www.w3.org/TR/xml11/#charsets # any...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
52
101
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:raw_corpus
raw_corpus
# `str` the string to escape txtEscape: (str) -> ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes special characters in attribute values # # See http:...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
102
122
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript # `str` the string to escape txtEscape: (str) -> ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes...
// `str` the string to escape ({ txtEscape: function(str) { var ampregex; ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;'); }, // Escapes special characters in attribute values ...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
102
122
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript // `str` the string to escape ({ txtEscape: function(str) { var ampregex; ampregex = this.options.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g; return str.replace(ampregex, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\r/g, '&#xD;'); }, ...
# `str` the string to escape txtEscape: (str) -> ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes special characters in attribute values # # See http:...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
102
122
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:3:completion
completion
# `str` the string to escape txtEscape: (str) -> ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/\r/g, '&#xD;') # Escapes special characters in attribute values #
# See http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping # # `str` the string to escape attEscape: (str) -> ampregex = if @options.noDoubleEncoding then /(?!&\S+;)&/g else /&/g str.replace(ampregex, '&amp;') .replace(/</g, '&lt;') .replace(/"/g, '&quot;') .replace(/\t/g,...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
ed4adcffedcadbeac102d6424e99183400a2a4fe
926
https://github.com/oozcitak/xmlbuilder-js/blob/ed4adcffedcadbeac102d6424e99183400a2a4fe/src/XMLStringifier.coffee
102
122
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:raw_corpus
raw_corpus
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @n...
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:coffee_to_js
coffee_to_js
Convert this CoffeeScript to JavaScript. ```coffeescript module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to stri...
var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.noDoubleEncoding` whether existing html entities are encoded: true or false // `options.stringify` a set of functions to use for converting va...
CoffeeScript
JavaScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:js_to_coffee
js_to_coffee
Convert this JavaScript to CoffeeScript. ```javascript var XMLStringifier, hasProp = {}.hasOwnProperty; module.exports = XMLStringifier = class XMLStringifier { // Initializes a new instance of `XMLStringifier` // `options.noDoubleEncoding` whether existing html entities are encoded: true or false // `options...
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @n...
JavaScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee
2
51
oozcitak/xmlbuilder-js:src/XMLStringifier.coffee:1:completion
completion
module.exports = class XMLStringifier # Initializes a new instance of `XMLStringifier` # # `options.noDoubleEncoding` whether existing html entities are encoded: true or false # `options.stringify` a set of functions to use for converting values to strings constructor: (options) -> options or= {} @n...
val = '' + val or '' if val.match /--/ throw new Error "Comment text cannot contain double-hypen: " + val @assertLegalChar val raw: (val) -> '' + val or '' attName: (val) -> val = '' + val or '' attValue: (val) -> val = '' + val or '' @attEscape val insTarget: (val) -> '' + val...
CoffeeScript
CoffeeScript
oozcitak/xmlbuilder-js
src/XMLStringifier.coffee
MIT
bbf929a8a54f0d012bdc44cbe622fdeda2509230
926
https://github.com/oozcitak/xmlbuilder-js/blob/bbf929a8a54f0d012bdc44cbe622fdeda2509230/src/XMLStringifier.coffee
2
51