You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

ractive

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ractive - npm Package Compare versions

Comparing version

to
1.4.0-build-30

@@ -23,4 +23,11 @@ #!/usr/bin/env node

function readFile(name) {
return Promise.resolve(fs.readFileSync(path.resolve(opts.base, name), { encoding: 'utf8' }));
function mkReadFile(file) {
const base = path.isAbsolute(file)
? path.dirname(file)
: path.join(opts.base, path.dirname(file));
return function readFile(name) {
return Promise.resolve(
fs.readFileSync(path.isAbsolute(name) ? name : path.join(base, name), { encoding: 'utf8' })
);
};
}

@@ -80,10 +87,12 @@

.then(string => {
return component.build(string, opts, readFile).then(string => {
const file = path.join(
opts.output,
f.replace(ext, opts.outputExtension || '.js')
);
util.mkdirp(path.dirname(file));
util.writeToStream(fs.createWriteStream(file), string);
});
return component
.build(string, opts, mkReadFile(path.join(opts.directory, f)))
.then(string => {
const file = path.join(
opts.output,
f.replace(ext, opts.outputExtension || '.js')
);
util.mkdirp(path.dirname(file));
util.writeToStream(fs.createWriteStream(file), string);
});
})

@@ -103,3 +112,3 @@ .then(step, err => {

return component
.build(string, opts, readFile)
.build(string, opts, mkReadFile(''))
.then(string => util.writeToStream(opts.output, string));

@@ -106,0 +115,0 @@ })

@@ -66,3 +66,3 @@ /* eslint-env node */

// walk the template finding any script, style, or link tags to process them as appropriate
// walk the template finding any script, style, template, or link tags to process them as appropriate
let i = tpl.t.length;

@@ -116,3 +116,8 @@ while (i--) {

if (id) {
partials[id] = item.f ? item.f[0] : '';
const src = getAttr('src', item);
if (src) {
promises.push(readFile(src).then(str => !partials[id] && (partials[id] = str)));
} else {
partials[id] = item.f ? item.f[0] : '';
}
}

@@ -168,2 +173,19 @@

// extract any styles
i = t.t.length;
while (i--) {
if (t.e === 'style') {
const item = t.e[i];
const rel = getAttr('rel', item);
if (rel === 'ractive') {
style.unshift({ type: 'tpl', body: item.f[0] });
} else {
style.unshift({ type: 'css', body: item.f[0] || '' });
}
i = drop(i, tpl.t);
}
}
// copy any expressions

@@ -170,0 +192,0 @@ if (t.e) {

{
"name": "ractive",
"description": "Next-generation DOM manipulation",
"version": "1.4.0-build-3",
"version": "1.4.0-build-30",
"homepage": "https://ractive.js.org",

@@ -6,0 +6,0 @@ "license": "MIT",

// Type definitions for Ractive edge
// Project: https://ractive.js.org/
// Definitions By: Chris Reeves <https://github.com/evs-chris>
// Version: 1.0.0-edge+2018-04-22
// Version: 1.3

@@ -385,5 +385,5 @@ export interface ValueMap {

*/
set?: (value: any) => void;
set?: (this: T, value: any, context: any, keypath: string) => void;
}
export type ComputationFn<T extends Ractive<T> = Ractive> = (this: T) => any;
export type ComputationFn<T extends Ractive<T> = Ractive> = (this: T, context: any, keypath: string) => any;
export type Computation<T extends Ractive<T> = Ractive> = string | ComputationFn<T> | ComputationDescriptor<T>;

@@ -545,2 +545,3 @@

export interface MacroOpts {
attributes?: string[];
cssId?: string;

@@ -1013,3 +1014,3 @@ noCssTransform?: boolean;

components: Registry<Component>;
css: string|CssFn;
css?: string|CssFn;
decorators: Registry<Decorator<T>>;

@@ -1112,2 +1113,9 @@ easings: Registry<Easing>;

/**
* Create a new computation at the given path. This is the runtime equivalent of adding computed entries during initialization.
* @param keypath the keypath at which the computation will exist. This can include wildcards.
* @param computation the computation descriptor to install at the given keypath
*/
compute(keypath: string, computation: Computation<T>): Promise<void>;
/**
* Detach this instance from the DOM.

@@ -1181,3 +1189,3 @@ */

*/
fire(name: string, ctx: ContextHelper | {}, ...args: any[]): boolean;
fire(name: string, ctx?: ContextHelper | {}, ...args: any[]): boolean;

@@ -1208,3 +1216,3 @@ /**

*/
insert(target: Target, anchor: Target): void;
insert(target: Target, anchor?: Target): void;

@@ -1540,2 +1548,5 @@ /**

/** Render component styles in their own style tags rather than in a single shared tag - defaults to false */
let perComponentStyleElements: boolean;
/** true if Ractive detects that this environment supports svg. */

@@ -1569,3 +1580,3 @@ const svg: boolean;

*/
function macro(macro: MacroFn, options: MacroOpts): Macro;
function macro(macro: MacroFn, options?: MacroOpts): Macro;

@@ -1572,0 +1583,0 @@ /**

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet